Generalized coordinates are functions of time along a motion. In the Euler–Lagrange equations, however, we first differentiate a function whose arguments are position, velocity, and time, and then evaluate those derivatives along the motion. These are different operations.
This note revises my original Chinese answer.
The function and the path through its domain
In local coordinates, write the Lagrangian as
Here , , and are independent input coordinates of the function's domain. Geometrically, the domain is the tangent bundle of configuration space, together with time. Independence of these input coordinates does not mean that their geometric directions are orthogonal.
A sufficiently smooth motion defines a path through that domain:
The velocity input becomes when we evaluate on this path. Thus is a function of time, even though itself has several arguments.
Partial derivatives and the chain rule
The notation means: vary the input while holding the other inputs, including and , fixed. This defines a new function on the same domain. We can then evaluate it at .
By contrast, differentiating the composition gives
with every partial derivative on the right evaluated along . This is the ordinary multivariable chain rule. More generally, the derivative of a multivariable function is a linear map; a derivative need not belong to a function with only one input.
A simpler example makes the distinction visible. If , then and . Along ,
Taking does not “forget” a time dependence. It differentiates a different function from the composition .
Reading the Euler–Lagrange equation
For an unconstrained coordinate description with no additional generalized forces, the equation is
The usual notation replaces by even inside and its partial derivatives. That is convenient, but it can conceal the order of operations.
For ,
After evaluation on a trajectory, , so the equation becomes . Meanwhile, the total derivative of is , a different quantity.
Why this also works in the variational derivation
For a variation , the velocity varies as . Position and velocity variations along a path are therefore related. Nevertheless, the chain rule uses the independently defined partial derivatives of :
For variations vanishing at both endpoints, integration by parts gives the Euler–Lagrange equations. We never need to assert that a trajectory's position and velocity can vary independently at all times. See Tong's classical dynamics notes for the variational derivation.