Stuck on this? Solve it with AI
Calculus · real student question

Evaluate the integral from 0 to pi of x times (sin 2x - sin x) dx.

Question

Evaluate

∫0πx(sin⁡2x−sin⁡x)dx\int_{0}^{\pi}x\left(\sin2x-\sin x\right)dx

Step-by-step solution

  1. Split by linearity. Each piece is a polynomial times a trigonometric function, the standard shape for integration by parts:

    ∫0πxsin⁡2x dx−∫0πxsin⁡x dx\int_{0}^{\pi}x\sin2x\,dx-\int_{0}^{\pi}x\sin x\,dx

    In both, choose u=xu=x (which differentiates away to 11) and dvdv the sine part.

  2. First integral: ∫xsin⁡2x dx\displaystyle\int x\sin2x\,dx. With u=xu=x, dv=sin⁡2x dxdv=\sin2x\,dx, so du=dxdu=dx and v=−12cos⁡2xv=-\tfrac12\cos2x:

    ∫xsin⁡2x dx=−x2cos⁡2x+12∫cos⁡2x dx=−x2cos⁡2x+14sin⁡2x\int x\sin2x\,dx=-\frac{x}{2}\cos2x+\frac12\int\cos2x\,dx=-\frac{x}{2}\cos2x+\frac14\sin2x

    The inner factors of 12\tfrac12 come from the chain rule on 2x2x and are the easiest thing to lose here.

  3. Evaluate the first integral on [0,π][0,\pi]. At x=πx=\pi: cos⁡2π=1\cos2\pi=1 and sin⁡2π=0\sin2\pi=0, giving −π2-\tfrac{\pi}{2}. At x=0x=0: both terms vanish. So

    ∫0πxsin⁡2x dx=−π2\int_{0}^{\pi}x\sin2x\,dx=-\frac{\pi}{2}

    Simpson quadrature returns −1.5707963-1.5707963 ✓, matching −π2-\tfrac\pi2.

  4. Second integral: ∫xsin⁡x dx\displaystyle\int x\sin x\,dx. With u=xu=x, dv=sin⁡x dxdv=\sin x\,dx, so v=−cos⁡xv=-\cos x:

    ∫xsin⁡x dx=−xcos⁡x+∫cos⁡x dx=−xcos⁡x+sin⁡x\int x\sin x\,dx=-x\cos x+\int\cos x\,dx=-x\cos x+\sin x

    At x=πx=\pi: −π(−1)+0=π-\pi(-1)+0=\pi. At x=0x=0: 00. So ∫0πxsin⁡x dx=π\displaystyle\int_{0}^{\pi}x\sin x\,dx=\pi, confirmed numerically as 3.14159273.1415927 ✓.

  5. Subtract to finish.

    −π2−π=−3π2≈−4.712389-\frac{\pi}{2}-\pi=-\frac{3\pi}{2}\approx-4.712389

    Direct Simpson quadrature of the original integrand gives −4.71238898-4.71238898 ✓, agreeing to eight decimals.

  6. Sanity-check the sign. On (0,π)(0,\pi) the term −xsin⁡x-x\sin x is negative throughout, while xsin⁡2xx\sin2x contributes a positive hump on (0,π2)\left(0,\tfrac\pi2\right) and a larger negative one on (π2,π)\left(\tfrac\pi2,\pi\right) — larger because the weight xx is bigger there. Both parts therefore pull the total negative, consistent with −3π2-\tfrac{3\pi}{2}.

Answer

∫0πx(sin⁡2x−sin⁡x)dx=−3π2\int_{0}^{\pi}x\left(\sin2x-\sin x\right)dx=-\frac{3\pi}{2}

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