# Arriving to the integral of $\sec(x)$ [duplicate]

So I was looking at how to obtain the following integral $$\int \sec(x)\,\mathrm dx$$ I saw that, to solve it, they divided and multiplied by $\tan(x)sec(x)/tan(x)sec(x)$. I understand that this is the equivalent to multiplying by $1$ and that they can do this. However, I would like to understand the logic behind why they are multiplying by this instead of some other trig ratio? Also is there any other way to solve this integral? I looked around but the only result I could find was multiplying and dividing by $\tan(x)sec(x)/tan(x)sec(x)$

## marked as duplicate by grand_chat, N. F. Taussig, Nosrati, Jyrki Lahtonen, Adrian KeisterSep 21 '18 at 0:08

• the logic behind it is finding it's antiderivative. – Nosrati Sep 20 '18 at 15:57
• it is $\sect+\tan t$. – Nosrati Sep 20 '18 at 15:58
• Using en.m.wikipedia.org/wiki/… will be more natural way – lab bhattacharjee Sep 20 '18 at 16:00
• So they just plugged and chugged until they arrived to the antiderivative, or? @Nosrati – M.M Sep 20 '18 at 16:00
• Notice that the integrand is $\dfrac{\sec x \tan x + \sec^{2}x }{\sec x+ \tan x }$ so that you can pull it to a logarithmic form. – Narasimham Sep 20 '18 at 22:16

Yes, there are ways other than multiplying by $\dfrac{\sec x+\tan x}{\sec x+\tan x}$.
For example, you could use the Weierstrass $t$-substitution \begin{align*} \tan\frac{x}{2}&=t\\ \cos x&=\frac{1-t^2}{1+t^2}\\ \sin x&=\frac{2t}{1+t^2}\\ \mathrm{d}x&=\frac{2\,\mathrm{d}t}{1+t^2} \end{align*} which convert a rational function of trigonometric functions of $x$ to a rational function of $t$, from which there are standard procedure you can follow to find its antiderivative (partial fractions and the worst case involves integrating $\dfrac{a+bu}{(1+u^2)^m}$). So $$\int\sec x\,\mathrm{d}x=\int\frac{1+t^2}{1-t^2}\,\frac{2\mathrm{d}t}{1+t^2}=\int\left(\frac1{t-1}-\frac1{t+1}\right)\,\mathrm{d}t$$ which you can integrate immediately.