A child rises on a swing by changing the length of its chain. This is explained by the mathematical fact that the product of two elliptic symplectic matrices can be hyperbolic. The connection could be helpful in teaching both mechanics and matrices. A Hamiltonian formulation avoids an error. Random swinging is unlikely to succeed.