How do you find the antiderivative of int (x^3cosx) dx?

Nov 5, 2016

${x}^{3} \sin x + 3 {x}^{2} \cos x - 6 x \sin x - 6 \cos x + C$

Explanation:

$I = \int {x}^{3} \cos x \mathrm{dx}$

This will require multiple iterations of integration by parts (IBP). Integration by parts takes the form $\int u \mathrm{dv} = u v - \int v \mathrm{du}$.

So, for $\int {x}^{3} \cos x \mathrm{dx}$ as $\int u \mathrm{dv}$, let:

$\left\{\begin{matrix}u = {x}^{3} \\ \mathrm{dv} = \cos x \mathrm{dx}\end{matrix}\right.$

Now, differentiating $u$ and integrating $\mathrm{dv}$, we see that:

$\left\{\begin{matrix}u = {x}^{3} & \implies & \mathrm{du} = 3 {x}^{2} \mathrm{dx} \\ \mathrm{dv} = \cos x \mathrm{dx} & \implies & v = \sin x\end{matrix}\right.$

Now, plugging this into the IBP formula:

$I = u v - \int v \mathrm{du} = {x}^{3} \sin x - \int 3 {x}^{2} \sin x \mathrm{dx}$

Now, for $\int 3 {x}^{2} \sin x \mathrm{dx}$, perform IBP again:

$\left\{\begin{matrix}u = 3 {x}^{2} & \implies & \mathrm{du} = 6 x \mathrm{dx} \\ \mathrm{dv} = \sin x \mathrm{dx} & \implies & v = - \cos x\end{matrix}\right.$

Thus:

$I = {x}^{3} \sin x - \left[3 {x}^{2} \left(- \cos x\right) - \int 6 x \left(- \cos x\right) \mathrm{dx}\right]$

Pay close attention to sign:

$I = {x}^{3} \sin x + 3 {x}^{2} \cos x - \int 6 x \cos x \mathrm{dx}$

IBP again on the integral:

$\left\{\begin{matrix}u = 6 x & \implies & \mathrm{du} = 6 \mathrm{dx} \\ \mathrm{dv} = \cos x \mathrm{dx} & \implies & v = \sin x\end{matrix}\right.$

So:

$I = {x}^{3} \sin x + 3 {x}^{2} \cos x - \left[6 x \sin x - \int 6 \sin x \mathrm{dx}\right]$

Since $\int \sin x \mathrm{dx} = - \cos x$:

$I = {x}^{3} \sin x + 3 {x}^{2} \cos x - \left[6 x \sin x + 6 \sin x\right]$

$I = {x}^{3} \sin x + 3 {x}^{2} \cos x - 6 x \sin x - 6 \cos x + C$