Trouble integrating $\sec x$

219 Views Asked by At

I have to evaluate the integral of the $\sec x$ function and I do it as follows $$\int\sec xdx=\int\frac{dx}{\cos x}=\int\frac{\cos^2 x+\sin^2 x}{\cos x}dx=\sin x+\int\frac{\sin^2x}{\cos x}dx$$ Now we make a change of variables $\cos x=t$ so our integral becomes $$\sin x-\int\frac{\sqrt{1-t^2}}{t}dt$$ Now we make another change of variable $\sqrt{1-t^2}=z$ so our integral becomes $$\sin x-\int\frac{z^2-1+1}{z^2-1}dz=\sin x-\int\left(1+\frac{1}{z^2-1}\right)dz=$$ $$=\sin x-\sqrt{1-\cos^2x}+\frac12\ln\left|\frac{1+\sqrt{1-\cos^2x}{}}{1-\sqrt{1-\cos^2x}}\right|+C=\frac12\ln|\tan^2x+\sec^2x|+C$$ The calculator however evaluates this integral as $$\ln|\tan x+\sec x|+C$$ but I can't figure out where I made a mistake in my calculations.

3

There are 3 best solutions below

0
On BEST ANSWER

The fast way:

$$\int\frac{dx}{\cos x}=\int\frac{\cos x\,dx}{\cos^2x}=\int\frac{\sin'x\,dx}{1-\sin^2x}=\text{artanh}(\sin x).$$

1
On

Hint: Use the trick \begin{align} \sec x= \frac{\sec x+\tan x}{\sec x+\tan x} \sec x. \end{align} then $u$-sub.

0
On

Just another approach: $\frac{1}{\cos x}=\frac{\cos x}{\cos^ {2x}}=\frac{\cos x}{1-\sin^{2x}}$.And performing a substitution $cosx=t$ in $\int\frac{{\cos}xdx}{1-\sin^{2x}}$ results in a doable integral.