0

So i wany to integrate the function $e^x.cos(x)$ so i decided to do it like this way $e^x.e^{ix}$ and then only taking the real part from it so i get $\frac{(1-i)}{2}(cos(x)+sin(x))$ and then taking the real part . now i wanted to verify my result so i entered $e^x.e^{i \cdot x}$ in WA and it said no results found in elementary functions but when i wrote it as $e^{x(1+i)}$ it did calculate what is the reason behind it . the complex numbers do obey laws of indices then where did i go wrong. Also tell me whether theres a more good way to do $$\int e^x.\cos(x)$$

Dan Brumleve
  • 18,041

2 Answers2

4

You used the proper trick for this kind od integrals. Considering $$I=\int e^x \cos(x)\,dx \qquad J=\int e^x \sin(x)\,dx \implies I+iJ=\int e^x e^{ix}\,dx=\int e^{(1+i)x}\,dx$$ $$I+iJ=\frac{e^{(1+i)x}}{1+i}=\frac 12(1-i)e^x e^{ix}=\frac 12(1-i)e^x (\cos(x)+i \sin(x))$$ Expanding and grouping real and imaginary terms then leads to $$I+iJ=\frac 12e^x (\cos(x)+\sin(x))+i\frac 12e^x(\sin(x)-\cos(x))$$ then $I$ and $J$.

2

Works for me. Maybe you made a mistake in your input?

Dan Brumleve
  • 18,041