For an idealized classical pendulum consisting of a point mass attached to a massless rigid rod of length attached to a stationary pivot, in the absence of friction and air resistance, the energy is given by[more]
where is the angular displacement from the vertical direction. The oscillation is presumed to occur between the limits , where to avoid the transition to a spherical pendulum. The exact solution for this classical problem is known (see, for example, ) and turns out to be very close to the behavior of a linear oscillator, for which can be approximated by . The natural frequency of oscillation is given by the series
where , the limiting linear approximation for the natural frequency (a result of great historical significance).
The nonlinear pendulum can be formulated as a quantum-mechanical problem represented by the Schrödinger equation
where . This has the form of Mathieu's differential equation, and its solutions are even and odd Mathieu functions of the form and . However, we describe a more transparent solution, which uses the Fourier series used to compute the Mathieu functions.
Accordingly, the solution of the Schrödinger equation is represented by a Fourier expansion
This can be put in a more compact form:
The matrix elements of the Hamiltonian are given by
in terms of a set of normalized basis functions
The built-in Mathematica function Eigensystem is then applied to compute the eigenvalues and eigenfunctions for , which are then displayed in the graphic.[less]
 A. Beléndez, C. Pascual, D. I. Méndez, T. Beléndez and C. Neipp, "Exact Solution for the Nonlinear Pendulum," Revista Brasileira de Ensino de Física, 29(4), 2007 pp. 645–648. doi:10.1590/S1806-11172007000400024.
 T. Pradhan and A. V. Khare, "Plane Pendulum in Quantum Mechanics," American Journal of Physics, 41(1), 1973 pp. 59–66. doi:10.1119/1.1987121.