I'm having difficulty proving this integral reduction formula by parts
If
$$I_n=\int\frac{dx}{(a^2-x^2)^n}$$
, then
$$\int\frac{dx}{(a^2-x^2)^n}=\frac{x}{2a^2(n-1)(a^2-x^2)^{n-1}}+\left(\frac{2n-3}{2a^2(n-1)}\right)I_{n-1}$$
I managed to do it using a trigonometric substitution:
$$\int\frac{dx}{(a^2-x^2)^n}\space\begin{vmatrix}x=a\sin(\theta)\\dx=a\cos(\theta)d\theta\end{vmatrix}=\int\frac{a\cos(\theta)}{(a^2- a^2\sin^2(\theta))^n}d\theta=\int\frac{a\cos(\theta)}{a^{2n}\cos^{2n}(\theta)}d\theta\\=\frac{1}{a^{2n-1}}\int\sec^{2n-1}(\theta)d\theta$$
Using the reduction formula
$$\int\sec^n(\theta)d\theta=\frac{1}{n-1}\sec^{n-2}(\theta)\tan(\theta)+\left(\frac{n-2}{n-1}\right)\int\sec^{n-2}(\theta)d\theta$$
this integral becomes
$$\frac{1}{a^{2n-1}}\left[\frac{1}{2(n-1)}\sec^{2n-3}(\theta)\tan(\theta)+\left(\frac{2n-3}{2(n-1)}\right)\int\sec^{2n-3}(\theta)d\theta\right]$$
Based on the substitution $x=a\sin(\theta)$ and $dx=a\cos(\theta)d\theta$:
$$\sec(\theta)=\frac{a}{\sqrt{a^2-x^2}}\quad\tan(\theta)=\frac{x}{\sqrt{a^2-x^2}}\quad d\theta=\frac{dx}{\sqrt{a^2-x^2}}$$
So
$$\int\frac{dx}{(a^2-x^2)^n}=\frac{1}{a^{2n-1}}\left[\frac{1}{2(n-1)}\sec^{2n-3}(\theta)\tan(\theta)+\left(\frac{2n-3}{2(n-1)}\right)\int\sec^{2n-3}(\theta)d\theta\right]\\=\frac{1}{a^{2n-1}}\bigg[\frac{1}{2(n-1)}\bigg(\frac{a}{\sqrt{a^2-x^2}}\bigg)^{2n-3}\bigg(\frac{x}{\sqrt{a^2-x^2}}\bigg)+\left(\frac{2n-3}{2(n-1)}\right)\int\bigg(\frac{a}{\sqrt{a^2-x^2}}\bigg)^{2n-3}\bigg(\frac{dx}{\sqrt{a^2-x^2}}\bigg)\bigg]\\=\frac{1}{a^{2n-1}}\bigg[\frac{a^{2n-3}x}{2(n-1)(\sqrt{a^2-x^2})^{2n-2}}+\left(\frac{2n-3}{2(n-1)}\right)\int\frac{a^{2n-3}}{(\sqrt{a^2-x^2})^{2n-2}}dx\bigg]\\=\frac{1}{a^{2n-1}}\left[\frac{a^{2n-3}x}{2(n-1)(a^2-x^2)^{n-1}}+\left(\frac{2n-3}{2(n-1)}\right)\int\frac{a^{2n-3}}{(a^2-x^2)^{n-1}}dx\right]\\=\frac{x}{2a^2(n-1)(a^2-x^2)^{n-1}}+\left(\frac{2n-3}{2a^2(n-1)}\right)\int\frac{dx}{(a^2-x^2)^{n-1}}\\=\frac{x}{2a^2(n-1)(a^2-x^2)^{n-1}}+\left(\frac{2n-3}{2a^2(n-1)}\right)I_{n-1}$$
However I also wanted to prove this using integration by parts but I seem to be stuck:
$$\int\frac{dx}{(a^2-x^2)^n}=\int\frac{x}{x(a^2-x^2)^n}dx\space\begin{vmatrix}u=\frac{1}{x}\\du=-\frac{1}{x^2}dx\end{vmatrix}dv=\frac{x}{(a^2-x^2)^n}dx\\v=\int\frac{x}{(a^2-x^2)^n}dx\begin{vmatrix}u=a^2-x^2\\du=-2xdx\end{vmatrix}v=-\frac{1}{2}\int\frac{du}{u^n}=-\frac{1}{2}\left(\frac{u^{-n+1}}{-n+1}\right)\\=-\frac{1}{2(1-n)u^{n-1}}=-\frac{1}{2(1-n)(a^2-x^2)^{n-1}}\\\int udv=uv-\int vdu\\\int\frac{dx}{(a^2-x^2)^n}=-\frac{1}{2x(1-n)(a^2-x^2)^{n-1}}-\frac{1}{2(n-1)}\int\frac{1}{x^2(a^2-x^2)^{n-1}}dx$$
Don't know how to proceed from here, any help?