7.5 Virtual Work & Lagrange's Equation

Key Takeaways

  • Virtual work and Lagrange's equation are both named explicitly in the Engineering Mechanics bullet of the CIL Mechanical Paper-II syllabus.
  • The principle of virtual work states that a system in equilibrium does zero net virtual work under any small virtual displacement consistent with its constraints.
  • Constraint and reaction forces do no virtual work, which is why the method solves a mechanism without ever computing a pin reaction.
  • Lagrange's equation derives the equations of motion from the difference between kinetic and potential energy, using generalised coordinates equal in number to the degrees of freedom.
Last updated: August 2026

Why Energy Methods Exist

The free-body approach requires one equilibrium equation per body and produces unknown pin reactions that must be carried through the algebra even when nobody wants them. For a mechanism with several links, that is a great deal of work to find one applied force.

Virtual work removes the reactions entirely. Its central observation is that constraint forces — pin reactions, smooth-surface normals, and the internal forces in rigid links — act perpendicular to the motion they permit, or in equal and opposite pairs, and therefore do no work. If work is the only quantity you write down, they never enter the equations.

Virtual Displacement

A virtual displacement $\delta r$ is an infinitesimal, imaginary change in configuration that is:

  • consistent with the constraints — the system must still hold together and respect its supports;
  • instantaneous — time is frozen, so it is not a real motion;
  • arbitrary in magnitude within those limits.

The symbol $\delta$ rather than $d$ marks it as virtual rather than actual.

The Principle of Virtual Work

A system of connected rigid bodies is in equilibrium if and only if the total virtual work done by all active forces during any admissible virtual displacement is zero.

δW=iFiδri=0\delta W = \sum_{i} \mathbf{F}_i \cdot \delta \mathbf{r}_i = 0

For a system with couples applied, the corresponding term is $\sum M_j,\delta\theta_j$.

Active forces are the applied loads, spring forces and weights. Reactive forces are the support and constraint forces, and they are excluded because they do no virtual work.

Method

  1. Choose a single independent coordinate that describes the configuration — usually an angle.
  2. Express the position of every point where an active force acts in terms of that coordinate.
  3. Differentiate to obtain each virtual displacement in terms of $\delta\theta$.
  4. Write $\delta W = 0$, cancel $\delta\theta$, and solve.

Worked Example: A Toggle Mechanism

Two links, each of length $L$, are pinned to form a symmetric toggle. The upper pin carries a vertical downward load $P$, and a horizontal force $Q$ is applied at the lower roller. Each link makes an angle $\theta$ with the horizontal.

Taking the fixed pin as origin, the height of the load point is $y = L\sin\theta$ and the horizontal position of the roller is $x = 2L\cos\theta$.

Virtual displacements:

δy=Lcosθδθ,δx=2Lsinθδθ\delta y = L\cos\theta\,\delta\theta, \qquad \delta x = -2L\sin\theta\,\delta\theta

Virtual work, with $P$ acting downward against increasing $y$ and $Q$ acting in the direction of decreasing $x$:

δW=Pδy+Q(δx)(1)    PLcosθδθ+2QLsinθδθ=0\delta W = -P\,\delta y + Q\,(-\delta x)\cdot(-1) \;\Rightarrow\; -PL\cos\theta\,\delta\theta + 2QL\sin\theta\,\delta\theta = 0

Cancelling $L,\delta\theta$:

Q=P2cotθQ = \frac{P}{2}\cot\theta

As $\theta \to 0$ the required $Q$ grows without bound — which is exactly the mechanical advantage a toggle clamp or a stone crusher exploits. No pin reaction was ever computed.

Potential Energy and Stability

When all active forces are conservative, virtual work can be written as the change in total potential energy $V$, and equilibrium requires

dVdθ=0\frac{dV}{d\theta} = 0

The second derivative then classifies the equilibrium, exactly as in the single-variable calculus of Section 1:

ConditionEquilibrium
$d^2V/d\theta^2 > 0$Stable — potential energy is a minimum
$d^2V/d\theta^2 < 0$Unstable — potential energy is a maximum
$d^2V/d\theta^2 = 0$Neutral

A ball at the bottom of a bowl is stable; the same ball balanced on a dome is unstable.

Generalised Coordinates and Degrees of Freedom

