# Evaluating $\int\sec x \,\mathrm dx$ [duplicate]

$$\int\sec x \,\mathrm dx = \ln\left|\sec{x} + \tan{x}\right|+ C = \ln{\left|\tan\left(\frac{x}{2} + \frac{\pi}{4}\right)\right|} + C$$

My question is how? How are these derived?

It is well-known that

$$\int \csc x dx = \ln \tan \frac x 2.$$ Shifting the integration variable by $\pi/2$ gives, using the fact that $\sin(x+\pi/2) = \cos x$,

$$\int \sec x dx= \ln \tan \left({\frac x 2 + \frac \pi 4 }\right).$$

To prove the first integral, write $$\csc x = \frac{1}{2 \sin(x/2) \cos(x/2) } = \frac 1 2 \left[\cot \frac x 2 + \tan \frac x 2 \right].$$

• Thank you :) Its helping.. – user196429 Dec 8 '14 at 7:16

You can rewrite your integrand in the form $$\frac{\cos(x)}{\cos(x)^2}\,.$$ Setting $t=\sin(x)$ gives us $$\int\frac{1}{1-t^2}dt\,.$$

• Thank you for the answer :) – user196429 Dec 8 '14 at 7:16

For most people, they were derived by someone else, or a textbook, telling them.
To check that they work, differentiate them.
$$\frac d{dx}\ln(\sec x+\tan x)=\frac{\sec x\tan x+\sec^2x}{\sec x+\tan x}$$

• Thank you for the answer:) – user196429 Dec 8 '14 at 7:17