# sin^2 A + cos^2 A = 1 #
Divide by # cos^2 A #:
# tan^2 A + 1 = sec^2 A #
# (tan x + sec x - 1)/(tan x - sec x + 1) #
# = (tan x + sec x - 1)^2/((tan x + sec x - 1)(tan x - sec x + 1) #
# = (tan^2 x + 2tan x(sec x - 1) + (sec x - 1)^2)/(tan^2 x - (sec x - 1)^2 #
# = (tan^2 x + 2tan x(sec x - 1) + (sec^2 x - 2sec x + 1))/(tan^2 x - (sec^2 x -2sec x + 1)) #
# = (2tan x(sec x - 1) + 2sec x(sec x - 1))/(2(sec x - 1)) #
# = tan x + sec x #