Oh because dL/dq always equals d/dt[ dL/dqdot ]!
no matter what the force is, the force is inclusive in dL/dq
since
L = T - V
and
dL/dq = dT/dq - dV/dq ,
where the force, F = -dV/dq
taking the partial derivative of L w/respect to position q takes care of our generalized force F, so we don't need to write it explicitly in the Hamiltonian equations. it's already covered by the Lagrangian in dL/dq, which we can express as the time derivative of the momentum, pdot.
the idea is that the force is in the Lagrangian!
Then when u derive the Hamiltonian equations from Lagrange's
u have dH/dq = - dL/dq
and using the above observation about dL/dq, we have
dL/dq = d/dt[ dL/dqdot ]
going to inside the brackets we have
dL/dqdot = d/dqdot [ 1/2 m qdot^2] = m qdot = p
which is always - always true.
and that means its time derivative is
d/dt[ dL/dqdot = p ] = pdot
so the conclusion is the same
the equation is always
pdot = - dH/dq
oh my god
dT/dq = 0
it's so obvious
then
dL/dq = F
lol