My HW asks me to integrate $\sin(x)$, $\cos(x)$, $\tan(x)$, but when I get to $\sec(x)$, I'm stuck.


Hint: I'm assuming you know the derivatives of $\sec(x)$ and $\tan(x)$.

Since $\frac d{dx}\tan(x)=\sec^2(x)$ and $\frac d{dx}\sec(x)=\sec(x)\tan(x)$,

therefore $\frac d{dx}[\tan(x)+\sec(x)]=\sec(x)[\tan(x)+\sec(x)]$

Note that here: $\sec(x)=\dfrac{\frac d{dx}[\tan(x)+\sec(x)]}{\tan(x)+\sec(x)}$

Now let $u=\tan(x)+\sec(x)$, you get $\sec(x)=\dfrac{du}u$, then you integrate both sides:

\begin{align*}\therefore \int\sec(x)\ dx&=\int\frac{du}u\\\\&=\ln|u|+C\\\\&=\ln|\tan(x)+\sec(x)|+C\end{align*}


$$\int \frac{1}{\cos x} dx =\int \frac{\cos x}{\cos^2 x} dx =\int \frac{d(\sin x)}{1-\sin^2 x}$$ $$=\frac {1}{2}\int (\frac {1}{1-\sin x}+\frac {1}{1+\sin x}) d(\sin x) =\frac {1}{2}\int \frac {d(\sin x)}{1-\sin x}+\frac {1}{2}\int \frac {d(\sin x)}{1+\sin x} $$ $$= -\frac {1}{2}\ln |1-\sin x|+\frac {1}{2}\ln |1+\sin x|+C$$ $$=\frac {1}{2}\ln|\frac {1+\sin x}{1-\sin x}|+C=\frac {1}{2}\ln|\frac {(1+\sin x)^2}{\cos^2 x}|+C$$ $$=\ln|\sec x+\tan x|+C$$ Hope it can help you