Calculus · real student question

Evaluate the integral of sin^n(x) from 0 to pi/2 for a non-negative integer n.

Question

Evaluate

In=0π/2sinnxdxI_{n}=\int_{0}^{\pi/2}\sin^{n}x\,dx

for a non-negative integer nn.

Step-by-step solution

  1. Split off one sine and integrate by parts. Write sinnx=sinn1xsinx\sin^{n}x=\sin^{n-1}x\cdot\sin x and take

    u=sinn1x,dv=sinxdx  du=(n1)sinn2xcosxdx,v=cosxu=\sin^{n-1}x,\qquad dv=\sin x\,dx\ \Longrightarrow\ du=(n-1)\sin^{n-2}x\cos x\,dx,\quad v=-\cos x

    The boundary term [sinn1xcosx]0π/2\left[-\sin^{n-1}x\cos x\right]_{0}^{\pi/2} vanishes at both ends — cosπ2=0\cos\tfrac\pi2=0 at the top and sin0=0\sin 0=0 at the bottom — which is exactly why these limits are chosen.

  2. Convert cos2\cos^{2} back to sin\sin. What remains is

    In=(n1)0π/2sinn2xcos2xdx=(n1)0π/2sinn2x(1sin2x)dxI_{n}=(n-1)\int_{0}^{\pi/2}\sin^{n-2}x\cos^{2}x\,dx=(n-1)\int_{0}^{\pi/2}\sin^{n-2}x\left(1-\sin^{2}x\right)dx

    so

    In=(n1)In2(n1)InI_{n}=(n-1)I_{n-2}-(n-1)I_{n}

    The original integral reappears on the right, which is the signal to solve for it algebraically rather than integrate again.

  3. Solve for InI_{n} to get the reduction formula. Adding (n1)In(n-1)I_{n} to both sides gives nIn=(n1)In2nI_{n}=(n-1)I_{n-2}, hence

    In=n1nIn2I_{n}=\frac{n-1}{n}\,I_{n-2}

    Each application lowers the index by two, so the recursion terminates at I0I_{0} or I1I_{1} depending on the parity of nn.

  4. Compute the two base cases.

    I0=0π/21dx=π2,I1=0π/2sinxdx=[cosx]0π/2=1I_{0}=\int_{0}^{\pi/2}1\,dx=\frac{\pi}{2},\qquad I_{1}=\int_{0}^{\pi/2}\sin x\,dx=\left[-\cos x\right]_{0}^{\pi/2}=1

    These are the sole source of the π\pi: it survives only in the even chain.

  5. Unroll the recursion into the Wallis formulas.

    In=(n1)(n3)1n(n2)2π2  (n even),In=(n1)(n3)2n(n2)3  (n odd)I_{n}=\frac{(n-1)(n-3)\cdots 1}{n(n-2)\cdots 2}\cdot\frac{\pi}{2}\ \ (n\text{ even}),\qquad I_{n}=\frac{(n-1)(n-3)\cdots 2}{n(n-2)\cdots 3}\ \ (n\text{ odd})

    For example I4=3412π2=3π16=0.58905I_{4}=\tfrac34\cdot\tfrac12\cdot\tfrac\pi2=\tfrac{3\pi}{16}=0.58905 and I5=4523=815=0.53333I_{5}=\tfrac45\cdot\tfrac23=\tfrac{8}{15}=0.53333.

  6. Note the single formula that covers both parities. Using the Gamma function,

    0π/2sinnxdx=πΓ ⁣(n+12)2Γ ⁣(n2+1)\int_{0}^{\pi/2}\sin^{n}x\,dx=\frac{\sqrt{\pi}\,\Gamma\!\left(\frac{n+1}{2}\right)}{2\,\Gamma\!\left(\frac{n}{2}+1\right)}

    Numerical integration for n=0n=0 through 77 agrees with this to ten decimal places in every case ✓, and it extends the result to non-integer n>1n>-1.

Answer

In=n1nIn2,I0=π2, I1=1;In=πΓ ⁣(n+12)2Γ ⁣(n2+1)I_{n}=\frac{n-1}{n}I_{n-2},\quad I_{0}=\frac{\pi}{2},\ I_{1}=1;\qquad I_{n}=\frac{\sqrt{\pi}\,\Gamma\!\left(\frac{n+1}{2}\right)}{2\,\Gamma\!\left(\frac{n}{2}+1\right)}

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