# Functional variation of Lagrangian densities

Why do we treat a scalar field phi and its derivatives as being independent when trying to find a stationary solution for the action?

Doesn't that give too general solutions?

Where does the restriction that (d_mu phi) is dependent on phi come back in?

dextercioby
That's the idea. We take things as general as possible. The Lagrangian needs to be a function of positions and velocities treated as independent variables as to allow the passing to the Hamiltonian formalism on one hand and account for the correct description of dynamics on the other. I mean we usually see the lagrangian as the KE-PE function and the KE part involves time derivatives of position (generalized velocities), while the PE part is allowed to depend only on "x" and "t", and not on $\frac{dx}{dt}$.