How do you integrate #int e^x cos x^2 dx #?

2 Answers
Dec 17, 2017

# int \ e^x (cosx)^2 \ dx = 1/2 e^x + 1/5 e^xsin2x +1/10 e^xcos2x + C#

Explanation:

Assuming that we seek:

# I = int \ e^x (cosx)^2 \ dx #

Then, using the identity #cos2theta -= 2cos^2theta-1# we can rewrite the integral as:

# I = int \ e^x (1+cos2x)/2 \ dx #
# \ \ = 1/2 \ int \ e^x (1+cos2x) \ dx #
# \ \ = 1/2 \ {int \ e^x \ dx + int \ e^x cos2x \ dx }# ..... [A]

The first integral is trivial, for the second we apply integration by parts:

Let # { (u,=e^x, => (du)/dx,=e^x), ((dv)/dx,=cos2x, => v,=1/2 sin2x ) :}#

Then plugging into the IBP formula:

# int \ (u)((dv)/dx) \ dx = (u)(v) - int \ (v)((du)/dx) \ dx #

We have:

# int \ e^xcos2x \ dx = e^x1/2sin2x-int \ 1/2sin2x \ e^x \ dx #
# " " = 1/2 e^xsin2x - 1/2 \ int \ e^xsin2x \ dx # ..... [B]

Now if we perform a second application of Integration By Parts:

Let # { (u,=e^x, => (du)/dx,=e^x), ((dv)/dx,=sin2x, => v,=-1/2 cos2x ) :}#

Then plugging into the IBP formula, we have:

# int \ e^xsin2x \ dx = e^x(-1/2cos2x)-int \ (-1/2cos2x) \ e^x \ dx #
# " " = -1/2 e^xcos2x + 1/2 \ int \ e^xcos2x \ dx # ..... [C]

Substituting result [C] into [B] we have:

# int \ e^xcos2x \ dx = 1/2 e^xsin2x - 1/2 {-1/2 e^xcos2x + 1/2 \ int \ e^xcos2x \ dx} #

# :. int \ e^xcos2x \ dx = 1/2 e^xsin2x +1/4 e^xcos2x -1/4 \ int \ e^xcos2x \ dx #

# :. 5/4 \ int \ e^xcos2x \ dx = 1/2 e^xsin2x +1/4 e^xcos2x #

# :. int \ e^xcos2x \ dx = 2/5 e^xsin2x +1/5 e^xcos2x #

Now, substituting this result into [A] and integrating we get:

# I = 1/2 \ {e^x + 2/5 e^xsin2x +1/5 e^xcos2x} + C#
# \ \ = 1/2 e^x + 1/5 e^xsin2x +1/10 e^xcos2x + C#

Dec 17, 2017

See below.

Explanation:

Assuming the question reads

#int e^x cos^2x dx = 1/2int e^x(1+cos(2x))dx#

Now #int e^x cos(2x) dx = "Re"[int e^x e^(2ix)dx] = "Re"[int e^((2i+1)x) dx]#

Now

#int e^((2i+1)x)dx = 1/(2i+1) e^((2i+1)x)+C = e^x/(2i+1)(cos (2x)+i sin(2x))+C#

and #"Re"[ e^x/(2i+1)(cos (2x)+i sin(2x))+C] =1/5 e^x (Cos(2 x) + 2 Sin(2 x))+C_1#

so finally

#int e^x cos^2x dx =e^x/2(1+1/5 (Cos(2 x) + 2 Sin(2 x)))+C_2#