How to use $3\tan^2 x = -3 + 3\sec^2 x$ to integrate $3\tan^2 x$?

I am trying to integrate $3\tan^2x$ without the use of any integration tricks (eg. substitution, by parts etc..) just using indefinite integral tricks. So I understand the pythagorean identity $1+\tan^2 x =\sec^2 x$. Why would this theorem apply? I don't have $a +3$ in my expression, if it did It would make sense. Could someone help work out the algebra behind this, I am a bit stuck.

• Thank You, stackTD, I wasn't thinking clear,I forgot I could rearrange the formula.Thanks Everyone! – mushimaster Feb 24 '17 at 16:31
• Alright, you're welcome! – StackTD Feb 24 '17 at 16:33

So you mean you know that $1+\tan^2x = \sec^2x$? Then clearly also $\color{blue}{\tan^2x = \sec^2x-1}$, so: $$3\color{blue}{\tan^2x} = 3\left(\color{blue}{\sec^2x-1}\right) = 3\sec^2x-3 = -3+3\sec^2x$$ Then by linearity of the integral: $$\int 3\tan^2x \,\mbox{d}x = \int 3\sec^2x-3 \,\mbox{d}x = 3\int \sec^2x \,\mbox{d}x-\int 3 \,\mbox{d}x = \cdots$$
We can evaluate the integral using your identity. Basically, $$\int 3\tan^2 x \; \mathrm{d} x=\int 3(\sec^2 x-1) \; \mathrm{d} x=\int (3\sec^2 x-3) \; \mathrm{d} x=3\tan x-3x+C$$ From the fact that $$\frac{\mathrm{d}}{\mathrm{d}x} \tan x=\sec^2 x \iff \int \sec^2 x \;\mathrm{d}x=\tan x+C$$
• @gt6989b The OP asked how to integrate $\tan^2 x$, and how $3\tan^2 x=3 \sec^2 x-3$ was related. – S.C.B. Feb 24 '17 at 16:31