# Indefinite integral of $\sqrt{x^2-x}$

i was trying to compute the indefinite integral: $$\int\sqrt{x^2-x}dx$$ but i got stuck: after a few (unsuccessful) attempts for some $u$-substitution, i tried integration by parts: $$\int\sqrt{x^2-x} \ dx=\int(x)'\sqrt{x^2-x} \ dx= \\ x\sqrt{x^2-x}-\int x(\sqrt{x^2-x})'dx= \\ =x\sqrt{x^2-x}-\frac{1}{2}\int x\frac{2x-1}{\sqrt{x^2-x}}dx= \\ =x\sqrt{x^2-x}-\int \frac{x^2}{\sqrt{x^2-x}}dx+\frac{1}{2}\int \frac{x}{\sqrt{x^2-x}}dx=...$$ and now what? Can anybody help?

• Looking at the integral, you might want to make some sort of trigonometric substitution. May 22 '18 at 0:34
• First, complete the square and let $x-\frac 12=\frac {\sec u}2$ May 22 '18 at 0:36
• Learn this and then don't ever have any problem with those types of integrals.
– user561348
May 22 '18 at 0:36
• @FrankW. I found this too from WolframAlpha, yet I am having a hard time finding out how to think of this naturally. Experience, I guess. May 22 '18 at 0:40
• @ArnaudMortier If you complete the square $\sqrt{x^2-x}=\frac{(2x-1)^2-1}{2}$. Then $\sin^2+\cos^2=1$ gives $\frac{1}{\cos^2}-1=\frac{\sin^2}{\cos^2}$. This and $\sin^2=1-\cos^2$ are the identities that trigonometric substitutions exploit to simplify the integral (and also their derivatives). Unfortunately, lazy teaching has made trigonometric substitutions more popular than they deserve to be. Or better said, lazy teaching doesn't make Euler's substitutions as popular as they should be, and then the trigonometric one just fill up the void.
– user561348
May 22 '18 at 0:47

hint

$$\sqrt {x^2-x}=\frac {1}{2}\sqrt {(2x-1)^2-1}$$

then put $$2x-1=\cosh (t)$$ and use

$$\cosh^2(t)-1=\sinh^2(t)$$

• what is $h(t)$ ? May 22 '18 at 1:03
• @olgchar $\cosh(t)$ and $\sinh(t)$ are the hyperbolic cosine and sine functions. There's more information on the Wikipedia page. May 22 '18 at 1:20
• aahh ok... silly question! thanks anyway! May 22 '18 at 1:21

$$\int \sqrt{x^2-x} \ dx$$ $$=\int \sqrt{(x-\frac12)^2-\frac14}dx$$ Apply u-substitution:$$u=x-\frac12$$ $$=\int\sqrt{u^2-\frac14}du$$ Apply Trig Substitution: $$u=\frac12 \sec(t)$$ $$=\int\frac{\sec(t)\tan(t)\sqrt{\sec^2(t)-1}}{4}dt$$ $$\frac14\int \sec(t)\tan(t)\sqrt{\sec^2(t)-1}dt$$ Use the identity:$$\sec^2(x)=1+\tan^2(x)$$ $$\frac14 \int \sqrt{-1+1+\tan^2(t)}(\sec(t)\tan(t))dt$$ $$\frac14 \int \sqrt{\tan^2(t)}(\sec(t)\tan(t))dt$$ $$=\frac14 \int \tan(t)\sec(t)\tan(t)dt$$ $$=\frac14 \int \tan^2(t)\sec(t)dt$$ Using the identity:$$\tan^2(x)=-1+\sec^2(x)$$ $$=\frac14 \int (-1+\sec^2(t))\sec(t)dt$$ $$\frac14 \int -\sec(t)+\sec^3(t)dt$$ $$\frac14(-\int \sec(t)dt+\int \sec^3(t)dt)$$ Note that $$\int \sec(t)dt=\ln |\tan(t)+\sec(t)|$$

and $$\int \sec^3(t)dt=\frac{\sec^2(t)\sin(t)}{2}+\frac12 \ln |\tan(t)+\sec(t)|$$ $$=\frac14(-\ln |\tan(t)+\sec(t)|+\frac{\sec^2(t)\sin(t)}{2}+\frac12 \ln |\tan(t)+\sec(t)|)$$ And finally after substituting back the "u and t", we get $$\int \sqrt{x^2-x}dx=\frac18 (4x^2 \sqrt{-\frac{1}{(2x-1)^2}+1}-4x \sqrt{-\frac{1}{(2x-1)^2}+1}+ \sqrt{-\frac{1}{(2x-1)^2}+1}-\ln|2x\sqrt{-\frac{1}{(2x-1)^2}+1}-\sqrt{-\frac{1}{(2x-1)^2}+1}+2x-1|)+C$$

complete the square

\begin{align} \int\sqrt{x^2-x} \ dx &=I \\ x^2-x&=\left(x-\frac{1}{2}\right)^2-\frac{1}{4} \\ \text{set} \quad u&=x-\frac{1}{2} \quad \text{then} \quad dx=du\\ I&=\int\sqrt{u^2-a} \ du \quad \text{such that} \quad a=\frac{1}{4}\\ \end{align}

This type of integral is well known. You should now use a trig substitution.

$$\int\sqrt{x^2-x}\; dx=\int\sqrt{x}\; \sqrt{x-1}\; dx\qquad\qquad x\rightarrow\; \cosh^2\theta\quad dx\rightarrow2\cosh\theta\sinh\theta\; d\theta$$

$$=2\int\cosh^2\theta\sinh^2\theta\; d\theta\ =2\int\cosh^2\theta(\cosh^2\theta-1)\; d\theta\ = 2\int\cosh^4\theta\; d\theta -2\int\cosh^2\theta\; d\theta\$$

$$=\frac{1}{2}\int(1+\cosh(2\theta))^2\;d\theta\ -\int(1+cosh(2\theta))\; d\theta$$ $$\frac{1}{2}\int(1+2\cosh(2\theta)+\cosh^2(2\theta))\; d\theta\ -\theta-\frac{1}{2}\sinh(2\theta)+C$$ $$\frac{\theta}{2}+\frac{1}{2}\sinh(2\theta)-\theta-\frac{1}{2}\sinh(2\theta)+C\ +\frac{1}{4}\int(1+\cosh(4\theta))\; d\theta$$ $$\frac{\theta}{2}+\frac{1}{2}\sinh(2\theta)-\theta-\frac{1}{2}\sinh(2\theta)\ +\frac{\theta}{4}+\frac{1}{16}\sinh(4\theta)+C$$ $$\frac{1}{16}\sinh(4\theta)-\frac{\theta}{4}+C$$ $$\theta=\cosh^{-1}(\sqrt{x})$$ $$\frac{1}{16}\sinh(4\cosh^{-1}(\sqrt{x}))-\frac{1}{4}\cosh^{-1}(\sqrt{x})+C$$ This is the short answer if you don't want so much details. Of course if you have enough skills can try using Integration By Parts or another Trig. Subs.