How do you find the integral of #(e^x)(cosx) dx#?

2 Answers
Jun 22, 2015

Answer:

I found: #(e^x(cos(x)+sin(x)))/2+c#

Explanation:

I tried Integration by Parts (twice) and a little trick...!
enter image source here

Jan 12, 2018

Answer:

#int\ e^xcos(x)\ dx=e^x/2(sin(x)+cos(x))+C#

Explanation:

Alternatively, we can use a nice little technique called complexifying the integral.

We notice that #cos(x)# is just the same as the real part of #e^(ix)# (by Euler's identity, #e^(itheta)=cos(theta)+isin(theta)#). We can use this fact to rewrite the integral like so:
#int\ e^xcos(x)\ dx=int\ e^x*Re(e^(ix))\ dx=#

In terms of complex numbers, #e^x# is just some real factor, so it doesn't matter whether we have it outside or inside the Real part function. This means we can put the entire integral inside the Real part function:
#=Re(int\ e^xe^(ix)\ dx)=Re(int\ e^(x+ix)\ dx)=Re(int\ e^((i+1)x))\ dx=#

We can do a quite simple u-substitution to evaluate the integral:
#Re(e^((i+1)x)/(i+1)+C)=Re((e^(x)e^(ix))/(i+1))+C=#

#=e^x*Re(e^(ix)/(i+1))+C=#

We can now use Euler's identity again to expand the top. We also multiply by the conjugate of the bottom to simplify the fraction:
#=e^x*Re((i-1)/((i+1)(i-1))(cos(x)+isin(x)))+C=#

#=e^x*Re((i-1)/(-1-1)(cos(x)+isin(x)))+C=#

#=e^x*Re((i/(-2)-1/(-2))(cos(x)+isin(x)))+C=#

#=e^x*Re(-i/2cos(x)+1/2sin(x)+1/2cos(x)+i/2sin(x))+C=#

We can now quite easily pick out the real parts:
#=e^x(1/2sin(x)+1/2cos(x))+C=e^x/2(sin(x)+cos(x))+C#