Definite Integral Log Out | Topics | Search Moderators | Register | Edit Profile

 Ask NRICH » Archive 2012-2013 » Onwards and Upwards » Definite Integral « Previous Next »

Author Message
QWK
Poster

Post Number: 12
 Posted on Tuesday, 27 December, 2011 - 09:41 am:

Hi all, I have a question which has been bothering me for quite some time and I hope someone someone can answer it.

The question is integrate 1/(1+(cos x)^2) from 0 to pi.
I have done the integration and verified with numerous sources (including wolfram integrator) that the integration results to
ArcTan[Tan[x]/Sqrt[2]]/Sqrt[2]

When I substitute the limits (i.e. 0 and pi), I got 0, which is obviously wrong.
I suppose the problem comes when pi is being substituted. arctan (tan(pi)/sqrt 2) is pi and not 0.

My questions are:

1. Is this why my answer is wrong?

2. What is arctan(tan 3 pi) for example? Is it 3pi or 0? There are sources which state contradicting answers.

3. I understand that arctan is the inverse of tan, so the domain of tan gives the range of arctan. Hence, I can understand why arctan(tan pi) = pi may be correct, since inversef(f(x)) = x, but for the case in the integral, it is arctan (tan(pi)/sqrt 2). I am still not convinced that the argument inversef(f(x)) = x still applies here because sqrt 2 is being involved in the expression.

4. What is arctan(cos(3pi/2)/sqrt 2) then?

I will be grateful if someone can answer these questions. Thanks in advance!
Simon Taylor
Veteran poster

Post Number: 579
 Posted on Tuesday, 27 December, 2011 - 01:58 pm:

This question illustrates perfectly the dangers of doing an integration without checking for discontinuities.

The integration can be solved by substitution (I presume you have done this or something similar). The substitution used is $u = \frac{tan(x)}{\sqrt{2}}$. Your range of integration is 0 to $\pi$. Now u = 0 at both limits. But what happens at $\frac{\pi}{2}$?

Try splitting the integral into two pieces. Do the substitution and work out the new limits, but don't sub x back in (subbing x back in is often done without thinking and is usually completely unnecessary for definite integrals). You should find the answer falling out nicely.
Arun Iyer
Veteran poster

Post Number: 1199
 Posted on Tuesday, 27 December, 2011 - 02:15 pm:

Nice! As Simon says, "This question illustrates perfectly the dangers of doing an integration without checking for discontinuities."
QWK
Poster

Post Number: 13
 Posted on Tuesday, 27 December, 2011 - 03:32 pm:

"This question illustrates perfectly the dangers of doing an integration without checking for discontinuities."

1. Sorry but I don't really quite get what you are saying. I thought there is no discontinuity in the function 1/(1+(cos x)^2)?

2. My integration method is as such:
First, divide the function throughout by cos^2(x)
The function becomes (sec^2 (x))/(sec^2(x) + 1) which can be rewritten as (sec^2(x))/(tan^2(x) + 2). Observe that the derivative of tan x is sec^2 x. So the integral of the function becomes ArcTan[Tan[x]/Sqrt[2]]/Sqrt[2].

Throughout the manipulation of the function, I spotted no discontinuity in the function. Or did you mean that the solution for the integral is discontinuous?

Thanks a lot!
Simon Taylor
Veteran poster

Post Number: 581
 Posted on Tuesday, 27 December, 2011 - 03:41 pm:

The function isn't, but tan is. So when you sub in u = tan x you have introduced a discontinuity.
Jack Williams
New poster

Post Number: 1
 Posted on Tuesday, 27 December, 2011 - 03:46 pm:

In your method, the trouble comes from dividing top and bottom by cos(x)^2, which is 0 at pi/2.
Simon Taylor
Veteran poster

Post Number: 582
 Posted on Tuesday, 27 December, 2011 - 04:08 pm:

double post
Simon Taylor
Veteran poster

Post Number: 583
 Posted on Tuesday, 27 December, 2011 - 04:08 pm:

...though that is caused by the substitution, so we are talking about the same thing.
QWK
Poster

Post Number: 14
 Posted on Tuesday, 27 December, 2011 - 04:15 pm:

Hm, but I have not introduced any substitution of the form u = tan x I thought? Or do you mean that I must consider whether there is any disconinuity in BOTH the original function and the solution for the integral before substituting in the values? I always thought it is sufficient to check for the continuity of the function.

So I should do this instead?
Integrate 1/(1+(cos x)^2) from 0 to pi is the same as
Integrate 1/(1+(cos x)^2) from 0 to p1/2 + Integrate 1/(1+(cos x)^2) from pi/2 to pi
This is equal to [ArcTan[Tan[x]/Sqrt[2]]/Sqrt[2]](upper limit = pi/2, lower limit = 0) + [ArcTan[Tan[x]/Sqrt[2]]/Sqrt[2]] (upper limit = pi, lower limit = pi/2)

