Integrate $\int\tan^2x\,dx$

calculusintegration

$\int \tan^2xdx$

Here is what I tried…

$\int \tan^2xdx = \int (\sec^2x-1)dx = \int(\frac{1}{\cos^2x} -1)dx = \int \frac{1}{ \frac{1}{2} (1+\cos2x)} = \frac{2}{1} \int \frac{1}{1+\cos2x}$

$u = \cos2x, du = 2\sin2xdx$

$= 2 \bigg( \frac{1}{x + \frac{1}{2}\sin2x} \bigg) + C$

But the answer is $ \tan x – x + C$.

I think the way that I set up the problem (using half angle identity of $\cos^2x$ in the denominator started making the calculations a lot harder to follow in my opinion) was an issue and that I could have set it up better?

Best Answer

$$\int(\sec^2x-1)dx=\int\sec^2x\ dx-\int dx=?$$

Related Question