Inhomogeneous theory
The solution method for homogeneous second-order linear equations is part of the solution method for inhomogeneous ones. The homogeneous theory provides the parameters, while a single “particular” solution to the inhomogeneous equation provides an “offset.” This offset shifts the vector space of solutions to the homogeneous equation over to the affine space of solutions to the inhomogeneous equation.
The situation is exactly akin to that of solutions to homogeneous and inhomogeneous matrix equations,
A generic second-order linear inhomogeneous ODE is given as follows:
This ODE determines a corresponding homogeneous ODE:
Given two “independent” solutions
Given a single particular solution
Variation of parameters
The method of variation of parameters is to change a constant value parameter like
Discovering a second solution
Suppose we are given a single solution
Let us propose the hypothesis that there is a solution
This solution
which we continue to solve as by separation of variables:
(We have allowed an abuse of notation by letting
This method always works! That is, it provides a second solution in terms of a first solution and two integrations.
This method is enough to explain the
Example
Variation of parameters: double repeated roots
Suppose
is an ODE with and therefore and is a repeated root. We have seen that is one solution. Let us change the parameter in the family to a function and plug it in: This quantity is zero when
, which happens when and . It is enough to consider the specific case because the other parameters are already accounted for when we take the span to obtain the complete set of solutions:
Example
Variation of parameters: second nontrivial solution from trivial guess
Problem: Find a complete family of solutions to the ODE given by
. Solution: This ODE is reducible to first order because
does not appear. However, let us use variation of parameters to solve it. Write it as . Notice first that is a (rather trivial) solution. Look for a second solution of the form . Using the formula, we have: So
is a second solution, and the complete family is given by .
Question 09-01
Variation of parameters: triple repeated root
Suppose
, and suppose for some . Use variation of parameters to find two (independent) additional solutions besides .
Question 09-02
Variation of parameters: Legendre second solution
The Legendre equation for
is . One solution is . Find a second solution.
Exercise 09A-01
Variation of parameters: double repeated root, inhomogeneous
Find a complete set of solutions to the ODE given by
.
Exercise 09A-02 = Problem 09-02
Variation of parameters: second solution from one obvious.
Find a complete set of solutions to the ODE given by
.
Particular solution of inhomogeneous
The same strategy, with a complication, will provide a particular solution to an inhomogeneous equation by variation of the parameters of the complete set of solutions to its corresponding homogeneous equation.
Suppose
As before, we substitute this form for
Now for the new complication of this method. It will be very convenient to add the additional constraint that
Plugging the rest back into the equation, we find:
So it will be enough to solve this last equation simultaneously with our constraint equation, namely to solve the system:
Given
Therefore, setting
we have a solution
Example
Solving an inhomogeneous equation
Problem: Find a complete set of solutions to the ODE given by
. Solution: The corresponding homogeneous ODE is
, which has characteristic equation , and its general solution is therefore . To find a particular solution to the inhomogeneous, we consider varying parameters. Let
and . Using the formulas above for and , we compute: (Notice, again, that we will not need the integration constants, since those will lead to repeat part of the homogeneous solution.)
Adding the particular inhomogeneous solution to the general homogeneous solution, we find the complete family:
Exercise 09A-03
Solving inhomogeneous linear ODE
Find a complete set of solutions to the ODE given by
.
Exercise 09A-04
Solving inhomogeneous linear ODE
Find a complete set of solutions to the ODE given by
.
Exercise 09A-05
Solving inhomogeneous linear ODE
Find a complete set of solutions to the ODE given by
, where are constants.
Exercise 09A-06
Superposition and sums of forcing terms
Find a complete set of solutions to the ODE given by
. (Hint: add two particular solutions together, each solving an inhomogeneous equation corresponding to a single one of the forcing terms.)
Applications
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
Undamped case
The case
For application purposes, it is useful to consider formulas like the above in a different format, using a trig identity:
Considering the form
The relation
You are encouraged to manipulate the parameters of
Adding damping
Now suppose we allow
Let use write
Case 1: Overdamping
https://www.desmos.com/calculator/yn9bcqflf9

Case 2: Underdamping
where we set 
Case 3: Critical Damping
Rewriting in terms of initial
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
Exercise 09B-01
Driven undamped harmonic oscillator amplitude
Show that the above ODE has a bona fide (particular) solution given by
, where
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
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
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.
Exercise 09B-02
Checking ZSR and ZIR
Verify that
and are given correctly.
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
The ZSR is new and interesting. We have:
This formula shows that the amplitude of the ZSR has a distinctive peak of 
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
Problems due Monday 18 Mar 2024 by 1:00pm
Problem 09-01
Superposition and sums of forcing terms
Find a complete set of solutions to the ODE given by
.
Problem 09-02
Discovering a second solution
Find a formula (maybe involving integrals) for the complete family of solutions to the following ODE:
Your answer should be written in terms of the unknown function
. Hint: first guess an easy solution.
Problem 09-03
Variation of parameters
Using variation of parameters, find particular solutions to the following ODEs:
- (a)
- (b)
Problem 09-04
Fourier solution
Using variation of parameters, show that the solution to the IVP
is given by
.
Problem 09-05
Quasi-frequency
An underdamped harmonic oscillator vibrates at some “quasi-frequency”
. This is not a true frequency because the motion is not truly periodic, due to its decay over time. Find a formula for the ratio where is the natural frequency of the undamped harmonic oscillator with the same mass and spring. Does the damped oscillator vibrate with a faster or slower frequency than the same oscillator without damping? What happens to as and thus ?
Problem 09-06
Bobbing buoy
A cylindrical buoy
in diameter bobs in water with its axis vertical. The density of water is . The period of its bobbing oscillation motion is . How heavy is the buoy?