PDA

View Full Version : Quick integral question


iamsmooth
Dec12-09, 02:44 AM
1. The problem statement, all variables and given/known data

\int \! \cos^2xdx

3. The attempt at a solution
Letting u = x2 and du/dx = 2x

To get 2x in to the integral, I multiply the outside by 1/2x?

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


\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.

tiny-tim
Dec12-09, 02:49 AM
Hi iamsmooth! :smile:

(try using the X2 tag just above the Reply box :wink:)
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:

iamsmooth
Dec12-09, 03:19 AM
Oh man, I'm an idiot... anyways...

Trying with integration by parts (failing miserably):


\int \cos^2dx

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


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


= x(\cos^2x-sin^2x) = x(\cos2x)

Nope, still not getting anywhere.

tiny-tim
Dec12-09, 03:31 AM
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.

iamsmooth
Dec12-09, 03:56 AM
Do you mean to rewrite it as:


\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?

tiny-tim
Dec12-09, 04:04 AM
Hi iamsmooth! :smile:

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

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

iamsmooth
Dec12-09, 04:13 AM
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?


cos^2x\,+\,sin^2x\,=\,1


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: ( http://www.physicsforums.com/library.php?do=view_item&itemid=18 ) to memory?

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


\cos^2x\,-\,\sin^2x\,=\,\cos2x


into



\cos^2x = \cos 2x + \sin^2x dx



Is there an easier trick for memorizing trig identities so I can derive them when I need them?

tiny-tim
Dec12-09, 05:01 AM
Hi iamsmooth! :smile:
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: ( http://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:

iamsmooth
Dec12-09, 04:16 PM
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


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


= \frac{1}{2} [ x + \sin 2x ] + K


= \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.

tiny-tim
Dec12-09, 06:05 PM
Hi iamsmooth! :smile:

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

You've left out the 2 in the original denominator.

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


= \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:

iamsmooth
Dec12-09, 07:52 PM
\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.

tiny-tim
Dec13-09, 02:39 AM
Hi iamsmooth! :smile:

(just got up :zzz: …)
… 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.

iamsmooth
Dec14-09, 07:08 AM
Okay, I think I got this:


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


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:

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

Subbing back in the value of u, and simplifying:

\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

tiny-tim
Dec14-09, 09:31 AM
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: