Quick Integral Question: Solving \int \! \cos^2xdx with Step-by-Step Explanation

  • Thread starter Thread starter iamsmooth
  • Start date Start date
  • Tags Tags
    Integral
Click For Summary
The integral of cos²x can be solved using the trigonometric identity cos²x = (1 + cos(2x))/2. This allows the integral to be rewritten as ∫(1 + cos(2x))/2 dx, which simplifies the calculation. Substituting u = 2x and adjusting for the differential gives the correct integral form. The final result is x/2 + (1/4)sin(2x) + C, with emphasis on the importance of keeping track of differentials during integration. Mastery of trigonometric identities is crucial for solving such integrals effectively.
iamsmooth
Messages
103
Reaction score
0

Homework Statement


<br /> \int \! \cos^2xdx

The Attempt at a Solution


Letting u = x2 and du/dx = 2x

To get 2x into the integral, I multiply the outside by 1/2x?
<br /> \frac{1}{2x} \int \! \cos (u) du

<br /> \frac{1}{2x} \sin (x^2) 2x + C

Even if I play around with this, I don't get anywhere near the correct answer, which is:

\frac{1}{2}x + \frac{1}{4}\sin (2x) + C

There's something I'm not getting. Can someone please help? Thanks.
 
Physics news on Phys.org
Hi iamsmooth! :smile:

(try using the X2 tag just above the Reply box :wink:)
iamsmooth said:
There's something I'm not getting. Can someone please help? Thanks.

Yes, you're confusing (cosx)2 with cos(x2) :wink:

Try again, first using one of the standard trigonometric identities to get cos2x = a function of cos(2x) or sin(2x). :smile:
 
Oh man, I'm an idiot... anyways...

Trying with integration by parts (failing miserably):

<br /> \int \cos^2dx

= \cos^2x(x) - \int 2 \cos x (x)

<br /> = \cos^2(x) - sin^2x(x)

<br /> = x(\cos^2x-sin^2x) = x(\cos2x)

Nope, still not getting anywhere.
 
Hi iamsmooth! :smile:

No, the integral should be 2xcosxsinx …

anyway, you can see that using v = x just makes it more complicated. :redface:

If you must use integration by parts, use v = cosx, but my idea of rewriting cos2x first is much easier.
 
Do you mean to rewrite it as:

<br /> \int \cos 2x + \sin^2x dx

I can see that in this case cosx can be the derivative of sinx, does that mean I can use u-substitution and reverse chainrule this? I'm still unsure of how to tackle integrals. Like I know there's all these different ways of solving them, but I'm not sure how to identify what the situation is and thus know which method to use.

From what I would do:
1) If you see an expression and its derivative, use substitution
2) If you see polynomial, just use reverse derivative rules
3) Parts integration when all else fails?
 
Last edited:
Hi iamsmooth! :smile:

To pass your exams, you really must learn your trigonometric identities …

in this case, cos2x = 1/2 (1 + cos(2x)) :wink:
 
tiny-tim said:
Hi iamsmooth! :smile:

To pass your exams, you really must learn your trigonometric identities …

in this case, cos2x = 1/2 (1 + cos(2x)) :wink:

How do you derive that equation from trig identities?

<br /> cos^2x\,+\,sin^2x\,=\,1<br />