And using the substitution u = tan x/ sqrt 2, I get [ArcTan[u]/Sqrt[2]](upper limit = infinity, lower limit = 0) + [ArcTan[u]/Sqrt[2]](upper limit = 0, lower limit = infinity)?

Or do you mean I should use the substitution u = tan x/ sqrt 2 directly after splitting the integral into two?
Jack Williams
New poster

Post Number: 2
 Posted on Tuesday, 27 December, 2011 - 04:34 pm:

How did you integrate (sec^2(x))/(tan^2(x) + 2)? You can do it using the substitution u=tan(x)/sqrt(2). Then you're integrating with respect to u, a discontinuous function of x.
What you've written is correct, but be careful to make the lower limit of the second integral -infinity.
Edit: you need to split the integral as soon as you introduce u.
Simon Taylor
Veteran poster

Post Number: 584
 Posted on Wednesday, 28 December, 2011 - 03:52 am:

Sorry, I should have been clearer about it being the substitution that was the problem. This is why it is so important to do limits as you go along rather than acting as if it were an improper integral and putting in the limits at the end.

If you had substituted in limits when you did the substitution, you would find that your integration was going from 0 to 0. This immediately sets alarm bells ringing, because then the integration has to be zero - but we know it isn't since the original function is positive everywhere.

Usually when you have continuity all round your change of limits just takes you to a different range. And everything just works fine. Trouble is, in this case your new range goes from zero to 'positive infinity' and then from 'negative infinity' back to zero, which is in fact the whole number line.
QWK
Poster

Post Number: 15
 Posted on Wednesday, 28 December, 2011 - 05:54 am:

Thanks Jack and Simon, that cleared things up a lot!

The problem is I did not really (or usually) perform the substitution explicitly when evaluating the integral of (sec^2(x))/(tan^2(x) + 2). It has become second nature to me in applying the formula directly that integrate (f'(x))/(a^2 + [f(x)]^2) = (1/ a) arctan [f(x)/a] without realising that I am indeed substituting u = tan x when jumping from my second last step to the solution. Looks like I have to be more careful when applying formulas so that I do not bump into such limit issues. Haha.
Simon Taylor
Veteran poster

Post Number: 585
 Posted on Thursday, 29 December, 2011 - 04:00 am:

Here's how I would work it out (with limits etc) for reference. Note how I don't bother substituting back in for x at the end - there's no need.

$$I = \int_0^\pi \frac{dx}{1+cos^2(x)} = \int_0^\pi \frac{dx}{sin^2(x)+2cos^2(x)}$$
We want to substitute $u = \frac{tan(x)}{\sqrt{2}}$. But then there is a discontinuity at $x=\frac{\pi}{2}$, so split integral in two first:
$$I= \int_0^\frac{\pi}{2} \frac{dx}{sin^2(x)+2cos^2(x)} + \int_\frac{\pi}{2}^\pi \frac{dx}{sin^2(x)+2cos^2(x)}$$
$$= \frac{1}{2}\int_0^\frac{\pi}{2} \frac{sec^2(x)dx}{1+\left(\frac{tan(x)}{\sqrt{2}}\right)^2} + \frac{1}{2}\int_\frac{\pi}{2}^\pi \frac{sec^2(x)dx}{1+\left(\frac{tan(x)}{\sqrt{2}}\right)^2}$$
Now $u = \frac{tan(x)}{\sqrt{2}} \implies du = \frac{sec^2(x)dx}{\sqrt{2}}$
$$\implies I = \frac{1}{\sqrt{2}}\int_0^\infty \frac{du}{1+u^2} + \frac{1}{\sqrt{2}}\int_{-\infty}^0 \frac{dx}{1+u^2}$$
$$= \frac{1}{\sqrt{2}}\int_{-\infty}^\infty \frac{du}{1+u^2} = \frac{1}{\sqrt{2}}[arctan(u)]_{-\infty}^\infty$$
$$= \frac{\pi}{\sqrt{2}}$$
QWK
Poster

Post Number: 16
 Posted on Friday, 30 December, 2011 - 11:01 am:

Thanks a lot, Simon! Really cleared my doubts now.
rahsaan
New poster

Post Number: 3
 Posted on Friday, 22 March, 2013 - 02:31 pm:

hey, can u help me find the reduction formula for this. In = integral 0 1 of x(1-x3)n dx
the answer is supposed to be (3n + 2)I(n) = 3nI(n-1)