How to integrate $$\int \sqrt{\sec^{2}x}dx$$ ? Let me first show my approach. My approach is $$\int \sqrt{\sec^{2}x}dx$$=$$\int \sqrt{\frac{1}{\cos^{2}x}}dx$$=$$\int \sqrt{\frac{2}{2(\cos^{2}x)}}dx$$ = $$\int \sqrt{\frac{2}{1+\cos(2x)}}dx$$ = $$\int\sqrt{\frac{2(1-\cos(2x))}{(1+\cos(2x))(1-\cos(2x))}}dx$$ = $$\int \sqrt{\frac{2(1-\cos(2x))}{1-\cos^{2}(2x)}}dx$$ = $$\int \sqrt{\frac{2(1-\cos(2x))}{\sin^{2}(2x)}}dx$$ = $$\int \sqrt{2cosec^{2}(2x)-2cosec(2x)\cot(2x)}dx$$. But after this step I can't proceed further. Also I searched the solution of this integral in Wolfram Alpha but haven't understood their way of solution. They have considered $$\int \sqrt{\sec^{2}(x)}dx=\int \sec(x)dx$$. But I haven't understood why they have considered $\sqrt{\sec^{2}x}=\sec(x)$. Because $\sqrt{\sec^{2}(x)}=\sec(x)$ only when $\sec(x)>0$. But we know that the range of $\sec(x)$ is $(-\infty,-1]\cup[1,\infty)$ and $\sec(x)>0$ implies $\sec(x)\in(0,1]\cup[1,\infty)$. So, I don't think that we can consider$\sqrt{\sec^{2}x}=\sec(x)$. So, please help me out with this integral.
How to integrate $\int \sqrt{\sec^{2}x}dx$?
479 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 5 best solutions below
On
There is a very standard trick to evaluate the integral of the $\sec$ function.
Suppose that $\sec(x) > 0$. Then we may deduce that: \begin{align*} \int\sqrt{\sec^{2}(x)}\mathrm{d}x & = \int\sec(x)\mathrm{d}x\\\\ & = \int\frac{\mathrm{d}x}{\cos(x)}\\\\ & = \int\frac{\cos(x)}{\cos^{2}(x)}\mathrm{d}x\\\\ & = \int\frac{\cos(x)}{1 - \sin^{2}(x)}\mathrm{d}x\\\\ & = \int\frac{\mathrm{d}(\sin(x))}{1 - \sin^{2}(x)} \end{align*}
where you can apply the substitution $u = \sin(x)$.
Hopefully this helps!
On
The point of indefinite integrals has usually been to evaluate definite integrals, and if that's the case here, we can very clearly see that someone cannot ask you a definite integral where the limits are such that $\sec x$ changes sign because the only way it does change sign is by going from $\infty \rightarrow - \infty$ or vice versa. While you may argue that due to symmetry, we can calculate area under graph for the given limits (like from $\frac{\pi}{4} \rightarrow \frac{3\pi}{4}$ can be said to be zero), but the integral will become undefined/indeterminate (you can check in any good calculator like Wolfram or Desmos)
If you have no limits, then we have no other options but to split the integral into two cases (only two cases : one where sec x is negative over the whole interval of integration and one where it is positive over the whole interval of integration because we have established that sec x cannot change sign in or at the boundary of the the interval). When sec x is positive, the integral is simply $ln (|\sec x + \tan x|)$. But when sec x is negative, $\sqrt{\sec^2 x} = - \sec x$ and integrate like before to get -$ln (|\sec x + \tan x|)$. This is indeed correct and rather Wolfram did return a single (closed form) answer when I checked
On
$\int \sqrt{\sec^{2}x}dx$
Solution: $$\int \sqrt{\sec^{2}x}dx{=\int \frac{\sqrt{\sec^{2}x}\cdot\sec x}{\sec x}dx\\=\frac{\sqrt{\sec^{2}x}}{\sec x}\int \sec x dx-\int\left[\frac{d}{dx} \left(\frac{\sqrt{\sec^{2}x}}{\sec x}\right)\int \sec x dx\right]+c\quad (IBP)\\ =\frac{\sqrt{\sec^{2}x}}{\sec x}\int \sec x dx+c \quad \left[\because \frac{d}{dx} \left(\frac{\sqrt{\sec^{2}x}}{\sec x}\right)=0\right]\\ =\frac{\sqrt{\sec^{2}x}}{\sec x}\ln|\sec x +\tan x|+c}$$
for more generalization see here.
On
To put all of the claims in the answers into perspective, here is the graph of $y = \sqrt{\sec^2(x)}$ if we consider only real $x$:
The domain of the function consists of an infinite number of disconnected pieces. Within each piece, which is an open interval from $-\frac\pi2 + n\pi$ to $\frac\pi2 + n\pi$ for some integer $n$, the function $f(x) = \sqrt{\sec^2(x)}$ is continuous and integrable.
Any formula for the integral should result in a function something like the function added to the graph below, in addition to $y = \sqrt{\sec^2(x)}$ (which is shown for reference).
That is, the integral consists of disconnected branches, each of which approaches $-\infty$ as $x$ goes to $-\frac\pi2 + n\pi$ and approaches $\infty$ as $x$ goes to $\frac\pi2 + n\pi$ for whichever integer $n$ applies to that branch. Moreover, every branch has its own constant of integration, but there is no way to make two of these branches into one continuous function.
You may notice that the branches of the integral on intervals where $\sec(x)$ is positive are identical to the integral of $\sec(x)$, whereas branches on intervals where $\sec(x)$ is negative are identical to the integral of $-\sec(x)$, which is a simple consequence of the fact that $\sqrt{\sec^2(x)}$ is equal to either $\sec(x)$ or $-\sec(x)$ depending on which connected part of the domain of $\sec(x)$ we find $x$ in.
A general formula for the integral is $$ \int \sqrt{\sec^2(x)}\,\mathrm dx = \operatorname{sgn}(\sec(x)) \log(\lvert\tan(x)+\sec(x)\rvert) + C_n, $$ where $C_n$ is a constant of integration defined separately for each interval $\left(-\frac\pi2 + n\pi, \frac\pi2 + n\pi\right)$. This is a simple consequence of the fact that the function we are integrating is just like the secant function except that the sign of the function value is reversed on some of the intervals.


