The easiest way to integrate $\tan(x)$ is to recall that $$ \tan(x) = \frac{\sin(x)}{\cos(x)}\,, $$ so $$ ∫ \tan(x)\,dx = ∫ \frac{\sin(x)}{\cos(x)}\,dx\,. $$ Do you see the necessary substitution? By choosing $u = \cos(x)$, that is, “$du = -\sin(x)\,dx$” (in quotation marks because this expression does not make sense mathematically, but it does work formally), we get $$ ∫ \frac{\sin(x)}{\cos(x)}\,dx = ∫ -\frac{1}{u}\,du = -\log(u)+c = -\log(\cos(x))+c $$
Tip: See my list of the
Most Common Mistakes in English. It will teach you how to avoid mistakes with commas, prepositions, irregular verbs, and much more.
By the way, I have written several educational ebooks. If you get a copy, you can learn new things and support this website at the same time—why don’t you check them out?
I will send you one of my ebooks for free as a little gift.