Answer
$$\int (sec\,x-tan\,x)^{2}dx=2tan\,x-2sec\,x-x+C$$
Work Step by Step
$$\int (sec\,x-tan\,x)^{2}dx=\int (sec^{2}x-2sec\,x\,tan\,x+tan^{2}x)dx$$
$$=\int \left [sec^{2}x-2sec\,x\,tan\,x+(sec^{2}x-1) \right ]dx$$
$$=\int (2sec^{2}x-2sec\,x\,tan\,x-1)dx$$
$$=2tan\,x-2sec\,x-x+C$$