So I want to find the length of the function $y = a - 2\sqrt{ax} + x$ in the interval $(0, a)$, assuming $a > 0$.
I found the derivative: $ y' = 1 - \frac {\sqrt{a}}{\sqrt{x}} $
Then using the formula $$l = \int_{0}^{a}\sqrt{1+(y'(x))^2} dx$$ I get the integral: $$l =\int_{0}^{a}\sqrt{2-2\sqrt{\frac{a}{x}}+\frac{a}{x}} dx$$
Which is improper, because at the lower bound $0$ $\sqrt{\frac{a}{x}}$ and $\frac{a}{x}$ approach infinity.
$$ l = \int_{0}^{a}\sqrt{2x-2\sqrt{ax}+a}*x^{-1/2} dx = \frac{1}{\sqrt{a}}\int_{0}^{a}\sqrt{2x-2\sqrt{ax}+a} d2\sqrt{ax}+a$$ With substitution as suggested by the comments: $y=\sqrt{\frac{a}{x}}$, $dx=-\frac{a}{y^2}dy$: (I think I made a mistake, because this one doesn't converge) $$l = -a*\int_{\infty}^{1}\sqrt{2-2y+y^2}*\frac{1}{y^2}dy=a*\int_{1}^{\infty}\sqrt{2-2y+y^2}*\frac{1}{y^2}dy$$
How can I solve this? And is $l = \sqrt{2}a$, because I found that as an answer to a similar question but without integration?