Class 12 Maths, Worked in Full Past papersGet updates
Chapter 7 · Integrals

Example 30: ∫0πxsin⁡x1+cos⁡2x dx\int_0^{\pi}\frac{x\sin x}{1+\cos^2x}\,dx

ExamplesProperties of definite integrals · Section 7.10
The question

Evaluate ∫0πxsin⁡x1+cos⁡2x  dx\displaystyle\int_0^{\pi} \frac{x\sin x}{1 + \cos^2 x}\; dx⁠.

Exam answer Let I=∫0πxsin⁡x dx1+cos⁡2x…(i)\text{Let } I = \int_0^{\pi}\frac{x\sin x\,dx}{1 + \cos^2 x}\quad\ldots(\text{i})

Using ∫0af(x) dx=∫0af(a−x) dx\displaystyle\int_0^a f(x)\,dx = \int_0^a f(a - x)\,dx⁠,

I=∫0π(π−x)sin⁡(π−x)1+cos⁡2(π−x) dx=∫0π(π−x)sin⁡x1+cos⁡2x dx…(ii)\begin{aligned} I &= \int_0^{\pi}\frac{(\pi - x)\sin(\pi - x)}{1 + \cos^2(\pi - x)}\,dx \\ &= \int_0^{\pi}\frac{(\pi - x)\sin x}{1 + \cos^2 x}\,dx\quad\ldots(\text{ii}) \end{aligned}

Adding (i) and (ii),

2I=π∫0πsin⁡x1+cos⁡2x dx2I = \pi\int_0^{\pi}\frac{\sin x}{1 + \cos^2 x}\,dx

Put cos⁡x=t\cos x = t⁠. Then −sin⁡x dx=dt-\sin x\,dx = dt⁠.

When x=0x = 0⁠, t=1t = 1⁠; when x=πx = \pi⁠, t=−1t = -1⁠.

∴ 2I=π∫1−1−dt1+t2\therefore\ 2I = \pi\int_1^{-1}\frac{-dt}{1 + t^2}

Changing the sign and swapping the limits,

2I=π∫−11dt1+t2=π[tan⁡−1t]−11=π(π4−(−π4))=π22\begin{aligned} 2I &= \pi\int_{-1}^{1}\frac{dt}{1 + t^2} = \pi\Big[\tan^{-1}t\Big]_{-1}^{1} \\ &= \pi\left(\frac{\pi}{4} - \left(-\frac{\pi}{4}\right)\right) = \frac{\pi^2}{2} \end{aligned}

∴ I=π24\therefore\ I = \dfrac{\pi^2}{4}⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

The awkward factor is the lone xx⁠: without it, sin⁡x1+cos⁡2x\frac{\sin x}{1 + \cos^2 x} is easy (put t=cos⁡xt = \cos x⁠). Property P4 lets us replace xx by π−x\pi - x without changing the value. Since sin⁡(π−x)=sin⁡x\sin(\pi - x) = \sin x and cos⁡2(π−x)=cos⁡2x\cos^2(\pi - x) = \cos^2 x⁠, only the factor xx changes, into π−x\pi - x⁠. Adding the two forms, x+(π−x)=πx + (\pi - x) = \pi⁠: the xx disappears and leaves a constant π\pi⁠.

Given, to find, and the plan
Given
I=∫0πxsin⁡x1+cos⁡2x dxI = \int_0^{\pi}\frac{x\sin x}{1 + \cos^2 x}\,dx⁠.
To find
The exact value of II⁠.
Plan
Check continuity; apply P4 with a=πa = \pi⁠; solve for II⁠; substitute t=cos⁡xt = \cos x⁠; use P1 and P7 (i); evaluate with tan⁡−1\tan^{-1}⁠.

Basics you need

1Property P4

∫0af(x) dx=∫0af(a−x) dx\int_0^a f(x)\,dx = \int_0^a f(a - x)\,dx (Section 7.10). The substitution t=a−xt = a - x runs over the same interval backwards, so the value is unchanged. Lesson: properties of definite integrals

2Supplementary angles

sin⁡(π−x)=sin⁡x\sin(\pi - x) = \sin x and cos⁡(π−x)=−cos⁡x\cos(\pi - x) = -\cos x⁠, so cos⁡2(π−x)=cos⁡2x\cos^2(\pi - x) = \cos^2 x⁠. Basics: trigonometric identities

3Properties P1 and P7 (i)

P1: ∫baf=−∫abf\int_b^a f = -\int_a^b f⁠. P7 (i): ∫−aaf=2∫0af\int_{-a}^{a} f = 2\int_0^a f for even ff⁠. Basics: symmetry and mirror images

4∫dt1+t2\int\frac{dt}{1 + t^2}

=tan⁡−1t+C= \tan^{-1}t + C (standard formula (x), Section 7.2), and tan⁡−11=π4\tan^{-1}1 = \frac{\pi}{4}⁠, tan⁡−10=0\tan^{-1}0 = 0⁠. Basics: integration undoes differentiation

