DIFFERENTIAL EQUATIONS • SECOND-ORDER LINEAR ODES

Mass-Spring Systems

Discover how differential equations model the bouncing, swinging, and vibrating world around you.

Historical Context & Motivation

If you have ever watched a weight bobbing on a spring or felt a car bounce over a speed bump, you have witnessed a mass-spring system in action. For centuries, scientists and engineers have studied these oscillating systems to understand everything from clock pendulums to earthquake-resistant buildings. The mathematics behind a bouncing spring turns out to be the same mathematics that describes electrical circuits, sound waves, and even the suspension on your bike.

The story of mass-spring systems is really the story of how scientists learned to translate physical motion into equations — and then solve those equations to predict the future. That journey stretches across several centuries and involves some of history's greatest mathematical minds.

1660
Hooke's Law
Robert Hooke publishes his observation that the force a spring exerts is proportional to how far it is stretched. This simple relationship, F = −kx, becomes the foundation for modeling spring behavior.
1687
Newton's Second Law
Isaac Newton formulates F = ma, providing the framework to connect spring force to the acceleration of a mass. Combining Hooke's and Newton's laws produces a second-order differential equation.
1739
Euler's Solutions
Leonhard Euler develops systematic methods for solving second-order linear differential equations using exponential functions, giving mathematicians a toolkit for finding exact solutions to spring problems.
1822
Fourier's Heat & Vibrations
Joseph Fourier shows that complex vibrations can be decomposed into sums of simple oscillations. This idea eventually links mass-spring models to acoustics, music, and signal processing.
1900s
Modern Engineering Applications
Engineers apply mass-spring differential equations to design car suspensions, seismometers, and electronic filters. The same second-order ODE appears across dozens of technologies we use every day.

The central question these scientists pursued was deceptively simple: if you pull a mass on a spring and let go, exactly how does it move over time? Answering that question requires setting up and solving a second-order linear ODE — the main skill you will develop in this lesson. Note that this topic goes beyond standard high school curricula such as AP Calculus or AP Physics; it is typically studied in a college-level differential equations course. The material here is presented to introduce these powerful ideas to motivated advanced learners, with extra explanation provided at each step.

Core Principles & Definitions

Before diving into equations, you need a clear picture of the physical ingredients in a mass-spring system and the laws that connect them. Every mass-spring problem boils down to a few core ideas. If some of the mathematical notation below is new to you, don't worry — each term is explained in plain language alongside the symbols.

1

Hooke's Law

A spring's restoring force is proportional to its displacement from equilibrium: Fspring = −kx. The constant k (spring constant) measures stiffness. The minus sign means the force always pushes back toward the resting position. You may have seen this in a physics class — it is the same law used to describe rubber bands and bungee cords.
2

Newton's Second Law

The net force on an object equals its mass times its acceleration: Fnet = ma. In calculus, acceleration is the second derivative of position with respect to time, written a = x″(t). This notation means we differentiate the position function twice. Combining this with Hooke's Law turns the physics into a differential equation.
3

Damping

Friction and air resistance slow the motion over time. A common model for damping assumes the resistive force is proportional to velocity: Fdamp = −bx′, where b is the damping coefficient and x′ is velocity (the first derivative of position).
4

External Forcing

Sometimes an outside influence — like someone repeatedly pushing a child on a swing — drives the system. This external force F(t) appears on the right-hand side of the ODE and turns the equation from homogeneous to non-homogeneous.
5

Equilibrium Position

The equilibrium position is where the spring is neither stretched nor compressed. Displacement x(t) is always measured from this resting point. All the forces balance to zero here.
📐 Prerequisite Note
This lesson uses calculus notation such as x′(t) for velocity (the rate of change of position) and x″(t) for acceleration (the rate of change of velocity). If you have taken or are currently taking AP Calculus AB or BC, you have seen derivatives written as f′(x). Here we apply the same idea to motion: differentiating the position function once gives velocity, and differentiating again gives acceleration. The rest of the notation is introduced step by step.
KEY TAKEAWAY
Think of a mass on a spring like a ball rolling back and forth inside a curved bowl. Gravity always pulls the ball toward the bottom (equilibrium), just like the spring always tugs the mass back toward its resting position. Friction with the bowl gradually steals energy, so the ball eventually settles — that is damping. If you keep tapping the bowl rhythmically, that is an external force. The differential equation is simply the mathematical recipe that tracks the ball's exact position at every moment.

Visual Explanation

The diagram below shows a horizontal mass-spring system in three key positions. Understanding these positions will help you see where the forces, velocity, and displacement relate to each other in the differential equation.

In panel A the spring is stretched to the right (x > 0), so the restoring force pulls left. In panel B the mass sits at equilibrium and experiences no spring force. In panel C the spring is compressed (x < 0), so the force pushes right. Notice that the force arrow always points toward the equilibrium position.

