We can use the color(blue)"double angle identity for cos(2x)"double angle identity for cos(2x) as well as the color(green)"ratio identity for tan x"ratio identity for tan x.
Explanation:
tan^2 x (1+color(blue)(cos 2x))= tan^2 x (cancel 1 + color(blue)(2cos^2 x - cancel 1)) color(white)(tan^2 x (1+cos 2x))= tan^2 x (2 cos^2 x) color(white)(tan^2 x (1+cos 2x))= 2color(green)(tan^2 x) cos^2 x color(white)(tan^2 x (1+cos 2x))= 2color(green)((sin^2 x / cancel(cos^2 x))) cancel(cos^2 x) color(white)(tan^2 x (1+cos 2x))= 2 sin^2 x