I have to take the indefinite integral of the following function: $$\int_\limits{0}^{\frac{\pi}{2}}\sin^2(\frac{1}{3}\theta)d\theta$$
I did a double substitution, my first was:
$$3\int_\limits{0}^\frac{\pi}{6}\sin^2(u)du$$
And then I substituted one more time getting:
$$-3\int_\limits{0}^\frac{\sqrt{3}}{2}\sqrt{1-g^2}dg$$
From there I continued into:
$$I=3\int_\limits{\frac{\sqrt{3}}{2}}^0\sqrt{1-g^2}dg$$
$$I=3[\sqrt{1-g^2}\vert_\frac{\sqrt{3}{2}}{2}^0-\int_\frac{\sqrt{3}}{2}^0\frac{-g^2}{\sqrt{1-g^2}}dg$$
$$I=3g\sqrt{1-g^2}\vert_\frac{\sqrt{3}{2}}{2}^{0}-3I+3\int_\limits{\frac{\sqrt{3}}{2}}^0\frac{1}{\sqrt{1-g^2}}dg$$
$$4I=3g\sqrt{1-g^2}+\arcsin(g)\vert_\frac{\sqrt{3}}{2}^0$$
$$I=\frac{1}{4}[3\cos(u)\sin(u)-u]_\frac{\pi}{6}^0$$
I am trying to get the right indefinite integral before I indefinite integrate, and Wolfram alpha says I am wrong with my answer.
I am not sure what your second substitution is.
But no substitutions are necessary.
$\int_0^{\frac {\pi}{2}} \sin^2 \frac 13 \theta \ d\theta\\ \int_0^{\frac {\pi}{2}} \frac 12 ( 1 - \cos \frac 23 \theta) \ d\theta\\ \frac 12 \theta - \frac 32\sin \frac 23\theta|_0^{\frac {\pi}{2}}\\ \frac{\pi}{4} - \frac 32 \sin \frac {\pi}{3}\\ \frac{\pi}{4} - \frac {3\sqrt 3}{4}$