<s>[INST] Finding $\int \frac{x^2}{(a^2-x^2)^{\frac{3}{2}}}dx$ using trigonometric substitution. Where did I go wrong? Evaluate the following integral using trigonometric substitution
$$\int \frac{x^2}{(a^2-x^2)^{\frac{3}{2}}}dx$$
I used the substitution $x=a \sin(u)$, then $dx = a \cos(u) du$. The integral then becomes:
$$\int \frac{a^2 \sin^2(u) a \cos(u)}{(a^2-a^2 \cos^2(u))^{\frac{3}{2}}}du = \int \frac{a^3 \sin^2(u)  \cos(u)}{(a^2 \sin^2(u))^{\frac{3}{2}}}du =\int \frac{\cos(u)}{\sin(u)}du = \ln | \sin(u)  | + C$$
The last equality comes from the substitution $v=\sin(u)$. Now from the first substitution we have $x=a\sin(u)$ and thus $\sin(u) = \frac{x}{a}$. This gives us
$$\int \frac{x^2}{(a^2-x^2)^{\frac{3}{2}}}dx = \ln \left| \frac{x}{a}\right| + C = \ln|x| + C'$$
Where $C' = C - \ln|a|$. This however is of course not correct (unless I am missing something...). Can anyone tell me where I went wrong on this one? Thanks a lot!
 [/INST] The bottom should be $a^3\cos^3 u$, so you are essentially integrating $\tan^2 u$, that is, $\sec^2 u-1$.
</s>