The key observation is that the restoring force always opposes the displacement. When the mass is pulled to the right, the force acts to the left; when the mass is pushed to the left, the force acts to the right. This self-correcting behavior is what causes the mass to oscillate back and forth, and it is the physical reason a second-order ODE arises: the acceleration (second derivative of position) is proportional to the position itself.

Mathematical Framework

Now let's combine Hooke's Law and Newton's Second Law into a single equation and learn how to solve it. We will start with the simplest case — no friction, no external force — and then layer on complexity. Each algebraic step is explained in detail so you can follow along even if some of the ideas are new.

Setting Up the ODE

Newton's Second Law says the sum of all forces equals ma. For a spring with damping and an external force, the three forces are: the spring restoring force (−kx), the damping force (−bx′), and the external driving force F(t). Since acceleration is x″(t) (the second derivative of position with respect to time), we write:

GENERAL MASS-SPRING ODE
mx″ + bx′ + kx = F(t)
m = mass (kg), b = damping coefficient (N·s/m), k = spring constant (N/m), F(t) = external force (N), x″ = d²x/dt² (acceleration), x′ = dx/dt (velocity).

The Simple (Undamped, Unforced) Case

When there is no damping (b = 0) and no external force (F(t) = 0), the equation simplifies to:

SIMPLE HARMONIC OSCILLATOR
mx″ + kx = 0 → x″ + ω₀²x = 0
Here ω₀ = √(k/m) is the natural angular frequency (rad/s). It tells you how fast the system oscillates. A stiffer spring (larger k) or a lighter mass (smaller m) both increase ω₀ and make the system oscillate faster.

The general solution to this equation is a combination of sine and cosine:

GENERAL SOLUTION — UNDAMPED
x(t) = C₁ cos(ω₀t) + C₂ sin(ω₀t)
C₁ and C₂ are constants determined by initial conditions: the starting position x(0) and starting velocity x′(0). For example, if the mass starts at rest at position x₀, then C₁ = x₀ and C₂ = 0, giving pure cosine motion.

The Characteristic Equation Approach

To solve second-order linear ODEs with constant coefficients, mathematicians use a clever substitution: guess that the solution has the form x = ert for some unknown number r. The reason this works is that exponential functions have the special property that their derivatives are proportional to themselves, so every term in the ODE becomes a multiple of ert. Substituting into mx″ + bx′ + kx = 0 and dividing by ert (which is never zero) yields the characteristic equation — a regular quadratic equation in r that you can solve with the quadratic formula:

CHARACTERISTIC EQUATION
mr² + br + k = 0
Solve using the quadratic formula: r = (−b ± √(b² − 4mk)) / (2m). The expression b² − 4mk is called the discriminant. Just like the discriminant of a quadratic tells you whether it has two real roots, one repeated root, or two complex roots, the discriminant here tells you which type of motion the spring exhibits.

Three Damping Cases

The discriminant of the characteristic equation — the expression under the square root — controls whether the mass oscillates, crawls back to rest, or does something in between. There are three distinct cases, and each produces a different type of motion and a different form of the general solution.

All three curves start from the same initial displacement. The underdamped case (cyan) oscillates with decreasing amplitude. The critically damped case (amber) returns to equilibrium as fast as possible without oscillating. The overdamped case (pink) returns slowly without oscillation.
Summary of the three damping cases based on the discriminant of the characteristic equation.
CaseDiscriminantRootsGeneral Solution
Underdampedb² − 4mk < 0Complex: r = α ± βix(t) = eαt(C₁cos βt + C₂sin βt)
Critically Dampedb² − 4mk = 0Repeated real: r₁ = r₂x(t) = (C₁ + C₂t)ert
Overdampedb² − 4mk > 0Two distinct real: r₁ ≠ r₂x(t) = C₁er₁t + C₂er₂t

In the underdamped solution, α = −b/(2m) controls how fast the oscillations die out (it is a negative number, so eαt shrinks toward zero), and β = √(4mk − b²)/(2m) controls how fast the mass oscillates. When there is zero damping, α = 0 and the exponential envelope disappears — you get pure, unending oscillation. The symbol i in the complex roots α ± βi is the imaginary unit (√(−1)). Although this may seem abstract, it is simply a mathematical tool; the final solution x(t) is always a real-valued function involving sines and cosines.

🚗 Real-World Connection
Car shock absorbers are designed to be slightly overdamped or critically damped. If they were underdamped, your car would bounce several times after hitting a pothole. If they were too heavily overdamped, the suspension would feel stiff and sluggish. Engineers tune the damping coefficient b to hit the sweet spot.

Worked Example

