[Math] Integral of tan(x)

chain rulederivativesintegrationtrigonometric-integrals

So I wanted to find a way to work out any trigonometric integral by simply knowing the integral of the two main trigonometric functions; $\sin(x)$ and $\cos(x)$. This is since any trigonometric function (that I know of so far) can be written with the basic $\sin(x)$ and $\cos(x)$, like all of the $\tan(x)$, $\cot(x)$, $\sec(x)$, $\mathrm{cosec}(x)$, etc. Even more complicated ones like $sec^3(x)$ or whatever.

So I know that :

  • $\displaystyle\int \sin(x) = -\cos(x)$
  • $\displaystyle\int \cos(x) = \sin(x)$

But to use these two functions to calculate the integral of any other function I'd need to understand how multiplications work in integrals.

I recall from derivation that the "product rule" goes as follows :

$$y = u\cdot v \implies \frac{\mathrm{d}y}{\mathrm{d}x} = v\cdot\frac{\mathrm{d}u}{\mathrm{d}x} + u\cdot\frac{\mathrm{d}v}{\mathrm{d}x} $$

And I found the formula for the equivalent "product rule" for integration, it goes as follows :
$$\int \left(u\cdot\frac{\mathrm{d}v}{\mathrm{d}x}\right)\mathrm{d}x = u\cdot v – \int \left(v\cdot\frac{\mathrm{d}u}{\mathrm{d}x}\right)\mathrm{d}x + c$$

which is not quite as simple as in derivation, but I went along with it. So I decided to try it with the most simple trigonometric function I could think of (other than $\sin(x)$ and $\cos(x)$). I tried it with $\tan(x)$. I always liked using the product rule in differentiation with negative powers rather than the quotient rule because the product rule works just as well and it's just one less formula to remember. So I tried to use this rule for the negative power given to $\cos(x)$ when expanding the $\tan(x)$ to $\dfrac{\sin(x)}{\cos(x)}$.

I guess my question is simply where have I gone wrong in my working out. Here it is :

$$\begin{align*}
\int \tan(x)\,\mathrm{d}x &= \int \frac{\sin(x)}{\cos(x)}\,\mathrm{d}x \\
&= \int \sin(x)\cdot\cos^{-1}(x)\,\mathrm{d}x \\
&= \int \left(u\cdot\frac{\mathrm{d}v}{\mathrm{d}x}\right)\mathrm{d}x
\end{align*}$$

Then to write it in the form of $\displaystyle\int\left(u\cdot\dfrac{\mathrm{d}v}{\mathrm{d}v}\right)\,\mathrm{d}x$, I took $\sin(x)$ to be the $\dfrac{\mathrm{d}v}{\mathrm{d}x}$ term, and $\cos^{-1}(x)$ to be the $u$ term, i.e., :

  • $\dfrac{\mathrm{d}v}{\mathrm{d}x} = \sin(x)$, and
  • $u = \cos^{-1}(x)$

So what I need to find out the solution is $u$, $v$, $\dfrac{\mathrm{d}u}{\mathrm{d}x}$ as given in the form:
$$u\cdot v – \int \left(v\cdot\frac{\mathrm{d}u}{\mathrm{d}x}\right)\mathrm{d}x + c$$

So…

  • $u = \cos^{-1}(x)$, and
  • $v = \displaystyle\int\sin(x)\,\mathrm{d}x = -\cos(x)$

To work out $\dfrac{\mathrm{d}u}{\mathrm{d}x}$, I used the derivative chain rule:

  • $u = \cos^{-1}(x)$
  • $a = \cos(x)$
  • $\dfrac{\mathrm{d}u}{\mathrm{d}x} = \dfrac{\mathrm{d}u}{\mathrm{d}a}\cdot\dfrac{\mathrm{d}a}{\mathrm{d}x}$
  • $\dfrac{\mathrm{d}u}{\mathrm{d}a} = -a^{-2} = -\cos^{-2}(x)$
  • $\dfrac{\mathrm{d}a}{\mathrm{d}x} = -\sin(x)$

Therefore …
$$\dfrac{\mathrm{d}u}{\mathrm{d}x} = \dfrac{\mathrm{d}u}{\mathrm{d}a}\cdot\dfrac{\mathrm{d}a}{\mathrm{d}x} = (-\cos^{-2}(x))\cdot(-\sin(x)) = \cos^{-2}(x)\cdot\sin(x)$$

So the solution (according to the integral product rule formula) is :
$$\begin{align*}
u\cdot v – \int \left(v\cdot\frac{\mathrm{d}u}{\mathrm{d}x}\right)\mathrm{d}x + c &= \cos^{-1}(x)\cdot(-\cos(x)) – \int (-\cos(x))\cdot(\cos^{-2}(x)\cdot\sin(x))\mathrm{d}x + c \\
&= -1 – \int (-\sin(x))\cdot\cos^{-1}(x)\,\mathrm{d}x + c \\
&= \int\sin(x)\cdot\cos^{-1}(x)\,\mathrm{d}x + c \\
&= \int \frac{\sin(x)}{\cos(x)}\,\mathrm{d}x + c = \int\tan(x)\,\mathrm{d}x + c
\end{align*}$$

So my final conclusion is that :
$$\int\tan(x)\,\mathrm{d}x = \int\tan(x)\,\mathrm{d}x + c$$

Which isn't very useful for me. Where have I gone wrong and is there a better integral product rule?

Also, in the line :
$$u\cdot v – \int\left(v\cdot\frac{\mathrm{d}u}{\mathrm{d}x}\right)\mathrm{d}x + c$$

If neither $v$ nor $\dfrac{\mathrm{d}u}{\mathrm{d}x}$ form a constant, then you're simply left with another two functions in an integration that need to be multiplied together, which brings us back to the first problem, how do you multiply two functions in an integration?

Best Answer

write $$\int\tan(x)dx=-\int\frac{-\sin(x)}{\cos(x)}dx$$ and note that $$(\cos(x))'=-\sin(x)$$ this integral is from the form $$\int\frac{f'(x)}{f(x)}dx$$

Related Question