d/dx(tan^2(x)) is not a known differential, and therefore requires a substitution to calculate it using simpler known differentials.
Using the identity sin^2(x) + cos^2(x) = 1, the equation can be divided through by cos^2(x) to give tan^2(x) + 1 = sec^2(x). Therefore tan^2(x) = sec^2(x) - 1 = 1/cos^2(x) - 1. The differential of 1 is 0, so we only need to worry about the sec^2(x) term. Using the Quotient rule, where u=1 and v=cos^2(x), d/dx(sec^2(x)) = d/dx(1/cos^2(x)) = (0 - (-2sin(x))cos(x))/cos^4(x) = 2sinx/cos^3(x).