Rhs has tan x terms so in LHS connvert sec^2x to tan ^2 x + 1
(sec^2 x - 6 tan x + 7) = (tan ^2 x+ 1 - 6 tan x + 7) = tan ^2 x - 6 tan x + 8 = (tan x -4)(tan x-2)
sec^2 x- 5 = 1+ tan ^2 x - 5 = tan ^2 x- 4 = (tan x +2)(tan x-2)
by deviding we get the result
(sec^2 x - 6 tan x + 7) = (tan ^2 x+ 1 - 6 tan x + 7) = tan ^2 x - 6 tan x + 8 = (tan x -4)(tan x-2)
sec^2 x- 5 = 1+ tan ^2 x - 5 = tan ^2 x- 4 = (tan x +2)(tan x-2)
by deviding we get the result