I'm new to classical mechanics and learned a new cool thing, second type equations of Lagrangian Mechanics. So, I was just testing if it really works or not. So, I made a question myself to test it, but I think that I've some problem here.
First, assume the $x$ coordinate of the ball of mass $m$. Initially, it's at $x=0$, under the influence of Gravity it should fall (assuming the setup is in such a way that Gravity is acting from downwards.)
So, the cool equation says that :
$$\displaystyle{\boxed{\boxed{ \dfrac{d}{dt} \left ( \dfrac{\partial L}{\partial {x'} } \right) - \dfrac{\partial L}{\partial x} = 0 }} \quad \dots \quad (*)}$$ Where, $L = K.E. - P.E. = ( mg \sin \theta x) - (mg \sin \theta h)\quad \dots \quad (1)$
However using the Euler-Lagrange equation (*) with the Lagrangian (1) does not give me a sensible answer, so my question is where is my mistake?
So, I've calculated K.E. here as: $K = \frac 1 2 m v^2 = \frac 1 2 m (2(g \sin \theta) x) \quad \dots \quad (\text{As }v^2 = u^2 + 2as)$
and $P = mgh = mg\sin \theta(h - x )$
The issue might be to do with using $v^2=2as$ in the kinetic energy (as suggested in comments) but I don't see why this is improper.
So, Why I can't substitute the Velocity equations in that Lagrangian Equation (That Kinetic energy part).