Unable to integrate $\int \sin^2(t)$ by substitution. I guess I either must be doing a stupid mistake or (more likely) I still don't really understand what's behind integration by substiution.
So I am trying to integrate $\int \sin^2(t) \mathrm{d}t$. I am mostly wondering about what I am doing wrong and less about what the correct solution would be.
So I start out with $u=\sin^2(t)$. The differentiation rules yield $\mathrm{d}u/\mathrm{d}t = 2\sin(t)\cos(t)$. So it's $\mathrm{d}t=\frac{\mathrm{d}u}{2\sin(t)\cos(t)}$.
But if I try substitution with this right now I get a wrong result (I verified with Mathematica that it's wrong):
$\int \sin^2(t) \mathrm{d}t = \int \frac{u \mathrm{d}u}{2\sin(t)\cos(t)} = \frac{u^2}{4 \sin(t)\cos(t)} = \frac{\sin(t)^4}{4 \sin(t)\cos(t)} = \frac{\sin(t)^3}{4 \cos(t)}$. 
What have I done wrong? Can I only integrate by substitution if there remains no variable in $\mathrm{d}u/\mathrm{d}t$? Or is there another criteria?
 A: HINT
Use the following trig identity: 
$$\sin^2(t) = \frac{1}{2}(1 - \cos(2t))$$
Remarks
The reason why you are having difficulty with substitution is mostly because $u$-substitution is not suited for this problem. $u$-substitution is used to replace a difficult integral with a much easier one. For instance, the following integral looks "difficult"
$$\int 18x^2 (6x^3 +  5)^{\frac{1}{4}} \mathrm{dx}$$
until you realize you can substitute $u = 6x^3 + 5$ and the problem now becomes much easier to solve. In your case, when you do any kind of substitution you get a much more complex integral. Furthermore, when you use substitution you to have make sure the entire integral is made in terms of your substitution variable. 
For instance you have: 
$$\int \sin^2(t) \mathrm{d}t = \int \frac{u \mathrm{d}u}{2\sin(t)\cos(t)} = \frac{u^2}{4 \sin(t)\cos(t)} = \frac{\sin(t)^4}{4 \sin(t)\cos(t)} = \frac{\sin(t)^3}{4 \cos(t)}$$
If the substitution was done correctly then your entire right side would be in terms of $u$.
As a general rule of thumb, if you use $u$-substitution and get a much more complex integral than the one you started with then the technique is most likely not suitable. Furthermore, you have to make sure that the resulting integral is only in terms of your substitution variable.
A: By partial integration rule:
$$\int \sin(x)^2 dx = \int \sin(x) \sin(x) dx = -\cos(x)\sin(x) + \int \cos(x)^2 dx = -\cos(x)\sin(x) + \int (1-\sin(x)^2)dx = -\cos(x)\sin(x) + x - \int \sin(x)^2dx$$
It follows:
$$2\int \sin(x)^2dx= -\cos(x)\sin(x) + x \Leftrightarrow\\
\int \sin(x)^2dx = \frac{-\cos(x)\sin(x)+x}{2}$$
This way of calculating an integral works for many trigonometric integrals, so it's worth remembering.
