Question

The value of the integral given below is

∫0πx2cos⁡x dx\int_0^\pi x^2 \cos x \, dx
Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2014 answer key

Solution

Evaluate the definite integral using integration by parts twice.

We evaluate I=∫0πx2cos⁡x dxI = \int_0^\pi x^2 \cos x \, dx.

  1. First Integration by Parts:
    Let u=x2  ⟹  du=2x dxu = x^2 \implies du = 2x \, dx, and dv=cos⁡x dx  ⟹  v=sin⁡xdv = \cos x \, dx \implies v = \sin x.

    I=[x2sin⁡x]0π−2∫0πxsin⁡x dx.I = \left[ x^2 \sin x \right]_0^\pi - 2 \int_0^\pi x \sin x \, dx.

    Evaluating the boundary term:

    [x2sin⁡x]0π=π2sin⁡(π)−0=0.\left[ x^2 \sin x \right]_0^\pi = \pi^2 \sin(\pi) - 0 = 0.

    Thus:

    I=−2∫0πxsin⁡x dx.I = -2 \int_0^\pi x \sin x \, dx.
  2. Second Integration by Parts:
    For ∫0πxsin⁡x dx\int_0^\pi x \sin x \, dx, let u=x  ⟹  du=dxu = x \implies du = dx, and dv=sin⁡x dx  ⟹  v=−cos⁡xdv = \sin x \, dx \implies v = -\cos x.

    ∫0πxsin⁡x dx=[−xcos⁡x]0π−∫0π(−cos⁡x) dx\int_0^\pi x \sin x \, dx = \left[ -x \cos x \right]_0^\pi - \int_0^\pi (-\cos x) \, dx
    =[−πcos⁡(π)−0]+[sin⁡x]0π= \left[ -\pi \cos(\pi) - 0 \right] + \left[ \sin x \right]_0^\pi
    =−π(−1)+(sin⁡(π)−sin⁡(0))=π+0=π.= -\pi(-1) + (\sin(\pi) - \sin(0)) = \pi + 0 = \pi.
  3. Combine Results:

    I=−2(π)=−2π.I = -2(\pi) = -2\pi.

This matches option A.

Final answer

A

Common trap

Forgetting the minus sign when integrating sin(x) to -cos(x), leading to a sign error.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2014 Computer Science and Information Technology (CS) Session 3
Question
57 of 65, printed as CS Q.47
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.