# Rule for differentiating tan(x)

1. Nov 19, 2011

### Splint

Hi,

I found on youtube a video showing the steps to differentiate tan(x). I can follow the steps quiet easily but I'm not sure which rule is being used when substituting u for cos(x) and du for sin(x)dx.

So which rule is being used and how do I know which is u and which is du.

Thanks

2. Nov 19, 2011

### HallsofIvy

Staff Emeritus
Since this has nothing to do with "differential equations", I am moving it to "Caclulus and Analysis".

Splint, each integral situation is different and it is hard to give very general rules for substiutions.

tan(x)= sin(x)/cos(x) so to integrate tan(x) is to differentiate sin(x)/cos(x):
$$\int\frac{sin(x)}{cos(x)} dx$$
I have, really, only a few possible substitutions: If I let u= sin(x), say, I get du= cos(x)dx but now I have a problem- the "cos(x)" in my problem is in the denominator not the numerator and so is not multiplying dx. But, in fact, I could use that substitution! Since I need "cos(x)dx", multiply both numerator and denominator by cos(x):
$$\int \frac{sin(x)}{cos(x)}\frac{cos(x)}{cos(x)}dx= \int\frac{sin(x)}{cos^2(x)}cos(x)dx$$
$$= \int\frac{sin(x)}{1- sin^2(x)}cos(x)dx= \int\frac{u}{1- u^2}du$$
which I could now do by "partial fraction".

But the "u= cos(x)" makes the problem much easier. If u= cos(x), du= -sin(x)dx so we have immediately
$$\int \frac{sin(x)}{cos(x)}dx= -\int\frac{sin(x)dx}{cos(x)}= -\int\frac{du}{u}$$

Why don't you try integrating
$$\int\frac{u}{1- u^2}du= -\frac{1}{2}\left(\int\frac{du}{u-1}+ \int\frac{1}{u+1}du\right)$$
and see if you don't get the same thing?

The fact is that much of "substitution" in integrals is "trial and error"- you try some substitution and see if it works.

Last edited: Nov 19, 2011