Euler's Equation for the Complex Exponential
DSolve[f''[y] == - f[y],f[y],y]
The C[1] and C[2] just stand for constants. What initial conditions do we need on our differential equation to get the solution we want? What properties of the exponential function haven't we used? We would like Exp[0]=1, and this implies that we should have as our initial conditions f(0)=1 and f'(0)=i.
DSolve[{f''[y]== - f[y],f[0]==1,f'[0]==I},f[y],y]
So, Exp[iy]=Cos[y]+iSin[y] and therefore Exp[z]=Exp[x]*Exp[iy]=Exp[x]{Cos[y]+iSin[y]}.
This last equation is Euler's equation. Let's see what Mathematica says about this.
ComplexExpand[Exp[x+I y]]
All of the usual properties of the exponential function are now still true for the complex exponential function. Note that if x is real, Exp[x]=Exp[x]{Cos[0]+iSin[0]}=Exp[x], the usual (real) exponential.
Just for fun, evaluate the following and then check using Euler's equation.
Exp[2 Pi I]
Exp[Pi I]
Exp[I]
That last one is not very enlightening. Maybe this will help.
N[Exp[I]]
Exp[2+I]-(Exp[2]*(Cos[1]+I Sin[1]))
Get real Mathematica! Don't be so literal.
Simplify[%]
There is a nice result called DeMoivre's formula. It says if x is real, then:
(Cos[x]+i Sin[x])^n=Cos[n x]+iSin[n x]. Can you prove this using Euler's equation?
Neat exercise: Use DeMoivre's formula, the binomial formula, and the fact that cos(4x)=Re(cos(4x)) to get an expression for cos(4x) involving only cos(x) and sin(x). Forget about trig identities here!
Up to Complex Numbers