# How does Wolfram Alpha compute the indefinite integral $\int \frac{1}{\sqrt{2x-x^2}}dx$

I want to find the indefinite integral of $$1/\sqrt{2x-x^2}$$.

I rearranged the expression to $$\displaystyle \int \frac{1}{\sqrt{1-(x-1)^2}}$$, which is equal to $$\displaystyle \int \arcsin'(x-1)$$. As far as I can tell, this should evaluate to $$\arcsin(x-1)$$, because $$[\arcsin(x-1)]'=\arcsin'(x-1)\times1=\arcsin'(x-1)$$.
When I evaluate this expression on Wolfram Alpha, I get $$\displaystyle-2\arcsin(\sqrt{1-\frac{x}{2}})$$. Differentiating this also yields $$\arcsin'(x-1)$$. I assume that these two expressions ($$\arcsin(x-1)$$ and $$\displaystyle-2\arcsin(\sqrt{1-\frac{x}{2}})$$ ) simply differ by some constant.
How exactly is Wolfram Alpha's output reached?

• This maybe irrelevant but I felt like it needed attention here $$\,$$ Only now does one truly realise the importance of the integration constant; $+C$. Integrals that lead to trigonometric functions like this have multiple answers. With $\arcsin(1-x), -2\arcsin(\sqrt{1 - \dfrac{x}{2}})$ another possible answer could be $\arccos(1 - x)$. Each differing with a constant of $\dfrac{\pi}{2}$. While all these are correct options, in future, remember that each of these graphs have a different range (although your question did not require this info now). (and don't forget your $+C$!). Commented Jun 6, 2023 at 13:59

Note that \begin{align} \int \frac{1}{\sqrt{2x-x^2}}dx &=\frac12\int\frac1{\sqrt{\frac x2}\sqrt{1-\frac x2}}dx = 2\int\frac{d(\sqrt{\frac x2})} {\sqrt{1-\frac x2}}\\ &=-2\cos^{-1} \sqrt{\frac x2}=-2 \sin^{-1} \sqrt{1-\frac x2} \end{align}
• Thank you for the response. Could you please clarify what you mean by $d(\sqrt{\frac{x}{2}})$? I have not seen that notation before. Commented Jun 6, 2023 at 13:26
• @FrightenedofSinusoids - Merely a shortcut for the substitution $t= \sqrt{\frac x2}$, i.e. $dt = d(\sqrt{\frac x2})=(\sqrt{\frac x2})’dx$. Commented Jun 6, 2023 at 13:30
• Is this a "u-substitution" with "$u=\sqrt{\frac{x}{2}}$" and "$2du=\frac{1}{2\sqrt{\frac{x}{2}}}dx$"? Commented Jun 6, 2023 at 13:31
\begin{aligned} I & =\int \frac{1}{\sqrt{x}} \frac{1}{\sqrt{2-x}} d x \\ & =2 \int \frac{1}{\sqrt{2-(\sqrt{x})^2}} d \sqrt{x} \\ & =-2 \cos ^{-1}\left(\frac{\sqrt{x}}{\sqrt{2}}\right)+C\\&= -2 \sin ^{-1}\left(\frac{\sqrt{2-x}}{\sqrt{2}}\right)+C\\&= -2 \sin ^{-1}\left(\sqrt{1-\frac{x}{2}}\right)+C \end{aligned}