I have to integrate the following, where a is a constant:
$$I=\int \sin^3(a x)dx$$
I did the following: $$u=ax$$ $$\frac{du}{a}=dx$$
Which gets me to this point:
$$\frac{1}{a}\int(1-\cos^2(u))\sin u \ du$$
Then I did u-substitution again and got it to this point:
$$g= \cos u$$ $$-dg=\sin u\ du$$
$$I=-\frac{1}{a}\int(1-g^2)dg$$ $$I=-\frac{1}{a}[g-\frac{g^3}{3}]+C$$ $$I=\frac{1}{a}[\frac{\cos^3(ax)}{3}-\cos(ax)]+C$$
Is my answer correct?
Yes, this is correct. See here for some more general integrals like this.