I have been attempting to minimize the following integral:
$$ T=\int_{a}^{b}\sqrt{\frac{1+y'^2}{2gy}}dx, $$
knowing that $y$ is of the form: $$ y = a_0 +a_1 x+a_2x^2 $$ and that $y(0)=2$ and $y(\pi)=0$. I don't know that it is possible to solve the integral analytically, and so I have been thinking that I should use the Euler-Lagrange differential equation (see this for details).
The trouble is, that I've found $a_2$ as a function of $x$, by recognizing $a_0=2$ and $a_1=-\Big(\frac{2}{\pi}+\pi a_2\Big)$ and substituting everything into the Euler-Lagrange differential equation, which obviously doesn't make sense.
Is there any other way to solve such a problem? Am I just messing up a calculation somewhere? I'm working in Python, which has been making it difficult to keep track of variables, so it may be that the latter is in fact true.
I would appreciate very much any help in figuring this out.