# How can Lagrangian method work whenever the Lagrangian is not convex?

Let $$L(x,\dot x)=\frac{1}{2}m\dot x^2-\frac{1}{2}k(x-x_0)^2-mgx$$ the Lagrangian of a system. Euler Lagrange theorem says that a necessary condition to be a minimizer is to satisfy Euler-Lagrange condition. It's sufficient if the Lagrangian is convex. The method of Euler-Lagrange consist in finding solution of $$\frac{\partial L}{\partial x}=\frac{d}{dt}\frac{\partial L}{\partial \dot x},$$ and after, we say that the solution will give the minimizer. But since the Lagrangian is not convex, how can this method work?