Does $\int \tan^3x\sec^2x \space dx$ have 2 solutions

calculusindefinite-integralsintegrationtrigonometric-integralstrigonometry

So normally, you evaluate $\int\tan^3x\sec^2x \space dx$ by substituting $u = \tan x$ and $du = \sec^2x\space dx$ right? So,
$$\begin{equation}\begin{aligned}
\int\tan^3x\sec^2x \space dx &= \int u^3 \space du \\
&= \frac{u^4}{4} + C\\
&= \frac{tan^4x}{4} + C \\
\end{aligned}\end{equation}$$

But, I tried to solve it this way instead,
$$\begin{equation}\begin{aligned}
\int\tan^3x\sec^2x \space dx &= \int\tan^2x\tan x\sec x\sec x\space dx \\
&= \int(\sec^2x-1)\tan x\sec x\sec x\space dx \\
&= \int\sec^3x\tan x\sec x-\sec x\tan x\sec x\space dx \\
&= \int\sec^3x\tan x\sec x-\sec x\tan x\sec x\space dx \\
&= \int\sec^3x\tan x\sec x\space dx – \int\sec x\tan x\sec x\space dx \\
\end{aligned}\end{equation}$$

and then substituting $u = \sec x$, thus $du = \tan x\sec x\space dx$. So,
$$\begin{equation}\begin{aligned}
\int\sec^3x\tan x\sec x\space dx – \int\sec x\tan x\sec x\space dx &= \int u^3 du – \int u\space du\\
&= \frac{u^4}{4} – \frac{u^2}{2} + C \\
&= \frac{\sec^4x}{4} – \frac{\sec^2x}{2} + C \\
\end{aligned}\end{equation}$$

What?! Can someone explain to me where I made the mistake?

Best Answer

There's no mistake. Both methods resulted in the same solution, up to a constant of integration. Indeed, notice that:

\begin{align*} \frac{1}{4}\tan^4 x + C &= \frac{1}{4}(\tan^2 x)^2 + C \\ &= \frac{1}{4}(\sec^2 x - 1)^2 + C \\ &= \frac{1}{4}(\sec^4 x - 2\sec^2 x + 1) + C \\ &= \frac{1}{4}\sec^4 x - \frac{1}{2}\sec^2 x + \frac{1}{4} + C \\ &= \frac{1}{4}\sec^4 x - \frac{1}{2}\sec^2 x + D \\ \end{align*}

where $D = \frac{1}{4} + C$ is an arbitrary constant of integration.

Related Question