Calculus · real student question

Evaluate the integral of x^2 * sin(x) from x = 0 to x = 2.

Question

Evaluate

02x2sinxdx\int_{0}^{2}x^{2}\sin x\,dx

Step-by-step solution

  1. Find the antiderivative by parts, twice. Taking u=x2u=x^{2}, dv=sinxdxdv=\sin x\,dx gives x2cosx+2xcosxdx-x^{2}\cos x+\int 2x\cos x\,dx; a second pass with u=xu=x, dv=cosxdxdv=\cos x\,dx gives xcosxdx=xsinx+cosx\int x\cos x\,dx=x\sin x+\cos x. Together:

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

    The antiderivative does not depend on the limits, so it is worth deriving once and reusing.

  2. Note what changes with the limits 00 and 22. Here 22 is a plain number of radians, not a multiple of π\pi, so sin2\sin 2 and cos2\cos 2 do not reduce to 00 or ±1\pm1. The exact answer will therefore contain both of them, and rounding them too early is the main hazard.

  3. Evaluate at the upper limit x=2x=2.

    4cos2+4sin2+2cos2=4sin22cos2-4\cos 2+4\sin 2+2\cos 2=4\sin 2-2\cos 2

    The two cosine terms partially cancel: 4cos2+2cos2=2cos2-4\cos 2+2\cos 2=-2\cos 2.

  4. Evaluate at the lower limit x=0x=0.

    0cos0+0sin0+2cos0=2-0\cdot\cos 0+0\cdot\sin 0+2\cos 0=2

  5. Subtract to get the exact value.

    02x2sinxdx=4sin22cos22\int_{0}^{2}x^{2}\sin x\,dx=4\sin 2-2\cos 2-2

  6. Convert to a decimal and sanity-check the sign. With sin2=0.909297\sin 2=0.909297 and cos2=0.416147\cos 2=-0.416147:

    4(0.909297)2(0.416147)2=3.637190+0.8322942=2.4694834(0.909297)-2(-0.416147)-2=3.637190+0.832294-2=2.469483

    Simpson rule gives 2.46948342.4694834 ✓. The result is positive because sinx>0\sin x>0 on all of [0,2][0,2] (since 2<π2<\pi).

Answer

4sin22cos222.46954\sin 2-2\cos 2-2\approx 2.4695

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