# Showing that $\int \frac {dx}{\sqrt{x^2+a^2}} \;=\; \ln\,\biggl| x+\sqrt{x^2+a^2}\,\biggr| +C$

I want to show that $$\int \frac {dx}{\sqrt{x^2+a^2}} \;=\; \ln\,\biggl| x+\sqrt{x^2+a^2}\,\biggr| +C$$ and get a slightly incorrect result and I wonder what I am doing wrong.

I let $x = a\tan\theta$ so $dx=a\sec^2\theta\, d\theta$ such that I perform the following operations, $$\frac aa \int \frac {\sec^2\theta}{\sqrt{\tan^2\theta + 1}}d\theta\;=\; \int \sec\theta\,d\theta$$ Multiplying the integrand by $1 = \frac {\sec\theta+\tan\theta}{\sec\theta+\tan\theta}$ I get $$\int \sec\theta\, d\theta \;=\; \int \frac {\sec^2\theta+\sec\theta\tan\theta}{\sec\theta+\tan\theta} d\theta$$ Then I let $u=\sec\theta+\tan\theta$ and $du = \sec^2\theta+\sec\theta\tan\theta$ such that I get a $\int \frac 1u du$ integral that yields $$\int \sec\theta \, d\theta \;=\;\ln|\sec\theta+\tan\theta|+C$$ Getting back in $x$ variable terms I get, $$\int \frac {dx}{\sqrt{x^2+a^2}} \;=\; \ln\,\biggl| \frac 1a \left(x+\sqrt{x^2+a^2}\right)\biggr| +C$$ It seems to me that this $\frac 1a$ has to be there according to the substitution $x=a\tan\theta$, the adjacent side to the angle $\theta$ is of length $a$. Then, when substituting back to $x$ I get $\sec\theta= \frac {x^2+a^2}a$ and $\tan\theta = \frac xa$. What am I missing?

• note that $$\ln\left(\frac{1}{a}\right)$$ is a const. Feb 25, 2017 at 16:22
• @Dr.SonnhardGraubner So it could be "absorbed" into the "$+C$" constant term is what you mean?
– user409521
Feb 25, 2017 at 16:24
• yes it can absorbed into the const. C, a nice word 'absorbed' Feb 25, 2017 at 16:25
• By the way, a much easier way of verifying the identity is to just compute $\frac{d}{dx} \ln|x+\sqrt{x^2+a^2}|$. Feb 25, 2017 at 17:15
• The definition of $F(x) = \int f(x) \, dx$ is that you “differentiate backwards”, in other words that $F'(x)=f(x)$. Feb 25, 2017 at 21:56

Since $\log{xy} = \log{x}+\log{y}$, you can remove the $1/a$ from the logarithm and incorporate it into the constant.
$$\ln \frac{(x+\sqrt{x^2+a^2})}{a} + C$$
$$= \ln (x+\sqrt{x^2+a^2}) - \ln a + C$$
$$= \ln (x+\sqrt{x^2+a^2}) + C'$$