Three and a half Ways to Prove Euler's formula
Euler's formula $e^{i\theta} = \cos\theta + i\sin\theta$ is one of the most important formulae in engineering and science. See, for example, a beautifully done video about Euler's formula with $\theta=\pi$:
1. Maclaurin Series
This is the most common proof you see on textbooks. The Maclaurin series of $e^{i\theta}$ reads
\begin{align*}
e^{i\theta} &= \sum_{k = 0}^{\infty} \frac{(i\theta)^k}{k!} = 1+i\theta -\frac{1}{2}\theta^2 - \frac{i}{3!}\theta^3 +\frac{1}{4!}\theta^4+\frac{i}{5!}\theta^5 - \cdots\\
&= (1-\frac{1}{2}\theta^2+\frac{1}{4!}\theta^4 - \cdots) + i(\theta- \frac{1}{3!}\theta^3+\frac{1}{5!}\theta^5- \cdots)
\end{align*}
We identify the Maclaurin series of $\cos\theta$ and $\sin\theta$, respectively:
\begin{align*}
1-\frac{1}{2}\theta^2+\frac{1}{4!}\theta^4 - \cdots &= \cos\theta\\
\theta- \frac{1}{3!}\theta^3+\frac{1}{5!}\theta^5- \cdots &= \sin\theta
\end{align*}
Thus,
\[
e^{i\theta} = \cos\theta + i\sin\theta \hspace{5em} \text{Q.E.D.}
\]
2. First Order Differential Equation
Using a first-order ODE, we will prove that the left hand side and the right hand side of Euler's formula are identical:
\[
e^{i\theta} = \cos\theta + i\sin\theta
\]
Let $y_L = e^{i\theta}$ and $y_R = \cos\theta + i\sin\theta$. Then, the derivatives are
\begin{align*}
\frac{dy_L}{d\theta} &= ie^{i\theta} = iy_L\\
\frac{dy_R}{d\theta} &= -\sin\theta +i\cos\theta = i(\cos\theta+i\sin\theta) = iy_R.
\end{align*}
Hence, they satisfy the identical equation. Also, the initial conditions at $\theta = 0$ are
\begin{align*}
y_L(0) &= e^{i0} = 1\\ y_R(0) &= \cos(0) + i\sin(0) = 1
\end{align*}
Since $y_L$ and $y_R$ satisfy the same first order differential equation and the same initial condition, we conclude $y_L(\theta) = y_R(\theta)$ for all values of $\theta$. Q.E.D.
3. Second Order Differential Equation
Let $y=e^{i\theta}$. Then, we have
\begin{equation}\label{first-order-eq}
\frac{dy}{d\theta} = ie^{i\theta} = iy.
\end{equation}
Differentiating one more time, we obtain
\begin{equation}\label{second-order-eq}
\frac{d^2y}{d\theta^2} = i\frac{dy}{d\theta} = i^2 y = -y.
\end{equation}
We identify this as the equation for a simple harmonic oscillator with $\omega = 1$, whose general solution is
\begin{equation}\label{y_sol}
y(\theta) = a\cos\theta + b\sin\theta
\end{equation}
and so
\begin{equation}\label{Dy_sol}
y'(\theta) = -a\sin\theta + b\cos\theta.
\end{equation}
Substituting \eqref{y_sol} and \eqref{Dy_sol} in Eq.\eqref{first-order-eq}, we have, for all values of $\theta$,
\begin{align*}
-a\sin\theta + b\cos\theta = i(a\cos\theta + b\sin\theta),
\end{align*}
hence $-a = ib$ and $b=ia$, which are identical. Thus,
\[
y(\theta) = a\cos\theta + b\sin\theta = a\cos\theta + ia\sin\theta
\]
But, since we know $y(0) = e^{i0} = 1$, $a$ must be 1. Therefore,
\[
e^{i\theta} = \cos\theta + i\sin\theta \hspace{3em} \text{Q.E.D.}
\]
3'. Second Order Differential Equations of real functions
In case you felt a bit uneasy about going from Eq.\eqref{second-order-eq} to the general solution \eqref{y_sol} since $y$ is complex, we will slightly modify what we did in the previous section so that we will be dealing with equations for real functions. Let $z(\theta)=e^{i\theta}$, and $x(\theta) = \operatorname{Re}\{z(\theta)\}$ and $y(\theta) = \operatorname{Im}\{z(\theta)\}$. Then, we have
\begin{equation*}
z' = ie^{i\theta} = iz ~~\Leftrightarrow x'+iy' = i(x+iy).
\end{equation*}
This is a system of two coupled first order differential equations
\begin{align}
x' &= -y\label{coupled_xprime}\\
y' &= x\label{coupled_yprime}
\end{align}
Differentiating one more time, we obtain decoupled second order equations;
\begin{align*}
x'' &= -y' = -x\\
y'' &= x' = -y
\end{align*}
We identify each of these as the equation for a simple harmonic oscillator with $\omega = 1$. Thus,
\begin{align*}
x(\theta) &= A\cos\theta + B\sin\theta\\
y(\theta) &= C\cos\theta + D\sin\theta
\end{align*}
and so
\begin{align}
x'(\theta) &= -A\sin\theta + B\cos\theta\label{xprime}\\
y'(\theta) &= -C\sin\theta + D\cos\theta\label{yprime}
\end{align}
Substituting \eqref{xprime} and \eqref{yprime} in Eqs.\eqref{coupled_xprime} and \eqref{coupled_yprime} respectively, we have, for all values of $\theta$,
\begin{align*}
-A\sin\theta + B\cos\theta &= -C\cos\theta - D\sin\theta\\
-C\sin\theta + D\cos\theta &= A\cos\theta + B\sin\theta
\end{align*}
hence $C = -B$ and $D = A$. Thus,
\begin{align*}
x(\theta) &= A\cos\theta + B\sin\theta\\
y(\theta) &= -B\cos\theta + A\sin\theta
\end{align*}
But, since we know $z(0) = e^{i0} = 1$, or $x(0)=1$ and $y(0)=0$, which force $A=1$ and $B=0$. Therefore,
\[
x(\theta) = \cos\theta, ~~~ y(\theta) = \sin\theta \] or \[ e^{i\theta} = \cos\theta +i\sin\theta \hspace{3em} \text{Q.E.D.}
\]