# Integral help

1. Oct 5, 2007

### yew_kuan

I need help with the following integral - any help would be appreciated.

$$\int_{0}^{\pi}\frac{x dx}{1+cos^2x}$$

2. Oct 5, 2007

### nicksauce

Wow. I put it into mathematica, and the answer is like 12 terms long. I would also like to see if someone can solve this is a straight-forward enough manner.

3. Oct 5, 2007

### Gib Z

I have an excellent solution, I will post it soon but It will take some time to type up, give me about 15 minutes. It is quite straight forward.

4. Oct 5, 2007

### rocomath

hurry up! i want to see what you did.

5. Oct 6, 2007

### Gib Z

You should all be familiar with the identity $$\int^a_0 f(x) dx = \int^a_0 f(a-x) dx$$.
If you are not, it is equivalent to the substitution u= a-x. Using that:

Let $$I = \int^{\pi}_0 \frac{x}{1+\cos^2 x} dx$$.
Using the identity : $$I = \int^{\pi}_0 \frac{ \pi - x}{1+\cos^2 (\pi-x)} dx$$

It is well known that $cos ( \pi-x) = -\cos x$. So after splitting the numerator to get 2 separate integrals, it can be easily seen that $$I= \int^{\pi}_0 \frac{\pi-x}{1+\cos^2 x} dx$$, which can be simplified to:

$$\frac{2I}{\pi} = \int^{\pi}_0 \frac{1}{1+\cos^2 x} dx$$.

Now we shall create our focus on the remaining integral without the limits:
Let $$K= \int \frac{1}{1+\cos^2 x} dx$$.

To find K, let $t=\tan (x/2)$. The details of my working are simple to do on your own (or just trust me, its just simple algebra) or if you are not familiar with the substitution, the following link provides some information on it and you can check my working for yourself: http://www.ucl.ac.uk/Mathematics/geomath/level2/fint/fisub4.html.

Now we find that $$K = \int \frac{1+t^2}{1+t^4} dt$$

We now split the denominator into irreducible quadratic factors and apply partial fractions.
Then we have:
$$K = \frac{1}{2} \int \left(\frac{1}{t^2+\sqrt{2}t+1} - \frac{1}{-t^2+\sqrt{2}t-1}\right) dx$$

From there you complete the square on the denominators and use the well known integral $\int 1/(x^2+a^2) dx = 1/a \cdot \arctan (x/a)$.

If you want, fill in the gaps of working on your own, otherwise just trust me:
$$K = \frac{\sqrt{2}}{2} \left( \arctan (\sqrt{2}t+1) + \arctan (1-\sqrt{2}t)\right)$$.

Now that I have the anti derivative, I have to change the bounds of the original integral to suit that now one. I let t= tan(x/2), the bounds being x= pi and x=0.

So new bounds are t= 1 and t=0. Substituting accordingly into the anti derivative:
$$\frac{\sqrt{2}}{2} \left( \arctan (\sqrt{2}+1) + \arctan (1-\sqrt{2}) - 2\arctan 1\right)$$.

After some simplifications: $$I= \frac{\sqrt{2}\pi^2}{8}$$

6. Oct 6, 2007

### Gib Z

Hold on, I changed the bounds incorrectly, I am so stupid...

O JESUS: I USED A TAN (x/2) SUBSTITUTION WHERE A BOUND IS PI, SHOOT ME, SHOOT ME!! ARGH

7. Oct 6, 2007

bang :D

8. Oct 6, 2007

### Gib Z

Ok Continuing from my post from here:
$$\frac{2I}{\pi} = \int^{\pi}_0 \frac{1}{1+\cos^2 x} dx$$

What I SHOULD have done, the easiest way, is the use double angle formula for the cos^2, and then use the t= tan (x/2) substitution.

Hence $$K = \frac{1}{\sqrt{2}} \arctan \left( \frac{ \tan (x/2) }{\sqrt{2}} \right) + C$$.

Now the problem is substituting in the bounds, because of the obvious tan (pi/2) hassles.

So the best possible answer I can give is :

$$I = \frac{\pi}{2\sqrt{2}} \lim_{x\to \pi/2} \left( \arctan \left( \frac{ \tan {\pi/2}}{\sqrt{2}} \right ) \right)$$

9. Oct 6, 2007

### Gib Z

10. Oct 6, 2007

### Hurkyl

Staff Emeritus
Please don't post complete solutions to homework problems. :tongue:

(If you want the text of your posts back, I can send them to you)

11. Oct 6, 2007

### Gib Z

haha its ok I got so caught up with doing it myself, thought it was too hard to be a homework problem >.<"

Well seeing as we only guide, yew_kuan, try splitting the integral into two pieces over the interval in a clever way.

12. Oct 6, 2007

### yew_kuan

Don't worry I got it already :P

13. Oct 6, 2007

### Hurkyl

Staff Emeritus
Okay, I'll restore the posts, since others might want to see!

14. Oct 6, 2007

### rocomath

how did you solve it?

i want to compare methods

15. Oct 7, 2007

### yew_kuan

Pretty much the same as GibZ's - though I used the following observation instead:

$$\int^{\pi/2}_0 \frac{1}{1+\cos^2 x} dx = \int^{\pi}_{\pi/2} \frac{1}{1+\cos^2 x} dx$$

I don't think you can do this by parts - or even if you could the integral doesn't seem very amenable to it.

16. Oct 7, 2007

### rocomath

no you can't, i made a mistake on that. i was so frustrated that i forgot.

is this Calc 2? i just finished Partial Fractions, i'm not sure if i'm far enough along to solve this type of prob.