Let's work through a complete underdamped mass-spring problem from start to finish. Every algebraic step is shown and explained so you can follow along. This is the same process you will use on the practice problems.

🔑 What You Need for This Example
Steps 3–6 below use the quadratic formula (which you know from algebra), arithmetic with square roots, and the product rule from calculus (for differentiating a product of two functions). If the product rule is new to you, the key fact used here is: if x(t) = f(t)·g(t), then x′(t) = f′(t)·g(t) + f(t)·g′(t). Each place this is used is flagged in the explanation.
Underdamped Mass-Spring System
1
Step 1 — State the ProblemA 2 kg mass is attached to a spring with spring constant k = 50 N/m and a damper with coefficient b = 4 N·s/m. The mass is pulled 0.3 m from equilibrium and released from rest. Find x(t).
2
Step 2 — Write the ODESubstituting m = 2, b = 4, k = 50 into the general ODE mx″ + bx′ + kx = 0 gives: 2x″ + 4x′ + 50x = 0. Dividing every term by 2 simplifies the equation: x″ + 2x′ + 25x = 0. (Dividing through by the leading coefficient m makes the characteristic equation easier to work with.)
x″ + 2x′ + 25x = 0
3
Step 3 — Form and Solve the Characteristic EquationReplace x″ with r², x′ with r, and x with 1 to get the characteristic equation: r² + 2r + 25 = 0. Apply the quadratic formula r = (−b ± √(b² − 4ac)) / (2a) with a = 1, b = 2, c = 25: r = (−2 ± √(4 − 100)) / 2 = (−2 ± √(−96)) / 2. Since 96 = 16 × 6, we have √96 = 4√6, so √(−96) = 4√6 · i. Therefore r = (−2 ± 4√6 · i) / 2 = −1 ± 2√6 · i. Since √6 ≈ 2.449, we get r ≈ −1 ± 4.899i.
r = −1 ± 2√6 · i ≈ −1 ± 4.899i
4
Step 4 — Identify the CaseThe roots are complex (the discriminant 4 − 100 = −96 is negative), so this is the underdamped case. Reading off the real and imaginary parts: α = −1 (the real part, equal to −b/(2m) = −4/4 = −1 ✓) and β = 2√6 ≈ 4.899 rad/s (the imaginary part, which gives the oscillation frequency).
Underdamped: α = −1, β = 2√6 ≈ 4.899
5
Step 5 — Write the General SolutionFor complex roots α ± βi, the general solution is always written using real-valued sines and cosines multiplied by a decaying exponential. This form comes from Euler's formula (a college-level result connecting complex exponentials to trigonometry): x(t) = eαt(C₁ cos βt + C₂ sin βt). Substituting α = −1 and β = 2√6: x(t) = e−t(C₁ cos(2√6 t) + C₂ sin(2√6 t)). The factor e⁻ᵗ causes the amplitude to shrink over time, while the cosine and sine produce the oscillation.
x(t) = e⁻ᵗ(C₁ cos(2√6 t) + C₂ sin(2√6 t))
6
Step 6 — Apply Initial ConditionsWe know x(0) = 0.3 (starting position) and x′(0) = 0 (released from rest, so initial velocity is zero). From x(0) = 0.3: e⁰(C₁ · 1 + C₂ · 0) = C₁ = 0.3. To find C₂, we differentiate x(t) using the product rule (derivative of a product f·g is f′g + fg′, where f = e⁻ᵗ and g = C₁ cos(2√6 t) + C₂ sin(2√6 t)): x′(t) = −e⁻ᵗ(C₁ cos(2√6 t) + C₂ sin(2√6 t)) + e⁻ᵗ(−2√6 C₁ sin(2√6 t) + 2√6 C₂ cos(2√6 t)). Setting t = 0 and x′(0) = 0: −C₁ + 2√6 C₂ = 0, so C₂ = C₁/(2√6) = 0.3/(2√6) ≈ 0.0612.
C₁ = 0.3, C₂ = 0.3/(2√6) ≈ 0.0612
7
Step 7 — Write the Final AnswerPutting it all together:
x(t) = e⁻ᵗ(0.3 cos(2√6 t) + 0.0612 sin(2√6 t)). The mass oscillates with angular frequency 2√6 ≈ 4.90 rad/s while the amplitude decays exponentially with factor e⁻ᵗ. In practical terms: after 3 seconds the exponential factor e⁻³ ≈ 0.05, meaning the oscillations have shrunk to only 5% of their original size.

Strengths & Limitations of the Model

The linear mass-spring model is powerful and elegant, but like every mathematical model, it makes simplifying assumptions. Understanding what the model does well and where it breaks down will make you a more careful problem-solver.

