Solitary waves have captured the interest of numerous mathematicians and physicists since their first discovery by John Scott Russell in 1834. Scott Russell observed a single hump of water which he followed on horseback for more than a mile along a canal in Scotland. Mathematically, a solitary wave can be described as a stationary solution of a nonlinear PDE. Many different equations, arising in areas ranging from plasma physics to fibre optics, have such solutions. Scott Russell’s observation indicates that solitary water waves have good stability properties. Joseph Boussinesq suggested that the stability of a solitary wave could be proved by showing that it minimizes one conserved quantity (the energy), subject to the constraint that another conserved quantity (the momentum) is held fixed. One way of doing this rigorously is to use the direct methods of the calculus of variations. In my talk I will review the solitary-wave solution of the Korteweg-de Vries equation from this perspective. I will then describe a recent elaboration of the method which can be applied to some nonlocal equations of quasilinear type (including Whitham’s equation). For these equations one has to deal with a lack of coercivity.