0

I'm going through Stewart's Calculus, and in section 7.3, example 7 asks for $\int \tan^3(x)dx$. In the book, the solution is $\frac{\tan^2(x)}{2} - \ln|\sec x| + C$. This was obtained in the following way:

$\int \tan^3(x) dx = \int (\sec^2(x) - 1)\tan(x)dx = \int \sec^2(x)\tan (x) dx - \int \tan (x) dx = \int \sec^2(x)\tan (x) - \ln|\sec(x)|+C$

Now we let $u = \tan(x)$, so $du = \sec^2(x)dx$ and we have

$\int \tan^3(x) dx = \int \sec^2(x)\tan (x) - \ln|\sec(x)| = \int u du - \ln|\sec(x)| = \frac{u^2}{2} - \ln|\sec(x)| = \frac{\tan^2(x)}{2} - \ln|\sec(x)|$

However, it seems as though there's a second method of integrating it that doesn't produce the same result. If we instead let $u = \sec(x)$ and therefore $du = \sec(x)\tan(x)dx$, we get

$\int \tan^3(x) dx = \int \sec^2(x)\tan (x) - \ln|\sec(x)| = \int \sec(x) (\sec(x)\tan(x)) = \int u du - \ln|\sec(x)| = \frac{u^2}{2} - \ln|\sec(x)| = \frac{\sec^2(x)}{2} - \ln|\sec(x)|$.

This site produces the same result as what I got: https://www.integral-calculator.com/

So is there some kind of trig identity that I'm missing here, or did I integrate incorrectly? Taking the derivative of both solutions produces the same starting point.

Sebastiano
  • 8,290

3 Answers3

1

This happened to me as well, once. They are not the same function - but their difference is constant! In fact:

$$\tan^2(x) - \sec^2(x) = \frac{\sin^2(x) - 1}{\cos^2(x)} = -1$$

1

hint

Observe that

$$\frac{\sec^2(x)}{2}+C=$$

$$\frac 12(1+\tan^2(x))+C=$$

$$\frac{\tan^2(x)}{2}+\frac 12+C=$$ $$\frac{\tan^2(x)}{2}+K$$

So, both results are the same.

1

Well: $$1+\tan^2x=\sec^2x\implies\frac{\tan^2 x}{2}=\frac{\sec^2 x}{2}-\frac12$$

Make this substitution to the answer and you get your answer.

Never forget that because $(f(x)+C)'\equiv f'(x)$, two different functions may have the same derivative, and a function may have two different integrals. Be particularly vigilant around trigonometric functions, as they often look more distinct than they are.

Rhys Hughes
  • 13,103