Answer
$$ - {x^n}\cos x + n\int {{x^{n - 1}}\cos xdx} $$
Work Step by Step
$$\eqalign{
& \int {{x^n}\sin x} dx \cr
& {\text{Using the integration by parts method }} \cr
& \,\,\,\,\,{\text{Let }}\,\,\,\,\,u = {x^n},\,\,\,\,\,\,\,du = n{x^{n - 1}}dx \cr
& \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,dv = \sin xdx,\,\,\,\,\,\,\,v = - \cos 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}\sin x} dx = \left( {{x^n}} \right)\left( { - \cos x} \right) - \int {\left( { - \cos x} \right)\left( {n{x^{x - 1}}dx} \right)} \cr
& \cr
& {\text{simplifying}} \cr
& \,\,\,\int {{x^n}\sin x} dx = - {x^n}\cos x + \int {n{x^{n - 1}}\cos xdx} \cr
& \,\,\,\int {{x^n}\sin x} dx = - {x^n}\cos x + n\int {{x^{n - 1}}\cos xdx} \cr} $$