# Evaluating definite integral

1. Mar 12, 2013

### Saitama

1. The problem statement, all variables and given/known data
$$I=\int_0^{\pi} \frac{xdx}{9\cos^2 x+\sin^2 x}$$

2. Relevant equations

3. The attempt at a solution
The given integral can be written as
$$I=\int_0^{\pi} \frac{(\pi-x)dx}{9\cos^2 x+\sin^2 x}$$
The denominator remains unchanged because $\cos^2(\pi-x)=-\cos x$ and square of it is positive.
Hence
$$2I=\int_0^{\pi} \frac{\pi dx}{9\cos^2 x+\sin^2 x}$$
Factoring out $\cos^2 x$ from denominator
$$2I=\pi \int_0^{\pi} \frac{\sec^2 x dx}{9+\tan^2 x}$$
Substituting $\tan x=t$, both the upper and lower limits of the integrand equals zero and hence I=0 but this is wrong. I don't see where I went wrong.

Any help is appreciated. Thanks!

2. Mar 12, 2013

### LCKurtz

When you "factor out a cosine" you are dividing other terms by the cosine which introduces a singularity at $x=\pi/2$.

3. Mar 12, 2013

### SammyS

Staff Emeritus
If the anti-derivative was zero at the upper and lower limits, then the integral would be zero.

Here the integrand is positive for all x, so the definite integral cannot possibly be zero.

BTW: How do you figure that the integrand is zero anywhere?

4. Mar 12, 2013

### Saitama

$\tan x=t$, hence $\sec^2 xdx=dt$
The lower and upper limits are both equal to zero. Since both the final and initial points are same, the area should be zero and hence, the integrand is zero. This is what I think but this is definitely wrong.

I have no idea about what you said. :(

5. Mar 12, 2013

### SammyS

Staff Emeritus
Graph the integrand.

Sec is in the numerator, and sec(θ) is never zero.

6. Mar 12, 2013

### Saitama

Yes, I know it is never zero but see the expression I get after substitution.
$$2I=\pi \int_0^0 \frac{dt}{9+t^2}$$
How it can turn out to be a non zero value when both the upper and lower limits are same?

7. Mar 12, 2013

### LCKurtz

Then look at your substitution $\tan x = t$. What happens when $x = \pi/2$, which is in the middle of your interval? Your integrand may in fact have a removable singularity there, but I would expect problems with the substitution because tangent changes sign passing through a vertical asymptote there.

8. Mar 12, 2013

### Saitama

$\tan x$ shoots upto infinity but why does that pose a problem here? If not substitution, how should I proceed with the problem? Should I split the integral for different intervals (just a wild guess) ?

9. Mar 12, 2013

### LCKurtz

You can't ignore things like that. Otherwise, for example, if you calculate$$\int_{-1}^1\frac 1 x \, dx = \ln|x|\left. \right|_{-1}^1 = 0 - 0 = 0$$when in fact the integral diverges. I would at least try breaking the integral into two parts working both parts carefully. You will probably find that by overlooking that you have allowed two things to cancel that shouldn't which is why you are getting 0.

Disclaimer: I haven't worked it myself but, hey, that's your job.

10. Mar 12, 2013

### Saitama

Okay so I split the integral into two parts:
$$2I=\pi \left(\int_0^{\pi/2} \frac{\sec^2 dx}{9+\tan^2 x}+\int_{\pi/2}^{\pi} \frac{\sec^2 dx}{9+\tan^2 x}\right)$$
Using the substitution $\tan x=t$, the integrals cancel but one thing I have noticed that if I separately evaluate the left integral, it turns out to be $\pi^2/12$ and the answer given is just the double of this term. I still don't understand what's happening here. :(

11. Mar 12, 2013

### LCKurtz

What is undoubtedly happening is you are letting the two integrals cancel when they should add. You haven't shown us what the $t$ limits are. These are improper integrals. What are the $t$ limits when you change to$$2I=\pi \left(\int_{?}^{?} \frac{ dt}{9+t^2}+\int_{?}^{?} \frac{dt}{9+t^2}\right)$$Be careful noting the limits when $x=\pi/2$ are improper and one-sided.

12. Mar 12, 2013

### Saitama

So it is infinity on one side and minus infinity on the other?
If it is so, are the limits for first integral 0 to ∞ and for the other its -∞ to 0?

13. Mar 12, 2013

### SammyS

Staff Emeritus
Yes.

14. Mar 12, 2013

### Saitama

Thanks a lot both of you. If I use these limits, I get the right answer. :)