I am working through Cartwright's proof for $\pi$ being irrational; specifically, the problem states:
Given $$A_n=\int_{-1}^{1}(1-x^2)^n\cos\left(\frac {\pi x}{2}\right)\,dx$$
Prove:
$$A_n=\frac {8n(2n-1)A_{n-1}-16n(n-1)A_{n-2}}{\pi ^2}.$$
I must prove it using integration by parts and have gotten really close to the answer but I am stuck at this step:
$$A_n=\frac{-16n(n-1)}{\pi^2}\int_{-1}^{1}x^2(1-x^2)^{n-2}\cos\left(\frac {\pi x}{2}\right)+\frac {8n}{\pi^2}A_{n-1}.$$
Specifically, I'm wondering how one could get rid of the $x^2$ term out of the integral to get $A_{n-2}.$
Thanks in advance!