integration by parts from Apostol I working through Apostol's calculus, and I need to prove integrating by parts that :
$\int (a^2 - x^2)^n \,dx = \frac{x  (a^2 - x^2)^n}{2n + 1} + \frac{2 a^2 n}{2n+1} \int (a^2 - x^2)^{n-1} \,dx + C $
Now, using the integration by parts formula after first division the integral to parts I arrive at:
$\int (a^2 - x^2)^n \,dx = x(a^2 - x^2)^n + 2n \int x^2 (a^2 - x^2)^{n-1} \,dx $
I could substitute and solve the integral, but I need to do something else. I multiply the first expression on the right by $ \frac{2n + 1}{2n +1}$ which leads to:
$x(a^2 - x^2)^n + 2n \int (a^2 - x^2)^{n-1} \,dx = \frac{x  (a^2 - x^2)^n}{2n + 1} +  \frac{2nx  (a^2 - x^2)^n}{2n + 1} + 2n\int x^2(a^2 - x^2)^{n-1} \,dx$
and I am somewhat close. If I try something else, I end up even closer:
$\int (a^2 - x^2)^n \,dx = \begin{pmatrix}
f(x)= a^2 - x^2 | f'(x)=-2x\\
g'(x)=(a^2-x^2)^{n-1} |g(x)=\int(a^2-x^2)^{n-1} \,dx
\end{pmatrix} = $
$(a^2-x^2)\int(a^2-x^2)^{n-1} \,dx + 2\int x \Big(\int(a^2-x^2)^{n-1} \,dx \Big)\,dx
=$
$(a^2-x^2)\int(a^2-x^2)^{n-1} \,dx +x^2\int(a^2-x^2)^{n-1} \,dx = a^2\int(a^2-x^2)^{n-1} \,dx $
But I think I made a mistake somewhere... could somebody help me out? I'm really stuck!
Thanks!

NOTE: You can only pull the constant part out of an integral, but not your variable:


*

*This is good: $\int 3x^3 dx = 3 \int x^3 dx$

*This is BAD: $\int 3x^3 dx = \color{red}x \int 3x^2 dx$


So far, so good:
$\int (a^2 - x^2)^n \,dx = x(a^2 - x^2)^n + 2n \int \color{red}{x^2} (a^2 - x^2)^{n-1} \,dx$
The red part $x^2$ is correct, but should be manipulated somehow to make it disappear. Since it does not show up on the RHS of the original equation.
HINT
$\begin{align} \int (a^2 - x^2)^n \,dx &= x(a^2 - x^2)^n + 2n \int \color{red}{x^2} (a^2 - x^2)^{n-1} \,dx \\
&= x(a^2 - x^2)^n + 2n \int \color{red}{(x^2 - a^2 + a^2)} (a^2 - x^2)^{n-1} \,dx\\
&= x(a^2 - x^2)^n + 2na^2 \int (a^2 - x^2)^{n - 1} +  2n \int (x^2 - a^2) (a^2 - x^2)^{n-1} \,dx \\
&= x(a^2 - x^2)^n + 2na^2 \int (a^2 - x^2)^{n - 1} - 2n \int (a^2 - x^2)^{n} \,dx
\end{align}$
It should be straight forward from here. :)
