# Solve $\int\frac{x}{\sqrt{x^2-6x}}dx$

I need to solve the following integral

$$\int\frac{x}{\sqrt{x^2-6x}}dx$$

I started by completing the square,

$$x^2-6x=(x-3)^2-9$$

Then I defined the substitution variables..

$$(x-3)^2=9\sec^2\theta$$ $$(x-3)=3\sec\theta$$ $$dx=3\sec\theta\tan\theta$$ $$\theta=arcsec(\frac{x-3}{3})$$

Here are my solving steps $$\int\frac{x}{\sqrt{(x-3)^2-9}}dx = 3\int\frac{(3\sec\theta+3)\sec\theta\tan\theta}{\sqrt{9(\sec^2\theta-1)}}d\theta$$ $$=\int\frac{(3\sec\theta+3)\sec\theta\tan\theta}{\tan\theta}d\theta$$ $$=\int(3\sec\theta+3)\sec\theta\tan\theta$$ $$=3\int\sec^2\theta\tan\theta d\theta + 3\int\sec\theta\tan\theta d\theta$$ $$u = \sec\theta, du=\sec\theta\tan\theta d\theta$$ $$=3\int udu + 3\sec\theta$$ $$=\frac{3\sec\theta}{2}+3\sec\theta+C$$ $$=\frac{3\sec(arcsec(\frac{x-3}{3}))}{2}+3\sec(arcsec(\frac{x-3}{3}))+C$$ $$=\frac{3(\frac{x-3}{3})}{2}+3(\frac{x-3}{3})$$ $$=\frac{x-3}{2}+x-3+C$$

$$\int\frac{x}{\sqrt{x^2-6x}}dx=\sqrt{x^2-6x}+3\ln\bigg(\frac{x-3}{3}+\frac{\sqrt{x^2-6x}}{3}\bigg)$$

What did I misunderstood?

• When you go from line 12 to 13 you have not simplified $\tan\theta.$ That is, line 13 should read $$\int(3\sec\theta+3)\sec\theta d\theta.$$
– mfl
Mar 14, 2015 at 20:35
• @mfl I was able to solve it with your correction :) Feel free to post that as an answer if you want me to accept. Mar 14, 2015 at 20:54
• It is not necessary. You have solved the problem by yourself. It was only a typo. Good luck.
– mfl
Mar 14, 2015 at 20:55
• @mfl Well, thanks a lot for your hint. Mar 14, 2015 at 20:56

I prefer to apply hyperbolic substitution.

More precisely, if we let $$x - 3 = 3\cosh(y)$$, we arrive at \begin{align*} \int\frac{x}{\sqrt{x^{2} - 6x}}\mathrm{d}x & = \int\frac{x}{\sqrt{(x - 3)^{2} - 9}}\mathrm{d}x\\\\ & = 3\int\frac{(1 + \cosh(y))\sinh(y)}{\sqrt{\cosh^{2}(y) - 1}}\mathrm{d}y\\\\ & = 3\int\mathrm{d}y + 3\int \cosh(y)\mathrm{d}y\\\\ & = 3y + 3\sinh(y) + c\\\\ & = 3\operatorname{arccosh}\left(\frac{x - 3}{3}\right) + 3\sqrt{\left(\frac{x - 3}{3}\right)^{2} - 1} + c\\\\ & = 3\ln\left(\frac{x - 3}{3} + \frac{\sqrt{x^{2} - 6x}}{3}\right) + \sqrt{x^{2} - 6x} + c\\\\ & = 3\ln\left(x - 3 + \sqrt{x^{2} - 6x}\right) + \sqrt{x^{2} - 6x} + C \end{align*}

which coincides with the proposed result because \begin{align*} \operatorname{arccosh}(z) = \ln\left(z + \sqrt{z^{2} - 1}\right) \end{align*}

Hopefully this helps!

• That logarithm should have an absolute value in the final answer, else you're missing the solutions for negative $x$ (Indeed I think the underlying issue here might stem from $\cosh$ not being an injective function on $\mathbb{R}$, so the substitution doesn't give the complete solution). Mar 25, 2022 at 1:48
• @Lorago thank you very much for the observation. Perhaps it suffices to take $x > 6$, since $\cosh(z)\geq 1$ and $x - 3 = 3\cosh(z)$ (we are not allowed to take $x < 0$ because the $\cosh$ function is always non-negative). What do you think about it? Mar 25, 2022 at 3:03
• The point is the integrand is defined for $x>6$ or $x<0$, so both cases must be handled. And indeed, cosh is the problem, though you can still use cosh for the other case (but I don't think you can do both at once). Your derivation is indeed correct for $x>6$, as is implied by $x-3=3\cosh y$). Interesting to have solutions with Euler and hyperbolic substitutions in this question. Mar 25, 2022 at 11:24

I'll give you an answer that is completely free from all this trigonometric nonsense, that I personally think is cleaner and easier. We wish to compute

$$\int \frac{x}{\sqrt{x^2-6x}}\,\mathrm{d}x.$$

Consider first rewriting it as

$$\int \frac{x}{\sqrt{x^2-6x}}\,\mathrm{d}x=\frac{1}{2}\int \frac{2x-6}{\sqrt{x^2-6x}}\,\mathrm{d}x+3\int \frac{\mathrm{d}x}{\sqrt{x^2-6x}}\,.$$

Now for the first integral, letting $$u=x^2-6x$$ we get that

$$\frac{1}{2}\int \frac{2x-6}{\sqrt{x^2-6x}}\,\mathrm{d}x=\int\frac{\mathrm{d}u}{2\sqrt{u}}=\sqrt{u}+A=\sqrt{x^2-6x}+A.$$

This takes care of the first integral. Now for the second integral, consider the Euler substitution

$$\begin{cases} t=x+\sqrt{x^2-6x},\\ \mathrm{d}t=\frac{x+\sqrt{x^2-6x}-3}{\sqrt{x^2-6x}}\mathrm{d}x. \end{cases}$$

This yields that

$$3\int \frac{1}{\sqrt{x^2-6x}}\,\mathrm{d}x=3\int \frac{\mathrm{d}t}{t-3}=3\ln\lvert t-3\rvert +D=3\ln\lvert x+\sqrt{x^2-6x}-3\rvert+B.$$

$$\int \frac{x}{\sqrt{x^2-6x}}\,\mathrm{d}x=\sqrt{x^2-6x}+3\ln\lvert x+\sqrt{x^2-6x}-3\rvert+C.$$
\begin{aligned} \int \frac{x}{\sqrt{x^2-6 x}} d x & \int \frac{x}{x-3} d\left(\sqrt{x^2-6 x}\right) \\ = & \int\left(1+\frac{3}{x-3}\right)\left(\sqrt{x^2-6 x}\right) \\ = & \sqrt{x^2-6 x}+3 \int \frac{d\left(\sqrt{x^2-6 x}\right)}{\sqrt{\left(\sqrt{x^2-6 x}\right)^2+9}} \\ = & \sqrt{x^2-6 x}+3 \sinh^{-1} \left(\frac{\sqrt{x^2-6 x}}{3}\right)+C \end{aligned}