$$\int{\sec\left(x\right)\,\operatorname{sgn}\left(\sec\left(x\right)\right)}{\;\mathrm{d}x}$$
By multiplication $$\frac{\tan\left(x\right)+\sec\left(x\right)}{\tan\left(x\right)+\sec\left(x\right)}$$
$$\operatorname{sgn}\left(\sec\left(x\right)\right)\int{\dfrac{\sec\left(x\right)\,\tan\left(x\right)+\sec^{2}\left(x\right)}{\tan\left(x\right)+\sec\left(x\right)}}{\;\mathrm{d}x}$$
Substitution \begin{gathered}\;u=\tan\left(x\right)+\sec\left(x\right)&\\\;\mathrm{d}u=\left(\sec\left(x\right)\,\tan\left(x\right)+\sec^{2}\left(x\right)\right)\,\mathrm{d}x&\end{gathered}
$$\operatorname{sgn}\left(\sec\left(x\right)\right)\int{\dfrac{1}{u}}{\;\mathrm{d}u}$$
Integral table $$\operatorname{sgn}\left(\sec\left(x\right)\right)\cdot\ln\left(\left|u\right|\right)=\ln\left(\left|u\right|\right)\,\operatorname{sgn}\left(\sec\left(x\right)\right)$$
Rewriting $$\dfrac{\ln\left(\left|u\right|\right)\,\left|\sec\left(x\right)\right|}{\sec\left(x\right)}$$
Substitute back
$$\dfrac{\left|\sec\left(x\right)\right|\,\ln\left(\left|\tan\left(x\right)+\sec\left(x\right)\right|\right)}{\sec\left(x\right)}$$