I'm trying to numerically reproduce the cycloid solution for the brachistochrone problem. In doing so, I eventually ended up with the following integral:
$$ x = \int{\sqrt{\frac{y}{2a-y}} dy} $$
Traditionally, one would at this point substitute $y=a-a\cos{\theta}$, but that seems very arbitrary and ad-hoc. What would you substitute if you didn't know the solution beforehand? What would you substitute if you had a field other than $v=\sqrt{2gy}$, such as $v=gy^2$? In the face of this conundrum, I decided to test what would happen if I simply integrated with SymPy by doing sol = integrate(y/sqrt((2*a)-y), y) print(sol.doit())
, and to my horror:
Piecewise((16sqrt(2)Ia**(7/2)sqrt(-1 + y/(2a))/(-6a2 + 3ay) - 16sqrt(2)a(7/2)/(-6*a2 + 3ay) - 4sqrt(2)Ia**(5/2)ysqrt(-1 + y/(2a))/(-6a**2 + 3ay) + 8sqrt(2)a*(5/2)y/(-6a2 + 3ay) - 2*sqrt(2)Ia(3/2)y**2sqrt(-1 + y/(2a))/(-6a2 + 3ay), Abs(y/a)/2 > 1), (16sqrt(2)a(7/2)sqrt(1 - y/(2a))/(-6*a2 + 3ay) - 16sqrt(2)a(7/2)/(-6a**2 + 3ay) - 4sqrt(2)a*(5/2)ysqrt(1 - y/(2a))/(-6a2 + 3ay) + 8sqrt(2)a(5/2)y/(-6a2 + 3ay) - 2sqrt(2)a(3/2)y**2sqrt(1 - y/(2a))/(-6a**2 + 3ay), True))
When I corroborated with MATLAB, I found
Clearly, this is nowhere close to $x = a\theta - a\sin{\theta}$. What's going on? What can I do?
Also, please let me know if any amendments need to be made to my question.
code
$\endgroup$