GATE | GATE-CS-2014-(Set-3) | Question 57

The value of integral given below is:
\int_{0}^{\pi} x^2 cosx dx
(A)-2 \pi
(B)\pi
(C)-\pi
(D)2\pi
(A) A
(B) B
(C) C
(D) D


Answer: (A)

Explanation: Using Integration By-parts-

     \begin{flalign*} \int x^2\cos{x}\:dx &= x^2\int \cos{x}\:dx - \int \frac{d}{dx}x^2 \Big( \int \cos{x}\:dx \Big)\:dx\\ &= x^2\sin{x} - \int 2x \sin{x}\:dx\\ &\text{Using By-Parts again}\\ &= x^2\sin{x} - 2\Big(x (-\cos{x}) - \int 1 . (-\cos{x})\:dx \Big)\\ &= x^2\sin{x} + 2x \cos{x} - 2\sin{x} \\ &\text{Putting the limits}\\ &= \big[ x^2\sin{x} + 2x \cos{x} - 2\sin{x} \big] \limits_{0}^{\pi} \\ &= \big[ 0 - 2\pi - 0 \big] - \big[ 0 + 0 - 0 \big]\\ &= -2\pi\\ \end{flalign*}

Therefore the correct option is A.

Quiz of this Question



My Personal Notes arrow_drop_up