About Euler's formula $e^{ix}=\cos x+i\sin x$

700 Views Asked by At

I think I probably miss something. Can you tell me what it is?

In my assumption, that any given 'x' value, $$e^{ix}=\cos x+i\sin x$$

But, why don't I get the same value in the equation when I calculate it in matlab?

x=pi/3;
exp(x) = 2.8497
cos(x)+sin(x) = 1.3660

I know I miss out 'i' in the equation. Honestly, I don't know that what the 'i' serves to get the actual value. Can anybody help?

2

There are 2 best solutions below

0
On

$i$ is an imaginary number that satisfies $i^2=-1$. You can't just remove it from Euler's formula and expect things to work out.

0
On

To extend the previous answer, here is the way to fix your MATLAB code:

x=pi/3;
exp(complex(0,1)*x)
complex(cos(x),sin(x))

Notice the output from both last statements is

0.5000 + 0.8660i

as predicted by Euler's Formula.