Evaluate $\int x \; \cos^3 x \; dx$
Let $I = \int x \; \cos^3 x \; dx$ $\;\;\; \cdots$ (1)
$\left[\begin{aligned}
\text{Note: } & \cos 3 \theta & = 4 \cos^3 \theta - 3 \cos \theta \\\\
\implies & \cos^3 \theta & = \dfrac{\cos 3 \theta + 3 \cos \theta}{4}
\end{aligned}\right]$
$\begin{aligned}
\therefore \; I & = \dfrac{1}{4} \int x \left(\cos 3 x + 3 \cos x\right) \; dx \\\\
& = \dfrac{1}{4} \int x \; \cos 3 x \; dx + \dfrac{3}{4} \int x \; \cos x \; dx \\\\
& = \dfrac{1}{4} \; I_1 + \dfrac{3}{4} \; I_2 \;\;\; \cdots (2)
\end{aligned}$
$\left[\text{Note: } \displaystyle \int u \cdot v \; dx = u \int v \; dx - \int \left\{\int v \; dx \times \dfrac{d}{dx} \left(u\right) \right\} \; dx \right]$
Consider $I_1 = \displaystyle \int x \; \cos 3 x \; dx$ $\;\;\; \cdots$ (3)
Here $u = x$ and $v = \cos 3 x$
$\begin{aligned}
\therefore \; I_1 & = x \int \cos 3 x \; dx - \int \left\{\int \cos 3 x \; dx \times \dfrac{d}{dx} \left(x\right) \right\} \; dx \\\\
& = \dfrac{x \; \sin 3 x}{3} - \int \dfrac{\sin 3 x}{3} \; dx \\\\
& = \dfrac{x \sin 3 x}{3} + \dfrac{\cos 3 x}{9} + c_1 \;\;\; \cdots (3a)
\end{aligned}$
Consider $I_2 = \displaystyle \int x \; \cos x \; dx$ $\;\;\; \cdots$ (4)
Here $u = x$ and $v = \cos x$
$\begin{aligned}
\therefore \; I_2 & = x \int \cos x \; dx - \int \left\{\int \cos x \; dx \times \dfrac{d}{dx} \left(x\right) \right\} \; dx \\\\
& = x \; \sin x - \int \sin x \; dx \\\\
& = x \; \sin x + \cos x + c_2 \;\;\; \cdots (4b)
\end{aligned}$
In view of equations (3a) and (4a), equation (2) becomes
$I = \dfrac{x \; \sin 3 x}{12} + \dfrac{\cos 3 x}{36} + \dfrac{3 \; x \; \sin x}{4} + \dfrac{3 \; \cos x}{4} + c$
where $c = \dfrac{c_1}{4} + \dfrac{3 \; c_2}{4}$