Final Answer
$-x^2\cos\left(x\right)+2x\sin\left(x\right)+2\cos\left(x\right)+C_0$
Got another answer? Verify it here!
Step-by-step Solution
Specify the solving method
Choose an option Integrate using basic integrals Integrate by substitution Integrate by parts Tabular Integration Suggest another method or feature
Send
1
We can solve the integral $\int x^2\sin\left(x\right)dx$ by applying integration by parts method to calculate the integral of the product of two functions, using the following formula
$\displaystyle\int u\cdot dv=u\cdot v-\int v \cdot du$
Intermediate steps
2
First, identify $u$ and calculate $du$
$\begin{matrix}\displaystyle{u=x^2}\\ \displaystyle{du=2xdx}\end{matrix}$
Explain this step further
3
Now, identify $dv$ and calculate $v$
$\begin{matrix}\displaystyle{dv=\sin\left(x\right)dx}\\ \displaystyle{\int dv=\int \sin\left(x\right)dx}\end{matrix}$
$v=\int\sin\left(x\right)dx$
5
Apply the integral of the sine function: $\int\sin(x)dx=-\cos(x)$
$-\cos\left(x\right)$
Intermediate steps
6
Now replace the values of $u$, $du$ and $v$ in the last formula
$-x^2\cos\left(x\right)+2\int x\cos\left(x\right)dx$
Explain this step further
7
We can solve the integral $\int x\cos\left(x\right)dx$ by applying integration by parts method to calculate the integral of the product of two functions, using the following formula
$\displaystyle\int u\cdot dv=u\cdot v-\int v \cdot du$
Intermediate steps
8
First, identify $u$ and calculate $du$
$\begin{matrix}\displaystyle{u=x}\\ \displaystyle{du=dx}\end{matrix}$
Explain this step further
9
Now, identify $dv$ and calculate $v$
$\begin{matrix}\displaystyle{dv=\cos\left(x\right)dx}\\ \displaystyle{\int dv=\int \cos\left(x\right)dx}\end{matrix}$
$v=\int\cos\left(x\right)dx$
11
Apply the integral of the cosine function: $\int\cos(x)dx=\sin(x)$
$\sin\left(x\right)$
12
Now replace the values of $u$, $du$ and $v$ in the last formula
$-x^2\cos\left(x\right)+2\left(x\sin\left(x\right)-\int\sin\left(x\right)dx\right)$
13
Multiply the single term $2$ by each term of the polynomial $\left(x\sin\left(x\right)-\int\sin\left(x\right)dx\right)$
$-x^2\cos\left(x\right)+2x\sin\left(x\right)-2\int\sin\left(x\right)dx$
Intermediate steps
14
The integral $-2\int\sin\left(x\right)dx$ results in: $2\cos\left(x\right)$
$2\cos\left(x\right)$
Explain this step further
15
Gather the results of all integrals
$-x^2\cos\left(x\right)+2x\sin\left(x\right)+2\cos\left(x\right)$
16
As the integral that we are solving is an indefinite integral, when we finish integrating we must add the constant of integration $C$
$-x^2\cos\left(x\right)+2x\sin\left(x\right)+2\cos\left(x\right)+C_0$
Final Answer
$-x^2\cos\left(x\right)+2x\sin\left(x\right)+2\cos\left(x\right)+C_0$