# How do you integrate int x cos sqrtx dx  using integration by parts?

Nov 27, 2016

$2 \left(\sqrt{x} \sin \left(\sqrt{x}\right) \left(x - 6\right) + 3 \cos \left(\sqrt{x}\right) \left(x - 2\right)\right) + C$

#### Explanation:

Before using integration by parts, let $t = \sqrt{x}$. This implies that ${t}^{2} = x$. Differentiating this shows that $2 t \mathrm{dt} = \mathrm{dx}$.

So:

$I = \int x \cos \left(\sqrt{x}\right) \mathrm{dx} = \int {t}^{2} \cos \left(t\right) \left(2 t \mathrm{dt}\right) = \int 2 {t}^{3} \cos \left(t\right) \mathrm{dt}$

Now we should apply integration by parts. IBP takes the form $\int u \mathrm{dv} = u v - \int v \mathrm{du}$. So, for $\int 2 {t}^{3} \cos \left(t\right) \mathrm{dt}$, let:

$\left\{\begin{matrix}u = 2 {t}^{3} & \implies & \mathrm{du} = 6 {t}^{2} \mathrm{dt} \\ \mathrm{dv} = \cos \left(t\right) \mathrm{dt} & \implies & v = \sin \left(t\right)\end{matrix}\right.$

Then:

$I = u v - \int v \mathrm{du} = 2 {t}^{3} \sin \left(t\right) - \int 6 {t}^{2} \sin \left(t\right) \mathrm{dt}$

For $\int 6 {t}^{2} \sin \left(t\right) \mathrm{dt}$, use IBP again:

$\left\{\begin{matrix}u = 6 {t}^{2} & \implies & \mathrm{du} = 12 t \mathrm{dt} \\ \mathrm{dv} = \sin \left(t\right) \mathrm{dt} & \implies & v = - \cos \left(t\right)\end{matrix}\right.$

Now:

$I = 2 {t}^{3} \sin \left(t\right) - \left[- 6 {t}^{2} \cos \left(t\right) + \int 12 t \cos \left(t\right) \mathrm{dt}\right]$

$I = 2 {t}^{3} \sin \left(t\right) + 6 {t}^{2} \cos \left(t\right) - \int 12 t \cos \left(t\right) \mathrm{dt}$

Reapplying IBP:

$\left\{\begin{matrix}u = 12 t & \implies & \mathrm{du} = 12 \mathrm{dt} \\ \mathrm{dv} = \cos \left(t\right) \mathrm{dt} & \implies & v = \sin \left(t\right)\end{matrix}\right.$

$I = 2 {t}^{3} \sin \left(t\right) + 6 {t}^{2} \cos \left(t\right) - \left[12 t \sin \left(t\right) - \int 12 \sin \left(t\right) \mathrm{dt}\right]$

$I = 2 {t}^{3} \sin \left(t\right) + 6 {t}^{2} \cos \left(t\right) - 12 t \sin \left(t\right) + \int 12 \sin \left(t\right) \mathrm{dt}$

Since $\int \sin \left(t\right) \mathrm{dt} = - \cos \left(t\right)$:

$I = 2 {t}^{3} \sin \left(t\right) + 6 {t}^{2} \cos \left(t\right) - 12 t \sin \left(t\right) - 12 \cos \left(t\right)$

Factoring:

$I = 2 \left(t \sin \left(t\right) \left({t}^{2} - 6\right) + 3 \cos \left(t\right) \left({t}^{2} - 2\right)\right)$

Since $t = \sqrt{x}$:

$I = 2 \left(\sqrt{x} \sin \left(\sqrt{x}\right) \left(x - 6\right) + 3 \cos \left(\sqrt{x}\right) \left(x - 2\right)\right) + C$