Answer
\begin{align*}
\int x^{n} \cos x d x&=x^{n} \sin x-n \int x^{n-1} \sin x d x\\
\int x^{n} \sin x d x&=-x^{n} \cos x+n \int x^{n-1} \cos x d x
\end{align*}
Work Step by Step
Given $$\int x^{n} \cos x d x$$
Let
\begin{align*}
u&=x^n \ \ \ \ \ \ \ dv=\cos xdx\\
du&= nx^{n-1}\ \ \ \ \ \ v=\sin x
\end{align*}
Then
\begin{align*}
\int x^{n} \cos x d x=x^{n} \sin x-n \int x^{n-1} \sin x d x
\end{align*}
Given $$\int x^{n} \sin x d x$$
Let
\begin{align*}
u&=x^n \ \ \ \ \ \ \ dv=\sin xdx\\
du&= nx^{n-1}\ \ \ \ \ \ v=-\cos x
\end{align*}
Then
\begin{align*}
\int x^{n} \sin x d x=-x^{n} \cos x+n \int x^{n-1} \cos x d x
\end{align*}