Strengths and limitations of the linear mass-spring ODE model.
StrengthsLimitations
Produces exact, closed-form solutions that are easy to graph and interpret.Hooke's law is only accurate for small displacements. Large stretches violate the linear assumption.
Applies to many systems beyond literal springs: circuits, bridges, molecular bonds.Real damping may not be proportional to velocity (e.g., dry friction is roughly constant).
Superposition principle holds: you can add solutions together for more complex situations.Nonlinear springs require numerical methods — no neat sine/cosine formulas.
Only two initial conditions needed (position and velocity) to determine the entire future motion.Ignores effects like mass of the spring itself, which matters for very precise engineering.
KEY TAKEAWAY
The mass-spring ODE is like a weather forecast model: incredibly useful for predicting behavior under normal conditions, but the predictions become less reliable when pushed to extremes. Just as a weather model assumes the atmosphere follows certain rules, the spring model assumes forces stay proportional. Within that range, the model is remarkably accurate — and the same equation appears everywhere from guitar strings to radio circuits.

Connection to Advanced Theory

The mass-spring equation you learned in this lesson is your gateway to a huge family of problems in higher mathematics and engineering. Here is a glimpse of where these ideas lead — most of these extensions are studied in college-level courses in differential equations, linear algebra, and engineering mathematics.

How the mass-spring ODE connects to more advanced mathematical topics.
This LessonAdvanced Extension
Single mass on a single spring (1 degree of freedom)Coupled oscillators — systems of ODEs with matrices (linear algebra)
Constant coefficients m, b, kVariable coefficients — Bessel's equation, Legendre's equation (special functions)
Linear restoring force (Hooke's law)Nonlinear restoring force — Duffing equation, chaos theory
External force F(t) — non-homogeneous ODEResonance and frequency response — Laplace transforms, transfer functions
Discrete mass at a single pointContinuous vibrating string or membrane — partial differential equations (wave equation)

One of the most dramatic advanced phenomena is resonance. If an external periodic force matches the system's natural frequency, the amplitude grows dramatically — this is how opera singers can shatter wine glasses and how poorly designed bridges can collapse. In a differential equations course, you will see resonance emerge mathematically when the particular solution of the non-homogeneous ODE involves a factor of t that causes unbounded growth. These ideas are both fascinating and practically important.

Practice Problems

Test your understanding with these five problems. They increase in difficulty, so work through them in order. Try each one on paper before checking the answer. Problems 1 and 2 focus on conceptual understanding and the undamped case; Problems 3–5 extend into the full characteristic equation method covered in Sections 4–6.

PROBLEM 1CONCEPTUAL
A mass on a spring is released from rest at a displacement of 0.5 m. There is no damping and no external force. Will the mass ever stop moving? Explain your reasoning using the form of the solution to the undamped ODE.
PROBLEM 2BASIC CALCULATION
A 4 kg mass is attached to a spring with k = 36 N/m. There is no damping. Write the ODE, find the natural angular frequency ω₀, and state the general solution.
PROBLEM 3INTERMEDIATE
A mass-spring system is governed by x″ + 6x′ + 9x = 0. Determine whether the system is underdamped, critically damped, or overdamped. Then find the general solution.
PROBLEM 4APPLIED
A car's suspension can be modeled as a mass-spring-damper system. The car body has mass 1200 kg, the suspension spring constant is k = 48,000 N/m, and the shock absorber provides damping b = 9,600 N·s/m. After hitting a bump, the car is displaced 0.05 m with zero initial velocity. Write the ODE, determine the damping case, and find x(t). Is this suspension well-designed?
PROBLEM 5CRITICAL THINKING
Consider the ODE mx″ + bx′ + kx = 0 with m and k fixed. As you gradually increase the damping coefficient b from zero, describe how the motion changes qualitatively. What specific value of b marks the boundary between underdamped and overdamped? Use the discriminant to support your reasoning.

Lesson Summary

A mass-spring system is modeled by the second-order linear ODE mx″ + bx′ + kx = F(t), derived by combining Newton's Second Law with Hooke's Law. The characteristic equation mr² + br + k = 0 determines the nature of the roots, which in turn controls whether the system is underdamped (oscillates with decaying amplitude), critically damped (fastest non-oscillating return), or overdamped (slow, non-oscillating return). This content extends beyond standard high school curricula and previews college-level differential equations — the techniques here are a springboard into university mathematics and engineering.

For the undamped case, the solution is x(t) = C₁ cos(ω₀t) + C₂ sin(ω₀t), where the natural frequency ω₀ = √(k/m). The constants C₁ and C₂ are fixed by initial conditions: the starting position and velocity. This model applies far beyond literal springs — from electrical circuits to building design — making it one of the most important equations in all of science and engineering.

Varsity Tutors • Differential Equations • Mass-Spring Systems