# $\int \sec^3x dx$ in disguise

I found this integral, $$\int \sqrt{x^2+1}dx$$ on a problem list and I think it is a sneaky way of hiding a $\int \sec^3xdx$ problem but I am not sure if what I did was correct though, because of what happens at the end.

So what I did was use trig-substitution and let $u=\tan\theta$ and $du=\sec^2\theta d\theta$ $$\int \sqrt{x^2+1}dx=\int\sqrt{\tan^2\theta+1}\sec^2\theta d\theta=\int \sec^3\theta d\theta$$ $$= \int (\tan^2\theta+1)\sec\theta d\theta = \int \tan^2\theta \sec\theta +\int \sec\theta d\theta$$ I will label $I_s=\int \sec\theta d\theta = \ln|\sec\theta+\tan\theta|$ so I have $$\int \sec^3xdx=\int\tan^2x\sec x dx+I_s$$ and use integration by parts to solve $\int tan^2\theta \sec\theta d\theta$ that remains. I let $u=\sec\theta$ so $du=\sec\theta\tan\theta d\theta$ and $dv=\tan^2\theta\, d\theta$ such that $v=\tan\theta -\theta$ $$\int\tan^2x\sec x dx =\sec\theta (\tan\theta -\theta) - \int (\tan\theta-\theta)\sec\theta\tan\theta d\theta$$ $$= \frac 12 \sec\theta (\tan\theta -\theta) + \frac 12\int \theta \sec\theta\tan\theta \, d\theta$$ Again I use integration by parts, this time on $\frac 12\int \theta \sec\theta\tan\theta \, d\theta$ and let $u=\theta$ so $du=d\theta$ and $dv=\sec\theta\tan\theta \,d\theta$ so $v=\sec\theta$ $$\frac 12\int \theta \sec\theta\tan\theta \, d\theta = \frac 12 \theta \sec\theta - \frac 12 I_s$$ $$= \frac 12(\theta\sec\theta - I_s)$$ and use this result to get $$\int\tan^2x\sec x dx = \frac 12 \sec\theta (\tan\theta -\theta) + \frac 12(\theta\sec\theta - I_s)$$ $$= \frac 12 \sec\theta\tan\theta - \frac 12 I_s$$ Putting everything back together and including an arbitrary constant $C$ i get $$\int \sec^3\theta\,d\theta = \int \tan^2\theta\sec\theta d\theta + I_s$$ $$= \frac 12 \sec\theta\tan\theta - \frac 12 I_s + I_s + C$$ $$=\frac 12\sec\theta\tan\theta +\frac 12 \ln|\sec\theta+\tan\theta|+C$$ and substituting back into $x$-variable terms using $\tan\theta = x$ I have $\sec\theta = \sqrt{x^2+1}$ so $$\int \sqrt{x^2+1}dx =\frac 12x\sqrt{x^2+1} +\frac 12 \ln|\sqrt{x^2+1}+x|+C$$ The reason why I am not sure about this is because when substituting back I have $\sec\theta = \sqrt{x^2+1}$ which is the same as the integrand $\sqrt{x^2+1}$ that became $\sec^3\theta$ in the initial substitutions. What is going on here?

Thank you all for the precious help!

• The extra factor of ${\sec}^2\theta$ came from changing the differential so there's no issue with ${\sec}\theta=\sqrt{x^2+1}.$ – garserdt216 Mar 1 '17 at 5:41
• Congratulations on integrating $\sec^3\theta$, a challenging integral: en.wikipedia.org/wiki/Integral_of_secant_cubed The usual method obtains a result by parts of the form I_s = a + bI_s. You can generalise the method to express the integral of $\sec^{n+2}\theta$ in terms of $\sec^n\theta$. A similar treatment of hyperbolic secants is possible as well. – J.G. Mar 1 '17 at 7:49

## 2 Answers

From your trig sub $x=\tan\theta$,

\begin{align} \int \sqrt{x^2+1}dx&=\int \sec\theta(\sec^2\theta d\theta) \end{align}

That is, $\sqrt{x^2+1}=\sec\theta$ and $dx=\sec^2\theta d\theta$. The integrand only changed to $sec^3\theta$ after both of these pieces are considered.

Reassuringly, $\sqrt{x^2+1}\ne\sec^3\theta$, because $dx\ne d\theta$.

It is just how integration works, you plugged in $x=\tan\theta$ to get $\sqrt{1+x^2}$ to equal $\sec\theta$, your answer is completely correct. Just because $\sec\theta=\sqrt{x^2+1}$ does not mean that $\int\sqrt{1+x^2}dx=\int\sec\theta d\theta$ as you recognized because of the chain rule.