The quotient rule is:
(d(u/v))/dx = (u'v - uv')/v^2
In this case, u = x^2+x^2tan^2(x) and v = sec^2(x), then
u' = 2x + 2xtan^2(x)+ 2x^2tan(x)sec^2(x) and v' = 2tan(x)sec^2(x)
Substituting these values into the quotient rule:
(d((x^2+x^2tan^2(x))/sec^2(x)))/dx = ((2x + 2xtan^2(x)+ 2x^2tan(x)sec^2(x))sec^2(x) - (x^2+x^2tan^2(x))(2tan(x)sec^2(x)))/sec^4(x)
A common factor of sec^2(x)/sec^2(x) becomes 1:
(d((x^2+x^2tan^2(x))/sec^2(x)))/dx = ((2x + 2xtan^2(x)+ 2x^2tan(x)sec^2(x))- (x^2+x^2tan^2(x))(2tan(x)))/sec^2(x)
The term - (x^2+x^2tan^2(x))(2tan(x)) can be written as -2x^2tan(x)sec^2(x)):
(d((x^2+x^2tan^2(x))/sec^2(x)))/dx = ((2x + 2xtan^2(x)+ 2x^2tan(x)sec^2(x)) -2x^2tan(x)sec^2(x))/sec^2(x)
The last two terms in the numerator sum to 0:
(d((x^2+x^2tan^2(x))/sec^2(x)))/dx = (2x + 2xtan^2(x))/sec^2(x)
Use the identity 1+ tan^2(x) = sec^2(x):
(d((x^2+x^2tan^2(x))/sec^2(x)))/dx = 2x sec^2(x)/sec^2(x)
sec^2(x)/sec^2(x) becomes 1:
(d((x^2+x^2tan^2(x))/sec^2(x)))/dx = 2x
It would have been better to avoid using the quotient rule by making the substitution, 1+ tan^2(x) = sec^2(x), at the start:
(x^2+x^2tan^2(x))/sec^2(x) = x^2sec^2(x)/sec^2(x) = x^2
(d(x^2))/dx = 2x