How do you evaluate #\int ( \sin x + \cos x ) ^ { 2} d x #?

1 Answer
Nov 6, 2017

#x-cos^2(x) + C#

or

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

Explanation:

You can't tackle this integral as it is. To solve it, you'll need to break it down into something you can work with. The best course of action is to foil out the #(sinx + cosx)^2#:

#int(sin^2x + cos^2x + 2sinxcosx) dx#

Now, there's something we can work with. Recall that #sin^2x + cos^2x = 1#. Therefore, we can break the above up into two separate indefinite integrals:

#int(sin^2x + cos^2x)dx + int(2sinxcosx)dx#

Applying our identity:

#int(1)dx + int(2sinxcosx)dx#

#int(1)dx# is just #x + C#. The second piece, however, will require #u#-substitution to solve. Recall the steps of #u#-substitution:

  • Set #u = "some value"#.
  • Set it to something that will cancel out other #x# terms in the integral.
  • Take the derivative of both sides of that equation with respect to #x#.
  • Solve for #dx# in terms of something #"* du#
  • Plug that in for #dx# in your original integral.

Note that you can pick either #cos(x)# or #sin(x)# to be your #u#, and still be able to solve the problem. Your final answer will look slightly different in each case, but the process is more or less the same. I picked #u = cos(x)#:

Let #u = cos(x)#
#(du)/dx = -sin(x)#
#dx = (-du)/sin(x)#

Plug back in:

#=> -2intcancel(sin(x))u (du)/cancel(sin(x))#
#=> -2int( u )du#

Now, we just evaluate the indefinite integral in terms of #u#:

#=> -2u^2/2 + C#
#=> -u^2 + C#

Since we started with #x#, we should plug back in our substituted value for #u#:

#=> -[cos(x)]^2 + C#

Now we tag on the answer from the other part of the integral:

#=> x - cos^2x + C#

And that's your final answer. If you want to check if it is correct, just take a derivative, and you should be able to get back to your original expression.

Also note that if you had substituted #u = sin(x)#, you'd have got a slightly different final answer. However, if you took the derivatives of both expressions, you'd find that you still get the same original expression.

Hope that helped :)