# By creating a reduction formula for $I_n=\int_0 ^\pi x^n \sin x \,dx$ Show that $I_4=\pi^4 -12\pi^2 + 48$

By creating a reduction formula for $$I_n=\int_0 ^\pi x^n \sin x \,dx$$ Show that $$I_4=\pi^4 -12\pi^2 + 48$$

So by using integration by parts I wrote $$I_n$$ as $$I_n=\int_0 ^\pi x^n \sin x \,dx = \left[-x^n\cos x \right]_0 ^\pi -\int_0 ^\pi nx^{n-1}\times -\cos x\, dx$$ and after messing about with this I got $$I_n = \pi^n +nI_{n-1}$$ However, the answer shows that this is wrong and I don't get the correct answer for $$I_4$$. The correct answer is $$I_n = \pi^n -n(n-1)I_{n-2}$$. Can someone help explain how you get this reduction formula as I can't seem to get it and why my one doesn't work.

• You need to do by-parts again in order to compare the new integral with $I_n.$ – Adrian Keister Feb 1 '19 at 21:08
• Can you show me what you mean? – H.Linkhorn Feb 1 '19 at 21:26
• Do you know an antiderivative of the function $\cos$ is $\sin$? Perform again an integration by parts with the integral in your formula. (in the right side of you formula) – FDP Feb 1 '19 at 21:47

Not really different, but all fully formatted and pretty :) $$S(n)=\int_0^\pi x^n\sin x\,\mathrm dx$$ IBP: $$\mathrm dv=\sin x\,\mathrm dx\Rightarrow v=-\cos x\\ u=x^n\Rightarrow \mathrm du=nx^{n-1}\mathrm dx$$ Thus $$S(n)=-x^n\cos x\big|_0^\pi+n\int_0^\pi x^{n-1}\cos x\,\mathrm dx$$ $$S(n)=\pi^n+n\int_0^\pi x^{n-1}\cos x\,\mathrm dx$$ IBP: $$\mathrm dv=\cos x\,\mathrm dx\Rightarrow v=\sin x\\ u=x^{n-1}\Rightarrow \mathrm du=(n-1)x^{n-2}\mathrm dx$$ Thus $$S(n)=\pi^n+n\left[x^{n-1}\sin x\big|_{0}^{\pi}-(n-1)\int_0^\pi x^{n-2}\sin x\,\mathrm dx\right]$$ $$S(n)=\pi^n-n(n-1)S(n-2)$$ QED

$$I_n=\pi^n +\int_0 ^\pi nx^{n-1}\cos x\, dx \ne \pi^n + nI_{n-1}$$

As $$I$$ is an integral with a sine factor and not a cosine factor.

You need to do integration by parts a second time.

$$n\int_0 ^\pi nx^{n-1}\cos x\, dx = n(n-1)\sin x|_0^{\pi} - n(n-1)\int_0^\pi x^{n-2}\sin x\ dx$$

$$I_n=\pi^n - n(n-1)I_{n-2}$$

And $$I_0 = 2$$

Let $$I_n(a)=\int_0^{\pi}x^n\sin(ax)dx$$ Then \begin{align*}I_{n-2}^{''}(a) &=\frac{d^2}{da^2}\int_0^{\pi}x^{n-2}\sin(ax)dx\\ &=\int_0^{\pi}x^{n-2}\left(\frac{d^2}{da^2}\sin(ax)\right)dx\\ &=-\int_0^{\pi}x^n\sin(ax)dx\\ &=-I_n(a)\end{align*} and \begin{align*}I_n(1) &=-\lim_{a\to 1}\frac{d^2}{da^2}\int_0^{\pi}x^{n-2}\sin(ax)dx\\ &=-\lim_{a\to 1}\frac{d^2}{da^2}\left(\frac1{a^{n-1}}\int_0^{a\pi}x^{n-2}\sin(x)dx\right)\\ &=-\lim_{a\to 1}\left(\frac{n(n-1)}{a^{n+1}}\int_0^{a\pi}x^{n-2}\sin(x)dx-2\frac{n-1}{a^{n}}\pi (a\pi)^{n-2}\sin(a\pi)\right.\\&\qquad+\left.\frac{\pi^{n-1}}{a^{n-1}}\left((n-2)a^{n-3}\sin(a\pi)+a^{n-2}\pi\cos(a\pi)\right)\right)\\ &=-n(n-1)I_{n-2}(1)+\pi^n\end{align*} which is what we wanted.