3

How would I integrate the following?

$$\int_0^{\pi/2} x^2\sin(x)\,dx$$

I did $u=x^2$ and $dv=\sin(x)$

I got

$x^2-\cos(x)+2\int x\cos(x)\,dx.\quad$ I then used $u=x$ and $dv=\cos(x).$

I got

$$x^2-\cos(x)+2[x-\sin(x)-\int\sin(x)]$$

then

$x^2-\cos(x)+-2 \sin(x)(x)-\cos(x)\Big|_0^{\pi/2} =\dfrac{\pi^2}{4}-0-2$

Empty
  • 13,012
Fernando Martinez
  • 6,698
  • 19
  • 74
  • 108

2 Answers2

3

You need to multiply $u$ and $v$, then subtract the subsequent integral:

So you should have $$\begin{align} \int_0^{\pi/2} x^2\sin(x)\,dx & = -x^2\cos(x)+2\int x\cos(x)\,dx \\ \\ & = -x^2 \cos x + 2\Big[x \sin x - \int \sin x\,dx\Big]\\ \\ & = -x^2\cos x + 2x \sin x - (-2\cos x)\\ \\ & = -x^2 \cos x + 2x \sin x + 2\cos x \Big|_0^{2\pi}\end{align}$$

And proceed from there.

amWhy
  • 209,954
3

$u=x^2$ then $du=2xdx$ and $dv=\sin(x)dx$ then $v=-\cos(x)$. So integral becomes $=-(x^2\cos(x))+2\int x\cos(x)dx$ integration by parts for $$\int x\cos(x)dx$$ $x=u, dx=du$ and $dv=\cos(x)dx, v=\sin(x)$ then $$=-(x^2\cos(x))-2\int \sin(x)dx+2x\sin(x)$$ the integral of $\sin x$ is $-\cos x$ so we get $$=2\cos(x)-x^2\cos(x)+2x\sin(x)$$

dustin
  • 8,241
Ömer
  • 2,038