If I manipulate this, I get cos2x = 1 - sin2x which is way wrong I guess :(

I vaguely know trig identities, but I guess I'm really rusty on them... Am I supposed to just commit all of the stuff on this page: ( https://www.physicsforums.com/library.php?do=view_item&itemid=18 ) to memory?

As you can see, I guess I wrongly tried to change this:

<br /> \cos^2x\,-\,\sin^2x\,=\,\cos2x<br />

into

<br /> <br /> \cos^2x = \cos 2x + \sin^2x dx<br /> <br />

Is there an easier trick for memorizing trig identities so I can derive them when I need them?
 
Hi iamsmooth! :smile:
iamsmooth said:
How do you derive that equation from trig identities?

cos2x + sin2x = 1
cos2x - sin2x = cos2x​
add:
2cos2x = 1 + cos2x​
subtract:
2sin2x = 1 - cos2x :wink:
I vaguely know trig identities, but I guess I'm really rusty on them... Am I supposed to just commit all of the stuff on this page: ( https://www.physicsforums.com/library.php?do=view_item&itemid=18 ) to memory?

Is there an easier trick for memorizing trig identities so I can derive them when I need them?
Sorry, but you do need to memorise all of them except the last four.

The last four are too difficult to remember, but when needed you can work them out as follows …

Sum or difference of sin always has a cos and a sin, just as in sin(A±B).

Sum or difference of cos always has two coses or two sines, just as in cos(A±B).

And a sum doesn't depend on the order, so it has to have cos the difference, which also doesn't; while a difference does, so it has to have sin the difference, which also does. :wink:
 
I'll start trying to remember them then.

Anyways this is what I have:

\int \cos^2xdx = \int \frac{1+\cos 2x}{2}dx

Letting:
u = 2x, du = 2dx, \frac{1}{2}du = dx

\int 1 + \cos (u) \frac{1}{2}du

<br /> = \frac{1}{2} \int 1 + \cos (u) du

<br /> = \frac{1}{2} [ x + \sin 2x ] + K

<br /> = \frac{x}{2} + \frac{\sin(2x)}{2} + K

I'm close to the right answer, but the second term should be \frac{\sin(2x)}{4}, where did I mess up? If I raise the u inside the cose by 1 exponent and divide, I get 1/4 but the exponent remains... not sure what's wrong here.

Thanks.
 
  • #10
Hi iamsmooth! :smile:

You messed up twice :redface:
iamsmooth said:
\int 1 + \cos (u) \frac{1}{2}du

You've left out the 2 in the original denominator.
<br /> = \frac{1}{2} \int 1 + \cos (u) du

<br /> = \frac{1}{2} [ x + \sin 2x ] + K

And you've left out a whole line, which is a really bad idea, especially since in this case you've made a mistake in the process …

the integral of 1du is u (=2x), not x. :wink:
 
  • #11
\int \cos^2xdx = \int \frac{1+\cos 2x}{2}dx = \int (\frac{\cos2x}{2}+\frac{1}{2})dx

I was trying to group the +1/2 with the dx to remove it, but I guess you can't do that. Why is the integral of du = 2x?

I let u = 2x, so the derivative would be du/dx = 2, which would make du = 2dx. I understand 2x would be the correct answer since the math works out, but I don't seem to be getting that for some reason.

Is it the +\frac{1}{2} term that becomes 2x? I got 1 = x (without denominator) because I just took the antiderivative.
 
Last edited:
  • #12
Hi iamsmooth! :smile:

(just got up :zzz: …)
iamsmooth said:
… Why is the integral of du = 2x?

I let u = 2x, so the derivative would be du/dx = 2, which would make du = 2dx. I understand 2x would be the correct answer since the math works out, but I don't seem to be getting that for some reason.

Yes, du = 2dx. :smile:

Now integrate that … ∫du = ∫2dx, which is the same as ∫du = 2x (+ constant). :wink:

I can't help feeling that if you wrote it out with the missing line inserted, you'd automatically get the right answer.
 
  • #13
Okay, I think I got this:

<br /> \int \cos^2xdx = \int \frac{1+\cos 2x}{2}dx = \int (\frac{\cos2x}{2}+\frac{1}{2})dx<br />

Moving the 1/2 to the side:
\frac{1}{2} \int \cos2x + 1

Now keeping in mind that u = 2x, du = 2dx, 2du = dx, I can do the substitution:
\frac{1}{4} \int \cos(u) + 2du
(Placing another 1/2 to the left of the integral to balance out the 2du)

Now evaluating the integral:
<br /> \frac{1}{4}\sin(u) + 2x

Subbing back in the value of u, and simplifying:
<br /> \frac{\sin(2x)}{4} + \frac{x}{2}

I hope that's right. I just wasn't sure if the way I inserted the 2du was a legal move. Appreciate all the help, tiny-tim :D
 
  • #14
Yes, that's ok, except

i] about half-way down you got bored, and started leaving out the dx or du …

you must keep them in …

an ∫ is meaningless without a d(something) after it (and you'll lose marks in the exam unless the examiner thinks it's a typo), and if you keep them in you're much less likely to make a mistake (eg a factor of 2) when you change variables

ii] you never needed to substitute for the ∫ 1/2 dx, did you? :wink:

iii] don't say "keeping in mind" :rolleyes: … say "putting (or "let") u = 2x, du = 2dx"

So the whole thing should look like:

∫cos2x dx

= ∫(1 + cos2x)/2 dx

putting u = 2x. du = 2dx,

= x/2 + constant + ∫ 1/4 cosu du

= x/2 + constant + 1/4 sinu

= x/2 + 1/4 sin2x + constant :wink:
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 105 ·
4
Replies
105
Views
6K
Replies
19
Views
2K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
5
Views
2K
  • · Replies 14 ·
Replies
14
Views
1K
  • · Replies 5 ·
Replies
5
Views
1K