Integration of $sin^2(x)$ using trig substitution Hi I'm just learning integration, so I'm sorry if this is really basic.
I know this is true: $\displaystyle \int sin^2(x)d x = \frac{1}{2} (x - sin(x)cos(x)) + C$
Because you can use Power reducing substitution http://www.youtube.com/watch?v=VRNuPqA_Vo8
But my question is why can't you use trig substitution like below?
$$\int sin^2x$$
$$= \int \frac{tan^2x}{sec^2x} $$
$$Let\;a = tan x$$
$$As sin^2(x)+cos^2(x)=1...$$
$$= \int \frac{a^2}{1+a^2}$$
$$= 1-tan^-1(a)$$
$$= 1-x$$
Please let me know where I'm assuming something incorrect.
 A: It looks like you're trying to assert that
$$\sin^2(x) = \tan^2(x)\sec^2(x)$$
in the first step. But,
$$\tan^2(x)\sec^2(x) = \frac{\sin^2(x)}{\cos^2(x)}\frac{1}{\cos^2(x)} = \frac{\sin^2(x)}{\cos^4(x)} \neq \sin^2(x).$$
EDIT: Ok, now that it is properly formatted, you are correctly asserting that
$$ \sin^2(x) = \frac{\tan^2(x)}{\sec^2(x)}. $$
However, when you do the substitution $a = \tan(x)$ you need $da = \sec^2(x)dx$. You have $\sec^2(x)$ in the denominator, rather than the numerator, so you cannot do this substitution.
A: Putting $\tan x=u,$
$\displaystyle x=\arctan u\implies dx=\frac{du}{1+u^2}$
and $\sec^2x=1+\tan^2x=1+u^2$
$$\implies\int\sin^2xdx=\int\frac{\tan^2x}{\sec^2x}dx=\int\frac{u^2}{(1+u^2)^2}du$$
A: The integral you are trying to solve is $\int tan^2(x) dx$. After your substitution you get $\int \frac{a^2}{1+a^2} dx$. You have to express $dx$ in terms of $da$ if you want to make any sense of this.
A: $$
\int\sin^{2}\left(x\right)\,{\rm d}x
=
\int{1 - \cos\left(2x\right) \over 2}\,{\rm d}x
=
{1 \over 2}\,x - {1 \over 4}\,\sin\left(2x\right) + \mbox{constant}
$$
