<s>[INST] Trig substitution for $\sqrt{9-x^2}$ I have an integral that trig substitution could be used to simplify.
$$ \int\frac{x^3dx}{\sqrt{9-x^2}} $$
The first step is where I'm not certain I have it correct. I know that, say, $\sin \theta = \sqrt{1-cos^2 \theta}$, but is it correct in this case $3\sin \theta = \sqrt{9 - (3\cos \theta)^2}$?
Setting then $x = 3\cos \theta; dx = -3\sin \theta d\theta$
$$-\int \frac{(3\cos\theta)^3}{3\sin\theta}3\sin\theta d\theta$$
$$-27\int\cos^3\theta d\theta$$
$$-27\int(1-\sin ^2\theta)\cos \theta d\theta$$
Substituting again, $u=\sin \theta; du=\cos \theta d\theta$
$$-27\int(1-u^2)du $$
$$-27u + 9u^3 + C$$
$$-27\sin \theta + 9 \sin^3 \theta + C$$
$$-9\sqrt{9-x^2} + 3\sin\theta\cdot 3\sin\theta\cdot \sin \theta + C$$
$$-9\sqrt{9-x^2} + (\sqrt{9-x^2})^2 \cdot \frac{\sqrt{9-x^2}}{3} + C$$
$$-9\sqrt{9-x^2} + \frac{1}{3}(9-x^2)(9-x^2)^{\frac{1}{2}} + C$$
$$-9\sqrt{9-x^2} + \frac{1}{3}(9-x^2)^\frac{3}{2} + C $$
I guess I have more doubts that I've done the algebra correctly than the substitution, but in any case I'm not getting the correct answer. Have I calculated correctly? Is the answer simplified completely?
EDIT
Answer needed to be simplified further:
$$-9\sqrt{9-x^2} + \frac{1}{3}(\sqrt{9-x^2}^2 \sqrt{9-x^2}) + C$$
$$-9\sqrt{9-x^2} + \frac{1}{3}((9-x^2)\sqrt{9-x^2}) + C$$
$$\sqrt{9-x^2} \left (-9 + \frac{1}{3}(9-x^2) \right ) + C$$
$$\sqrt{9-x^2} \left (-6 - \frac{x^2}{3} \right ) + C$$
$$ \bbox[5px,border:2px solid red]
{
- \left ( 6+ \frac{x^2}{3} \right ) \sqrt{9-x^2}
}
$$ 
This is the answer the assignment was looking for.
 [/INST] Firstly, $$\sin\theta=\sqrt{1-\cos^2\theta}$$ is wrong. Try $\theta=-\frac{\pi}{2}$.
But for $\theta\in(0,\pi)$ we see that $-3<3\cos\theta<3$ and $x=3\cos\theta$ gets any value from $(-3,3)$.
Also, for these values of $\theta$ we obtain a right formula: $$\sin\theta=\sqrt{1-\cos^2\theta}.$$
Secondly, $$\cos^3\theta=\frac{1}{4}(\cos3\theta+3\cos\theta)$$ and we can evaluate the integral shorter.
</s>