Answer
$$2 \sec x+2 \tan x-x+C$$
Work Step by Step
\begin{aligned} \int(\sec x+\tan x)^{2} d x &=\int \sec ^{2} x+2 \sec x \tan x+\tan ^{2} x d x \\ &=\int \sec ^{2} x d x+2 \int \sec x \tan x d x+\int \tan ^{2} x d x \\ &=\int \sec ^{2} x d x+2 \int \sec x \tan x d x+\int\left(\sec ^{2} x-1\right) d x \\ & =2 \sec x+2 \tan x-x+C \end{aligned}