A generalised coordinate $q_i$ is any independent quantity that helps fix the configuration of a system. The number required equals the number of degrees of freedom. For a simple pendulum, one angle suffices; for a double pendulum, two.

Generalised coordinates need not be lengths — an angle, an area or a charge can serve, provided the set is independent and complete.

Lagrange's Equation

Define the Lagrangian as the difference between kinetic and potential energy:

L=TVL = T - V

For each generalised coordinate $q_i$, the equation of motion is

ddt(Lq˙i)Lqi=Qi\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q}_i}\right) - \frac{\partial L}{\partial q_i} = Q_i

where $\dot q_i$ is the generalised velocity and $Q_i$ is the generalised non-conservative force — damping, friction, or an applied driving force. When all forces are conservative, $Q_i = 0$.

Equivalently, in terms of $T$ and $V$ separately:

ddt(Tq˙i)Tqi+Vqi=Qi\frac{d}{dt}\left(\frac{\partial T}{\partial \dot{q}_i}\right) - \frac{\partial T}{\partial q_i} + \frac{\partial V}{\partial q_i} = Q_i

Why it is worth the trouble

Newton-EulerLagrangian
Vector equations; direction mattersScalar energies; no vector resolution
Constraint forces appear and must be eliminatedConstraint forces never appear
One free-body diagram per bodyOne Lagrangian for the whole system
Coordinate choice is awkward for rotating systemsAny convenient generalised coordinate works

Worked Example: Simple Pendulum

A bob of mass $m$ hangs on a massless rod of length $l$, with $\theta$ measured from the downward vertical.

Kinetic energy. The bob's speed is $l\dot\theta$, so

T=12ml2θ˙2T = \tfrac{1}{2}m l^2\dot{\theta}^2

Potential energy, taking the pivot as datum:

V=mglcosθV = -mgl\cos\theta

Lagrangian: $L = \tfrac{1}{2}ml^2\dot\theta^2 + mgl\cos\theta$.

Now apply the equation:

Lθ˙=ml2θ˙    ddt(Lθ˙)=ml2θ¨\frac{\partial L}{\partial\dot\theta} = ml^2\dot\theta \;\Rightarrow\; \frac{d}{dt}\left(\frac{\partial L}{\partial\dot\theta}\right) = ml^2\ddot\theta

Lθ=mglsinθ\frac{\partial L}{\partial\theta} = -mgl\sin\theta

Substituting:

ml2θ¨+mglsinθ=0θ¨+glsinθ=0ml^2\ddot{\theta} + mgl\sin\theta = 0 \quad\Longrightarrow\quad \ddot{\theta} + \frac{g}{l}\sin\theta = 0

For small oscillations, $\sin\theta \approx \theta$ — the truncated Taylor series from Section 1 — giving simple harmonic motion with

ωn=gl,Tperiod=2πlg\omega_n = \sqrt{\frac{g}{l}}, \qquad T_{\text{period}} = 2\pi\sqrt{\frac{l}{g}}

Notice that the rod tension never appeared. That is the whole point of the method.

Worked Example: Mass-Spring System

For a mass $m$ on a spring of stiffness $k$ with displacement $x$:

T=12mx˙2,V=12kx2T = \tfrac{1}{2}m\dot{x}^2, \qquad V = \tfrac{1}{2}kx^2

ddt(mx˙)+kx=0mx¨+kx=0\frac{d}{dt}(m\dot{x}) + kx = 0 \quad\Longrightarrow\quad m\ddot{x} + kx = 0

recovering the familiar undamped vibration equation with $\omega_n = \sqrt{k/m}$. Adding a viscous damper contributes a generalised force $Q = -c\dot x$, producing $m\ddot x + c\dot x + kx = 0$ — the same equation treated at length in the Vibrations chapter.

Test Your Knowledge

In the principle of virtual work, constraint and reaction forces are excluded from the work equation because they:

A
B
C
D
Test Your Knowledge

The Lagrangian of a mechanical system is defined as:

A
B
C
D
Test Your Knowledge

Applying Lagrange's equation to a simple pendulum of length l yields the equation of motion in which the angular acceleration equals:

A
B
C
D
Test Your Knowledge

A conservative system is in equilibrium at a configuration where the second derivative of total potential energy with respect to the coordinate is positive. The equilibrium is:

A
B
C
D