Finding a suitable substitution for integral

I'm struggling to find a suitable substitution for this integral:

$$\int{\frac{\sqrt{x^2+4}}{x}}$$

I've tried $$u=x^2+4$$, $$u^2=x^2+4$$ and some trigonemetric identities, but not much progress. Can anybody help me figure out how to get to the answer:

$$\sqrt{x^2+4}+\ln\left\vert\frac{\sqrt{x^2+4}-2}{\sqrt{x^2+4}+2}\right\vert + c$$

• Did you try $x=2\tan u$?
– J.G.
Nov 12, 2023 at 11:54
• You could try $x=2\sinh u$ Nov 12, 2023 at 12:24
• Hohner, actually, $u^2=x^2+4$ is a good substitution for your integral. Look at my answer. Nov 12, 2023 at 14:51

Another way to calculate your integral.

By letting $$\;t=\sqrt{x^2+4}\,,\,$$ you get that

$$x=\sqrt{t^2-4}\;$$ and $$\;\mathrm dx=\dfrac t{\sqrt{t^2-4}}\,\mathrm dt\,.$$

Consequently ,

$$\displaystyle\int\frac{\sqrt{x^2+4}}x\,\mathrm dx=\!\int\!\frac{t^2}{t^2-4}\,\mathrm dt=\!\int\!\left(1\!+\!\dfrac1{t-2}\!-\!\dfrac1{t+2}\right)\mathrm dt\!=$$

$$=t+\ln|t-2|-\ln|t+2|+c=$$

$$=t+\ln\left|\dfrac{t-2}{t+2}\right|+c=$$

$$=\sqrt{x^2+4}+\ln\left|\dfrac{\sqrt{x^2+4}-2}{\sqrt{x^2+4}+2}\right|+c\,.$$

Letting $$x=2\tan u$$, $$\mathrm dx=2 \sec^2 u \,\mathrm du$$, you get: $$\int \frac{\sqrt{x^2+4}}{x}\mathrm dx=2\int\frac{\sqrt{4\tan^2u+4}}{2\tan u} \sec^2 u\,\mathrm du=2\int \cot u \sec^3 u\,\mathrm du$$ Can you take it from here?

• Not entirely... According to Wolfram, $2\int \cot u \sec^3 u\,\mathrm du$ integrates to $2(\sec(u)+\log{\tan(\frac{u}{2})})$ Is that right? I don't think I've seen this form of integration, unless I'm missing something Nov 12, 2023 at 14:52
• @hohner yes, that's right. The answer may differ because of trig identities Nov 12, 2023 at 14:58

$$\int \frac{\sqrt{4+ x^2}}{x}dx=\int \frac{{4+ x^2}}{x\sqrt{4+ x^2}}dx= \int \frac{{4}}{x\sqrt{4+ x^2}}dx+ \int \frac{{x}}{\sqrt{4+ x^2}}dx$$

$$\int \frac{{x}}{\sqrt{4+ x^2}}dx$$ is an easy integral $$= \sqrt{4+ x^2} +C$$ for $$\int\frac{{4}}{x\sqrt{4+ x^2}}dx =\int\frac{{2 \times \frac{1}{2}}}{\frac{x}{2}\sqrt{1+ (\frac{x}{2})^2}}dx$$ let $$0.5 x = \tan t$$ then $$\int\frac{{2 \times \frac{1}{2}}}{\frac{x}{2}\sqrt{1+ (\frac{x}{2})^2}}dx= \int\frac{{2 \sec^2(t)}}{\tan(t)|\sec(t)|}dx = 2 \operatorname{sgn}(\cos(t))\int \csc(t) dt$$ $$=-2\ln \left|\csc(t) + \cot(t) \right| =-2\ln \left|\frac{\sqrt{x^2+4}}{x} + \frac{2}{x}\right|$$

so $$\int \frac{\sqrt{4+ x^2}}{x}dx =-2\ln \left|\frac{\sqrt{x^2+4}}{x} + \frac{2}{x}\right| +\sqrt{4+ x^2} +C$$