Hello, florx!
What you're saying is scary . . .
$\displaystyle \displaystyle \int\frac{1-\tan^2\!x}{\sec^2\!x}\,dx$
First of all: .$\displaystyle \tan^2\!x \;=\;\sec^2\!x - 1$
$\displaystyle \displaystyle\text{Substitute: }\;\frac{1 - (\sec^2\!x - 1)}{\sec^2\!x} \;=\;\frac{2-\sec^2\!x}{\sec^2\1x} \;=\; \frac{2}{\sec^2\!x} - \frac{\sec^2\!x}{\sec^2\!x}$
. . . . . . . $\displaystyle =\;2\cos^2\!x - 1 \;=\;\cos2x $ . as Liverpool suggested