  The Ernst formulation of the Einstein equations is generalised to accommodate
$f(R)$ theories of gravity. It is shown that, as in general relativity, the
axisymmetric $f(R)$ field equations for a vacuum spacetime that is either
stationary or cylindrically symmetric reduce to a single, non-linear
differential equation for a complex-valued scalar function. As a worked
example, we apply the generalised Ernst equations to derive a $f(R)$
generalisation of the Zipoy-Voorhees metric, which may be used to describe the
gravitational field outside of an ellipsoidal neutron star. We also apply the
theory to investigate the phase speed of large-amplitude gravitational waves in
$f(R)$ gravity in the context of soliton-like solutions that display shock-wave
behaviour across the causal boundary.
