Answer
$${x^n}\sin x - n\int {{x^{n - 1}}\sin xdx} $$
Work Step by Step
$$\eqalign{
& \int {{x^n}\cos x} dx \cr
& {\text{Using integration by parts method }} \cr
& \,\,\,\,\,{\text{Let }}\,\,\,\,\,u = {x^n},\,\,\,\,\,\,\,du = n{x^{n - 1}}dx \cr
& \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,dv = \cos xdx,\,\,\,\,\,\,\,v = \sin x \cr
& \cr
& {\text{Integration by parts formula }}\int {udv} = uv - \int {vdu.{\text{ T}}} {\text{hen}}{\text{,}} \cr
& \int {udv} = uv - \int {vdu} \,\,\,\, \cr
& \to \,\,\,\,\int {{x^n}\cos x} dx = \left( {{x^n}} \right)\left( {\sin x} \right) - \int {\left( {\sin x} \right)\left( {n{x^{x - 1}}dx} \right)} \cr
& \cr
& {\text{simplifying}} \cr
& \,\,\,\int {{x^n}\cos x} dx = {x^n}\sin x - \int {n{x^{n - 1}}\sin xdx} \cr
& \,\,\,\int {{x^n}\cos x} dx = {x^n}\sin x - n\int {{x^{n - 1}}\sin xdx} \cr} $$