Calculus · real student question

Find the indefinite integral of x^2 * sin(x) with respect to x.

Question

Find

x2sinxdx.\int x^{2}\sin x\,dx.

Step-by-step solution

  1. Choose uu so that differentiating reduces the polynomial. In udv=uvvdu\int u\,dv=uv-\int v\,du the aim is a simpler leftover integral. Taking u=x2u=x^{2} makes du=2xdxdu=2x\,dx, dropping the degree from 22 to 11; taking u=sinxu=\sin x instead would raise the polynomial degree and make things worse. This is the LIATE guideline in action — the algebraic factor is the one to differentiate.

  2. First application. With u=x2u=x^{2}, dv=sinxdxdv=\sin x\,dx (so v=cosxv=-\cos x):

    x2sinxdx=x2cosx(cosx)(2x)dx=x2cosx+2xcosxdx.\int x^{2}\sin x\,dx=-x^{2}\cos x-\int\left(-\cos x\right)(2x)\,dx=-x^{2}\cos x+\int 2x\cos x\,dx.

    The two minus signs — one from v=cosxv=-\cos x and one from the formula — combine to a plus, which is where sign errors usually creep in.

  3. Second application on the remaining integral. For xcosxdx\int x\cos x\,dx take u=xu=x, dv=cosxdxdv=\cos x\,dx, so du=dxdu=dx, v=sinxv=\sin x:

    xcosxdx=xsinxsinxdx=xsinx+cosx.\int x\cos x\,dx=x\sin x-\int\sin x\,dx=x\sin x+\cos x.

    The polynomial degree is now 00, so the process terminates — a degree-nn polynomial needs exactly nn rounds of parts.

  4. Combine the pieces. Multiplying the second result by the factor 22 and substituting:

    2xcosxdx=2xsinx+2cosx,\int 2x\cos x\,dx=2x\sin x+2\cos x,

    x2sinxdx=x2cosx+2xsinx+2cosx+C.\int x^{2}\sin x\,dx=-x^{2}\cos x+2x\sin x+2\cos x+C.

  5. Verify by differentiating. Using the product rule on each term:

    ddx(x2cosx)=2xcosx+x2sinx,ddx(2xsinx)=2sinx+2xcosx,ddx(2cosx)=2sinx.\frac{d}{dx}\left(-x^{2}\cos x\right)=-2x\cos x+x^{2}\sin x,\quad \frac{d}{dx}\left(2x\sin x\right)=2\sin x+2x\cos x,\quad \frac{d}{dx}\left(2\cos x\right)=-2\sin x.

    Adding: the 2xcosx\mp2x\cos x pair cancels, the ±2sinx\pm2\sin x pair cancels, leaving exactly x2sinxx^{2}\sin x ✓. A numeric check at x=1.3x=1.3 gives 1.62841331.6284133 both ways ✓.

Answer

x2sinxdx=x2cosx+2xsinx+2cosx+C\int x^{2}\sin x\,dx=-x^{2}\cos x+2x\sin x+2\cos x+C

Need to solve a different problem like this? Open the solver →