<s>[INST] Integral $\sqrt{1+\frac{1}{4x}}$ $$\mathbf\int\sqrt{1+\frac{1}{4x}} \, dx$$
This integral came up while doing an arc length problem and out of curiosity I typed it into my TI 89 and got this output
$$\frac{-\ln(|x|)+2\ln(\sqrt\frac{4x+1}{x}-2)-2x\sqrt\frac{4x+1}{x}}{8}\ $$
How would one get this answer by integrating manually?
 [/INST] Set $u=\cfrac{1}{4x}, du=\cfrac{-1}{4x^2}$. Substitute:
$$\int \sqrt{1+u}(-4x^2)du$$
Since $4x=\cfrac{1}{u}, x=\cfrac{1}{4u}$,
$$=\int \cfrac{-1}{4u^2}\sqrt{1+u}du$$
Integrate by parts: $s=\sqrt{1+u}, ds=\cfrac{1}{2\sqrt{1+u}}du, dt=\cfrac{1}{u^2}du, t=\cfrac{-1}{u}$,
$$=\cfrac{-1}{4}\bigg[\cfrac{-\sqrt{1+u}}{u} - \int\cfrac{-1}{u}\cfrac{1}{2\sqrt{1+u}}du\bigg]$$
Substitute again, $r=\sqrt{u+1}, dr=\cfrac{1}{2\sqrt{u+1}}du=\cfrac{1}{2r}du \rightarrow 2rdr=du$
$$=\cfrac{-1}{4}\bigg[\cfrac{-\sqrt{1+u}}{u} - \int\cfrac{-1}{u}\cfrac{1}{2r}2rdr\bigg]$$
$$=\cfrac{-1}{4}\bigg[\cfrac{-\sqrt{1+u}}{u} - \int\cfrac{1}{1-r^2}dr\bigg]$$
Use the identity $\int \cfrac{1}{1-x^2} dx = arctanh(x)+C$.
$$=\cfrac{-1}{4}\bigg[\cfrac{-\sqrt{1+u}}{u} - arctanh(r) + C\bigg]$$
Substitute back in: $u=\cfrac{1}{4x}, r=\sqrt{u+1}$,
$$=\cfrac{1}{4}\bigg[4x\sqrt{1+\cfrac{1}{4x}} + arctanh\bigg(\sqrt{\cfrac{1}{4x}+1}\bigg)\bigg]+C$$
</s>