Answer
$$\int x^{n} \cos x d x=x^{n} \sin x-n \int x^{n-1} \sin x d x$$
Work Step by Step
Given
$$\int x^{n} \cos x d x $$
Use integration by parts , let
\begin{aligned}
u&= x^n \ \ \ \ \ \ &dv&= \cos x dx\\
du&=nx^{n-1} dx \ \ \ \ \ \ &v&= \sin x
\end{aligned}
then
\begin{aligned}
\int x^{n} \cos x d x &= uv-\int vdu \\
&= x^n\sin x-n \int x^{n-1}\sin xdx
\end{aligned}