Solution

  1. Continuity, and why a direct attack fails

    Since cos⁡2x≥0\cos^2 x \ge 0⁠, the denominator 1+cos⁡2x≥11 + \cos^2 x \ge 1 is never 0, so the integrand is continuous on [0,π][0, \pi] and II is a definite number.

    Finding an antiderivative directly is not practical: integrating by parts with u=xu = x and v=−tan⁡−1(cos⁡x)v = -\tan^{-1}(\cos x) leads to ∫tan⁡−1(cos⁡x) dx\int\tan^{-1}(\cos x)\,dx⁠, whose antiderivative none of the methods of this chapter can find. (Over [0,π][0, \pi] that last integral is in fact 0, because tan⁡−1cos⁡(π−x)\tan^{-1}\cos(\pi - x) equals −tan⁡−1cos⁡x-\tan^{-1}\cos x⁠; but seeing this needs property P4 anyway.) So we use a property of definite integrals from the start.

    Properties P0 to P7 can give the value of a definite integral even when no usable antiderivative is available. That is exactly the situation here.
    A quotient of continuous functions is continuous where the denominator is not 0. Lesson: definite integrals
  2. Apply P4 with a=πa = \pi

    Replace every xx by π−x\pi - x⁠:

    I=∫0π(π−x)sin⁡(π−x)1+cos⁡2(π−x) dx=∫0π(π−x)sin⁡x1+cos⁡2x dx.\begin{aligned}I &= \int_0^{\pi}\frac{(\pi - x)\sin(\pi - x)}{1 + \cos^2(\pi - x)}\,dx \\ &= \int_0^{\pi}\frac{(\pi - x)\sin x}{1 + \cos^2 x}\,dx.\end{aligned}
    P4 needs nothing except continuity of the integrand on [0,a][0, a]⁠. The two identities sin⁡(π−x)=sin⁡x\sin(\pi - x) = \sin x and cos⁡2(π−x)=(−cos⁡x)2=cos⁡2x\cos^2(\pi - x) = (-\cos x)^2 = \cos^2 x leave everything unchanged except the factor xx⁠, which becomes π−x\pi - x⁠. That is the whole point of the choice a=πa = \pi⁠.
    P4, Section 7.10 (a particular case of P3 with lower limit 0). Lesson: properties of definite integrals
  3. Split and solve for II

    Write π−x\pi - x as two terms and recognise II again:

    I=π∫0πsin⁡x1+cos⁡2x dx−∫0πxsin⁡x1+cos⁡2x dx=πJ−I,\begin{aligned}I &= \pi\int_0^{\pi}\frac{\sin x}{1 + \cos^2 x}\,dx \\ &\quad - \int_0^{\pi}\frac{x\sin x}{1 + \cos^2 x}\,dx \\ &= \pi J - I,\end{aligned}

    where J=∫0πsin⁡x1+cos⁡2x dxJ = \int_0^{\pi}\frac{\sin x}{1 + \cos^2 x}\,dx⁠. So 2I=πJ2I = \pi J⁠, that is

    I=π2∫0πsin⁡x1+cos⁡2x dx=π2J.I = \frac{\pi}{2}\int_0^{\pi}\frac{\sin x}{1 + \cos^2 x}\,dx = \frac{\pi}{2}J.
    The second integral is the original II word for word, so the equation I=πJ−II = \pi J - I can be solved for II⁠. This is the same as adding the two forms of II from Step 2: x+(π−x)=πx + (\pi - x) = \pi⁠. The hard factor xx is gone.
    Linearity: ∫(πg−xg)=π∫g−∫xg\int(\pi g - xg) = \pi\int g - \int xg⁠. Moving −I-I to the left gives 2I2I⁠. Lesson: properties
  4. Substitute t=cos⁡xt = \cos x in JJ

    Then dt=−sin⁡x dxdt = -\sin x\,dx⁠. When x=0x = 0⁠, t=1t = 1⁠; when x=πx = \pi⁠, t=−1t = -1⁠. So

    J=∫1−1−dt1+t2=∫−11dt1+t2.J = \int_1^{-1}\frac{-dt}{1 + t^2} = \int_{-1}^{1}\frac{dt}{1 + t^2}.
    sin⁡x dx\sin x\,dx is (minus) the differential of cos⁡x\cos x⁠, and the rest is a function of cos⁡x\cos x⁠. The substitution is legitimate: cos⁡x\cos x is differentiable and decreasing on [0,π][0, \pi]⁠, so tt runs once from 1 to −1-1⁠. The minus sign and the reversed limits cancel by P1 (swapping the limits changes the sign).
    P1, Section 7.10: ∫1−1(−g)=∫−11g\int_1^{-1}(-g) = \int_{-1}^{1} g⁠. Basics: substitution
  5. Use evenness, then tan⁡−1\tan^{-1}

    g(t)=11+t2g(t) = \frac{1}{1 + t^2} is even (g(−t)=g(t)g(-t) = g(t)⁠), so by P7 (i)

    J=2∫01dt1+t2=2[tan⁡−1t]01=2(π4−0)=π2.J = 2\int_0^1\frac{dt}{1 + t^2} = 2\left[\tan^{-1}t\right]_0^1 = 2\left(\frac{\pi}{4} - 0\right) = \frac{\pi}{2}.

    Therefore

    I=π2⋅J=π2⋅π2=π24≈2.4674011.I = \frac{\pi}{2}\cdot J = \frac{\pi}{2}\cdot\frac{\pi}{2} = \frac{\pi^2}{4} \approx 2.4674011.
    The book writes this as I=π∫01dt1+t2=π[tan⁡−1t]01=π24I = \pi\int_0^1\frac{dt}{1+t^2} = \pi\left[\tan^{-1}t\right]_0^1 = \frac{\pi^2}{4}⁠: the same numbers in a different order. One could also skip P7: [tan⁡−1t]−11=π4−(−π4)=π2\left[\tan^{-1}t\right]_{-1}^{1} = \frac{\pi}{4} - \left(-\frac{\pi}{4}\right) = \frac{\pi}{2}⁠.
    tan⁡−11=π4\tan^{-1}1 = \frac{\pi}{4}⁠, the principal value in (−π2,π2)\left(-\frac{\pi}{2}, \frac{\pi}{2}\right)⁠. Basics: symmetry
  6. The picture

    π/4 π/2 3π/4 π 1 π/2 x y y = x sin x / (1 + cos²x) dashed: (π/2)·sin x / (1 + cos²x) area π²/4 ≈ 2.467
    The shaded region under y=xsin⁡x1+cos⁡2xy = \frac{x\sin x}{1+\cos^2 x} has area π24\frac{\pi^2}{4}⁠. The dashed curve π2⋅sin⁡x1+cos⁡2x\frac{\pi}{2}\cdot\frac{\sin x}{1+\cos^2 x} is the average of the integrand and its mirror image in x=π2x = \frac{\pi}{2}⁠; it encloses the same area, which is what Steps 2 and 3 show.
    The integrand is lopsided (larger on the right, because of the factor xx⁠). Averaging it with its reflection x↦π−xx \mapsto \pi - x gives a symmetric curve with the same area, and that symmetric curve is easy to integrate.
    Area under a non-negative function = definite integral. Basics: area as a sum of thin strips
