Lagrangian mechanics is about to sum all the Potential energy and Kinectic energy:
$$ L = \sum_{i=1}^n(KE_i - PE_i)$$
Let's say that we have a rotating arm:
With the length $A$, mass $M$ and angle $B$.
Lagrangian equation for this is:
$$L = KE_1 - PE_1 = J\dot{B}^2 - MgA\sin(B)$$
And intertia $J$ is:
$$ J = M((L\sin B)^2 + (L\cos B)^2) = ML^2 $$
Due to:
$$ 1 = \sin^2 B + \cos^2 B \forall B$$
And finally:
$$L = ML^2\dot{B}^2 - MgA\sin B$$
But how would it be if I added a torque $T$ here:
Would the Lagrangian equation be rewritten like this then:
$$L = ML^2(\dot{B} - \dot{T})^2 - MgA\sin B$$
If the $\dot{B} = \dot{T}$ then the whole system will be static and only have potential energy conserved.
Or am I wrong? Will it be like this:
$$L = ML^2(\dot{B}^2 - \dot{T}^2) - MgA\sin B$$

