Introduction
Second-order ODEs frequently arise in physics because the laws of physics are frequently given using principles of force or energy, and these quantities are related to basic state variables (position) using second derivatives. Consider Newton’s Law:
and the Lagrange equation (having to do with energy and “action”):
Many important second-order ODEs in physics are also linear. The basic case of constant coefficient second-order linear equations gives what is called the harmonic oscillator. Harmonic oscillators arise in various branches of physics, from mechanical vibrations to electrical resonance circuits. “The” harmonic oscillator is a class of mathematical models (with assorted parameters and forcing functions) that describe the various real oscillators in physics.
Damped harmonic oscillator
- A mechanical simple harmonic oscillator can be formed with a mass sliding frictionlessly over a surface, attached to a spring anchored to a wall.
- A basic damped harmonic oscillator can be formed by adding a “dashpot” that provides resistance to motion. Ordinary friction provides a resistance force that is independent of velocity, whereas a dashpot provides resistance that is proportional to velocity.

Let describe the position of the mass over time, with when the mass is resting statically. The spring force is given by , and the dashpot force is , where gives the spring constant and gives the dashpot constant. By Newton’s Law, , so we have . In other words:
Undamped case
The case corresponds to the absence of any dashpot. The resulting equation has characteristic equation with solutions . The complete set of solutions is therefore:
For application purposes, it is useful to consider formulas like the above in a different format, using a trig identity:
Considering the form , the parameter is called the amplitude, is the angular frequency or circular frequency, and is the phase angle or phase lag. The angular frequency is related to the true frequency and the period by:
The relation can be summarized by saying that the sum of sinusoidal functions with the same frequency is also a sinusoidal function.
You are encouraged to manipulate the parameters of on Desmos:
https://www.desmos.com/calculator/i9tpybmra9
Adding damping
Now suppose we allow . Let us write and , so then the ODE takes the form:
Let use write . The solutions to the characteristic polynomial are and when , and and when .
Case 1: Overdamping
When , there are two real roots. The solutions are negative exponentials and quickly die out:
https://www.desmos.com/calculator/yn9bcqflf9

Case 2: Underdamping
When , there are two imaginary roots. The solutions are decaying sinusoidal with continued oscillations that decay in amplitude:
where we set .
https://www.desmos.com/calculator/s9oyz7gtot

Case 3: Critical Damping
When , the situation is that of repeated roots, . The complete family of solutions is therefore:
Rewriting in terms of initial , starting at rest:
https://www.desmos.com/calculator/mjjyd54yf3

This critical damping case is very important in practical applications. The effect of critical damping is to dampen out oscillations (1) as quickly as possible, (2) without allowing “overshoot.”
Driven harmonic oscillator
In this section we consider more closely the effect of a sinusoidal forcing function, at first without any damping. Our ODE becomes:
We know that this ODE has a complete family of homogeneous solutions given by
Here we are writing for the angular frequency of the forcing function, while we write for the natural response frequency of the system.
Driven harmonic oscillator (part 2)
Notice! This amplitude is not free to vary as in the homogeneous case. It is determined by the driving function.
Notice something else! This amplitude goes to infinity when . The natural system response amplitude is called the resonant frequency and this phenomenon of a large response to a driving force that is oscillating in tune with the natural system frequency is called resonance. In real life, there is always some damping effect, and this will mitigate the actual infinity in the equation.
The complete family of solutions is given as usual by adding the homogeneous solutions to our bona fide solution:
Of course, the homogeneous solutions are simply superposed over the bona fide solution. (Added to it.)
The format of this solution is inconvenient because the homogeneous amplitude and phase lag is not necessarily apparent in the actual solution values , while on the other hand the initial conditions are also not apparent anywhere in the formula.
The concepts of Zero State Response (ZSR) and Zero Input Response (ZIR) are ideas from engineering that allow us to view the space of solutions in a more revealing format.
- Zero State Response refers to a bona fide solution with zero initial conditions: . We will write for this solution, where indicates the symbol for the forcing function.
- Zero Input Response refers to a homogeneous solution with given initial conditions: , . We will write for this solution, where indicates homogeneity.
In our case above, the ZSR is
and the ZIR is
The solution to any IVP will be the sum of the ZSR and a certain ZIR:
The former derives from the forcing function, and the latter derives from the initial conditions.
The purpose of these concepts is to treat the initial conditions as stimulating a homogeneous system response to the starting conditions, while the forcing function drives a particular solution (presumed starting from rest) that is layered on top. Any solution can be obtained in this way.
Driven, damped harmonic oscillator
In the final case we add damping to the driven harmonic oscillator, obtaining the ODE:
The complete family of homogeneous solutions depends (as above) on cases, giving overdamped, underdamped, and critically damped solution types:
As before, here we are using , , and . These solutions are essentially in ZIR form already.
The ZSR is new and interesting. We have:
This formula shows that the amplitude of the ZSR has a distinctive peak of at the resonant frequency . At this frequency, the phase lag is . Notice that the extra term in the radical prevents blowing up at .
https://www.desmos.com/calculator/hqlrgor3eb

Series RLC circuit
The current flowing around the electrical circuit with diagram:

is described by a differential equation that may be compared to the equation for mechanical vibrations of a mass + spring + dashpot system:
Here is a correspondence dictionary:

All the theory developed above applies to such a circuit.
MIT Mathlet links
Spring and dashpot, spring is driven | Spring and dashpot, dashpot is driven | [Spring and dashpot, both are driven](https://mathlets.org/mathlets/amplitude-and-phase-2nd-order-iii/ | Spring and dashpot, mass is driven | Damped vibrations | Forced, damped vibrations | Series RLC circuit