Result

∫0πxsin⁡x1+cos⁡2x dx=π24≈2.4674011,\int_0^{\pi}\frac{x\sin x}{1 + \cos^2 x}\,dx = \frac{\pi^2}{4} \approx 2.4674011, the same as the book's answer.

Check it with numbers

A numerical integration of xsin⁡x1+cos⁡2x\frac{x\sin x}{1 + \cos^2 x} over [0,π][0, \pi] gives 2.4674011, and π24=9.86960444≈2.4674011\frac{\pi^2}{4} = \frac{9.8696044}{4} \approx 2.4674011⁠. Also JJ numerically is 1.5707963, which is π2\frac{\pi}{2}⁠.

Common mistakes
  1. Changing xx only in some places. P4 replaces every xx by π−x\pi - x⁠, including the one in front.
  2. cos⁡(π−x)=cos⁡x\cos(\pi - x) = \cos x⁠. It is −cos⁡x-\cos x⁠; the square makes it harmless here.
  3. Losing the sign in dt=−sin⁡x dxdt = -\sin x\,dx or forgetting that the limits 1 and −1-1 are reversed. Together they give a plus sign (P1).
  4. Stopping at JJ⁠. J=π2J = \frac{\pi}{2} is not the answer; I=π2JI = \frac{\pi}{2}J⁠.
What to take away
  1. An integrand of the form x⋅g(x)x\cdot g(x) on [0,a][0, a] with g(a−x)=g(x)g(a - x) = g(x) gives ∫0ax g(x) dx=a2∫0ag(x) dx\int_0^a x\,g(x)\,dx = \frac{a}{2}\int_0^a g(x)\,dx⁠.
  2. P4 is used to create a second copy of II⁠; adding or subtracting the copies removes the difficult part.
  3. After a substitution with reversed limits, P1 restores the usual order and fixes the sign.

Every fact used, and where it comes from

FactUsed inSource
P4: ∫0af(x) dx=∫0af(a−x) dx\int_0^a f(x)\,dx = \int_0^a f(a - x)\,dxStep 2Section 7.10 (Lesson)
sin⁡(π−x)=sin⁡x\sin(\pi - x) = \sin x⁠, cos⁡(π−x)=−cos⁡x\cos(\pi - x) = -\cos xStep 2Trigonometry (Basics)
t=cos⁡xt = \cos x⁠, dt=−sin⁡x dxdt = -\sin x\,dx⁠, new limitsStep 4Section 7.9 (Lesson)
P1: ∫baf=−∫abf\int_b^a f = -\int_a^b fStep 4Section 7.10
P7 (i) for the even function 11+t2\frac{1}{1+t^2}Step 5Section 7.10 (Basics)
∫dt1+t2=tan⁡−1t+C\int\frac{dt}{1+t^2} = \tan^{-1}t + CStep 5Standard formula (x), Section 7.2
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →