Integral of x2sin(x)x^{2} \sin{\left(x \right)}

The calculator will find the integral/antiderivative of x2sin(x)x^{2} \sin{\left(x \right)}, with steps shown.

Related calculator: Definite and Improper Integral Calculator

Please write without any differentials such as dxdx, dydy etc.
Leave empty for autodetection.

If the calculator did not compute something or you have identified an error, or you have a suggestion/feedback, please contact us.

Your Input

Find x2sin(x)dx\int x^{2} \sin{\left(x \right)}\, dx.

Solution

For the integral x2sin(x)dx\int{x^{2} \sin{\left(x \right)} d x}, use integration by parts udv=uvvdu\int \operatorname{u} \operatorname{dv} = \operatorname{u}\operatorname{v} - \int \operatorname{v} \operatorname{du}.

Let u=x2\operatorname{u}=x^{2} and dv=sin(x)dx\operatorname{dv}=\sin{\left(x \right)} dx.

Then du=(x2)dx=2xdx\operatorname{du}=\left(x^{2}\right)^{\prime }dx=2 x dx (steps can be seen here) and v=sin(x)dx=cos(x)\operatorname{v}=\int{\sin{\left(x \right)} d x}=- \cos{\left(x \right)} (steps can be seen here).

So,

x2sin(x)dx=(x2(cos(x))(cos(x))2xdx)=(x2cos(x)(2xcos(x))dx){\color{red}{\int{x^{2} \sin{\left(x \right)} d x}}}={\color{red}{\left(x^{2} \cdot \left(- \cos{\left(x \right)}\right)-\int{\left(- \cos{\left(x \right)}\right) \cdot 2 x d x}\right)}}={\color{red}{\left(- x^{2} \cos{\left(x \right)} - \int{\left(- 2 x \cos{\left(x \right)}\right)d x}\right)}}

Apply the constant multiple rule cf(x)dx=cf(x)dx\int c f{\left(x \right)}\, dx = c \int f{\left(x \right)}\, dx with c=2c=-2 and f(x)=xcos(x)f{\left(x \right)} = x \cos{\left(x \right)}:

x2cos(x)(2xcos(x))dx=x2cos(x)(2xcos(x)dx)- x^{2} \cos{\left(x \right)} - {\color{red}{\int{\left(- 2 x \cos{\left(x \right)}\right)d x}}} = - x^{2} \cos{\left(x \right)} - {\color{red}{\left(- 2 \int{x \cos{\left(x \right)} d x}\right)}}

For the integral xcos(x)dx\int{x \cos{\left(x \right)} d x}, use integration by parts udv=uvvdu\int \operatorname{u} \operatorname{dv} = \operatorname{u}\operatorname{v} - \int \operatorname{v} \operatorname{du}.

Let u=x\operatorname{u}=x and dv=cos(x)dx\operatorname{dv}=\cos{\left(x \right)} dx.

Then du=(x)dx=1dx\operatorname{du}=\left(x\right)^{\prime }dx=1 dx (steps can be seen here) and v=cos(x)dx=sin(x)\operatorname{v}=\int{\cos{\left(x \right)} d x}=\sin{\left(x \right)} (steps can be seen here).

The integral can be rewritten as

x2cos(x)+2xcos(x)dx=x2cos(x)+2(xsin(x)sin(x)1dx)=x2cos(x)+2(xsin(x)sin(x)dx)- x^{2} \cos{\left(x \right)} + 2 {\color{red}{\int{x \cos{\left(x \right)} d x}}}=- x^{2} \cos{\left(x \right)} + 2 {\color{red}{\left(x \cdot \sin{\left(x \right)}-\int{\sin{\left(x \right)} \cdot 1 d x}\right)}}=- x^{2} \cos{\left(x \right)} + 2 {\color{red}{\left(x \sin{\left(x \right)} - \int{\sin{\left(x \right)} d x}\right)}}

The integral of the sine is sin(x)dx=cos(x)\int{\sin{\left(x \right)} d x} = - \cos{\left(x \right)}:

x2cos(x)+2xsin(x)2sin(x)dx=x2cos(x)+2xsin(x)2(cos(x))- x^{2} \cos{\left(x \right)} + 2 x \sin{\left(x \right)} - 2 {\color{red}{\int{\sin{\left(x \right)} d x}}} = - x^{2} \cos{\left(x \right)} + 2 x \sin{\left(x \right)} - 2 {\color{red}{\left(- \cos{\left(x \right)}\right)}}

Therefore,

x2sin(x)dx=x2cos(x)+2xsin(x)+2cos(x)\int{x^{2} \sin{\left(x \right)} d x} = - x^{2} \cos{\left(x \right)} + 2 x \sin{\left(x \right)} + 2 \cos{\left(x \right)}

Add the constant of integration:

x2sin(x)dx=x2cos(x)+2xsin(x)+2cos(x)+C\int{x^{2} \sin{\left(x \right)} d x} = - x^{2} \cos{\left(x \right)} + 2 x \sin{\left(x \right)} + 2 \cos{\left(x \right)}+C

Answer: x2sin(x)dx=x2cos(x)+2xsin(x)+2cos(x)+C\int{x^{2} \sin{\left(x \right)} d x}=- x^{2} \cos{\left(x \right)} + 2 x \sin{\left(x \right)} + 2 \cos{\left(x \right)}+C