I am trying to understand the accepted answer by @Fabian to the post Asymptotic expansion of the complete elliptic integral of the first kind.
After a substituion the following integral is obtained
$$ K(k) = \int_{1-k^2}^1\!dy\,\frac{1}{2 \sqrt{y(1-y)(y-1 +k^2)}}$$
and the integral is expanded in $ \epsilon = 1-k$ to get
$$ K(k) = \int_{1-k^2}^1\!dy\frac{1}{2 y \sqrt{1-y}} + O(1)$$
@Fabian then adds that "<…> The estimate of the error term follows from the fact that expanding in $\eta =1-k^2$, we have $$K(k) = \sum_{n=0}^\infty c_n \eta^n \int_{\eta}^1\!dy\, y^{-1-n} (1-y)^{-1/2}$$
with $c_n$ some constants <…>"
I cannot reproduce the calculation. Going back to the first expansion of the integrand in $\epsilon = 1-k$ I calculated further terms
$$ \frac{1}{2 \sqrt{y(1-y)(y-1 +k^2)}} = \frac{1}{2 y \sqrt{1-y}} + \frac{\epsilon}{2 y^2 \sqrt{1-y}} + \frac{(3-y)\epsilon^2}{4y^3 \sqrt{1-y}} + O(\epsilon^3) $$
but I fail to understand how further process is achieved. If I understood, the integral of the series is to be considered, and then the integral expanded in $\eta = 1-k^2$, but I do not understand how.
Let me rewrite the series expansion for the integral in terms of $k$
$$\frac{1}{2 \sqrt{y(1-y)(y-1 +k^2)}} = \frac{1}{2 y \sqrt{1-y}} + \frac{1-k}{2 y^2 \sqrt{1-y}} + \frac{(3-y)(1-k)^2}{4y^3 \sqrt{1-y}} + O((1-k)^3) $$
and the integral to be expanded in $1-k^2$ is $$K(k) = \int_{1-k^2}^1\!dy \Bigg( \frac{1}{2 y \sqrt{1-y}} + \frac{1-k}{2 y^2 \sqrt{1-y}} + \frac{(3-y)(1-k)^2}{4y^3 \sqrt{1-y}} + O((1-k)^3) \Bigg)$$
but I get quite stuck. Any suggestion would be most welcome.