Mill said:
Integral of tan x . sec^2 x dx
= Integral of tan x . d(tanx)
= 1/2 . tan^2x + c
The way I would do that question is similar (but apparently not the same) to yours. I think "Mountain.Dew" might have mentioned it above. I personally call it a "reverse chain rule" method. If a function of x (raised to any power) is multiplied by its derivative, then the integral can be found quite quickly without the need for substitution:
Notice how sec²x is the derivative of tan x, and tan x is to the power of 1, therefore the integral must be tan x to the power of 2. Also, note that:
d/dx (tan²x) = 2(tan x)(sec²x)
Now that result is double of what we want to inegrate so we halve it, hence:
∫(tan x. sec²x)dx = (1/2)∫2(tan x)(sec²x)dx
[i.e. (1/2)∫2(tan x)(sec²x)dx = (1/2)∫2(tan x)(d/dx [tan x]) dx]
.: ∫(tan x. sec²x)dx = (tan²x)/2 + c
Similarly in the case of ∫(tan²x. sec²x)dx
Note that sec²x is the derivative of tan x, and tan x is to the power of 2, therefore the integral must be tan x to the power of 2. Also note that:
d/dx (tan³x) = 3(tan x)²(sec²x)
Now that result is triple of what we want to inegrate so we take a third of it, hence:
∫(tan²x. sec²x)dx = (1/3) ∫3(tan²x)(sec²x)dx
[i.e. (1/3)∫3(tan²x)(sec²x)dx = (1/3)∫3(tan x)²(d/dx [tan x]) dx]
∫(tan²x. sec²x)dx = (tan³x)/3 + c
This is simply observing the the chain rule in reverse and is a mostly a mental method with little working involved. It only works if a function of x raised to any power is multiplied by its derivative.
I'm pretty sure lots of people here use this method, but I think most resort to substitution for this kind of question.