How do you integrate #int (sinx +cosx)^2 dx#?

2 Answers
Apr 25, 2017

#=x+sin^2(x)+C#

Explanation:

#int\ (sin(x)+cos(x))^2\ dx#
#=int\ sin^2(x)+cos^2(x)+2sin(x)cos(x)\ dx# {Expanding}
#=int\ 1+2sin(x)cos(x)\ dx# {Since #sin^2(x)+cos^2(x)=1#}
#=int\1\ dx+2int\ sin(x)cos(x)\ dx# {Linearity of integration}
#=x+C+2int\ sin(x)cos(x)\ dx#

Now, substitue #u=sin(x)#, or #dx=(du)/cos(x)#

#=x+C+2int\ (ucos(x))/cos(x)\ du#
#=x+C+2int\ u\ du#
#=x+C+(2u^2)/2#
#=x+C+u^2#
#=x+sin^2(x)+C#

Apr 26, 2017

The antiderivative is #sin^2x + x + C#.

Explanation:

Here's another way of doing this. We expand, calling the integral #I#:

#I = int (sinx + cosx)^2 dx#

#I = int sin^2x + cos^2x+ 2sinxcosx dx#

#I = int 1 + 2sinxcosx#

#I = int 1 dx + int 2sinxcosxdx#

We now use the identity #sin2x= 2sinxcosx#.

#I = int 1 dx + int sin2xdx#

Now let #u = 2x#. Then #du = 2dx# and #dx= 1/2du#.

#I = int 1 dx + 1/2int sinu du#

#I = x - 1/2cosu#

#I = x - 1/2cos(2x) + C#

Now use #cos(2x) = 1 - 2sin^2x#.

#I = x - 1/2(1 - 2sin^2x) + C#

#I = x + 1/2 + sin^2x + C#

However, since #C# is included, we can just forget about the #1/2#.

#I = sin^2x+ x + C#

Hopefully this helps!