Back to the on-screen lesson ·

Differential equations of oscillation

$\ddot{x} = -\omega^2x$ with $\omega = \sqrt{k/m}$, its solutions fitted to starting conditions, energy in the oscillation, vertical springs, and springs in series and parallel.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to solve the equation of simple harmonic motion for any start, find periods, speeds and energies, and combine springs.

2. What you already have

From Physics 1 you know Hooke's law, the period of a mass on a spring, and energy in oscillations. Earlier lessons of this course wrote Newton's second law as a differential equation and differentiated sines and cosines. This lesson solves the equation a spring gives, the most important differential equation in physics, and fits its solution to any starting conditions.

3. Words for this lesson

TermWhat it means
Simple harmonic motionMotion obeying $\ddot{x} = -\omega^2x$, a sinusoid in time.
Angular frequency$\omega = \sqrt{k/m}$, in rad/s; $f = \omega/2\pi$ and $T = 2\pi/\omega$.
Amplitude$A$, the largest displacement from equilibrium.
Phase constant$\phi$, which fixes where in its cycle the motion starts.
Equilibrium positionWhere the net force is zero; for a hanging spring, stretched by $mg/k$.
Springs in parallelSide by side: $k = k_1 + k_2$.
Springs in seriesEnd to end: $1/k = 1/k_1 + 1/k_2$.

4. Solving the spring's equation

A mass $m$ on a spring of stiffness $k$ feels $F = -kx$, so Newton's second law is

$$m\ddot{x} = -kx \quad\Rightarrow\quad \ddot{x} = -\omega^2x, \qquad \omega = \sqrt{\frac{k}{m}}.$$

The equation asks for a function whose second derivative is minus a constant times itself. Sines and cosines do exactly that, and the general solution, with two constants because the equation is second order, can be written

$$x(t) = A\cos(\omega t + \phi) = B_1\cos\omega t + B_2\sin\omega t.$$

The amplitude $A$ and phase $\phi$, or $B_1$ and $B_2$, come from the starting position and velocity: $x(0) = B_1$ and $\dot{x}(0) = \omega B_2$. The period $T = 2\pi/\omega = 2\pi\sqrt{m/k}$ depends only on the mass and the spring, not on the amplitude. Energy moves back and forth between the spring and the mass, with a constant total $E = \tfrac{1}{2}kA^2 = \tfrac{1}{2}mv_{\max}^2$.

Another way: picture

Picture a point moving steadily around a circle and look at its shadow on a wall. The shadow slides back and forth, fastest in the middle and pausing at the ends: simple harmonic motion. The point's angular speed around the circle is $\omega$, and where it started on the circle is the phase. That is why sines and cosines, the coordinates of circular motion, describe oscillation.

Another way: steps

  1. Write $m\ddot{x} = -kx$ about the equilibrium, and read off $\omega = \sqrt{k/m}$.
  2. Write $x = B_1\cos\omega t + B_2\sin\omega t$.
  3. Set $B_1 = x(0)$ and $B_2 = \dot{x}(0)/\omega$.
  4. Amplitude $A = \sqrt{B_1^2 + B_2^2}$; period $2\pi/\omega$.
  5. Speeds from energy: $v = \omega\sqrt{A^2 - x^2}$.

5. Why sines and cosines

Differentiate $x = \cos\omega t$ twice: $\dot{x} = -\omega\sin\omega t$ and $\ddot{x} = -\omega^2\cos\omega t = -\omega^2x$. The same works for $\sin\omega t$, and for any combination of the two, because the equation is linear: sums and multiples of solutions are solutions. A second-order equation needs two independent solutions, and these are they.

The two ways of writing the answer are equivalent. Expanding $A\cos(\omega t + \phi)$ gives $A\cos\phi\cos\omega t - A\sin\phi\sin\omega t$, so $B_1 = A\cos\phi$ and $B_2 = -A\sin\phi$. The first form shows the amplitude directly; the second makes fitting the starting conditions a matter of reading off two numbers.

6. Fitting the starting conditions

Every oscillation is fixed by where the mass starts and how fast it is moving. Released from rest at $x_0$: $B_1 = x_0$ and $B_2 = 0$, so $x = x_0\cos\omega t$. Kicked from equilibrium with velocity $v_0$: $B_1 = 0$ and $B_2 = v_0/\omega$, so $x = (v_0/\omega)\sin\omega t$.

Started with both a displacement and a velocity, the amplitude is $A = \sqrt{x_0^2 + (v_0/\omega)^2}$, larger than either alone. A mass pulled $3$ cm out and given a push of $0.4$ m/s at $\omega = 10$ rad/s swings with amplitude $5$ cm. Checking that $x(0)$ and $\dot{x}(0)$ reproduce the given values is the fastest way to catch a mistake in a solution.

7. Energy in the oscillation

The spring stores $\tfrac{1}{2}kx^2$ and the mass carries $\tfrac{1}{2}mv^2$. With $x = A\cos\omega t$, their sum is $\tfrac{1}{2}kA^2(\cos^2\omega t + \sin^2\omega t) = \tfrac{1}{2}kA^2$, constant, using $m\omega^2 = k$. At the ends the energy is all in the spring; at the center it is all in the mass.

Energy gives speeds without the time. From $\tfrac{1}{2}mv^2 + \tfrac{1}{2}kx^2 = \tfrac{1}{2}kA^2$, the speed at any position is $v = \omega\sqrt{A^2 - x^2}$, largest, $A\omega$, at the center. The largest acceleration is at the ends, $A\omega^2$. Doubling the amplitude doubles both, and quadruples the energy, but leaves the period unchanged.

8. A spring hanging vertically

Hang a mass on a spring and it stretches until $k\Delta y = mg$. Measure displacement $y$ from that new equilibrium: the spring force is $-k(\Delta y + y)$ and gravity $mg$, which cancel the $k\Delta y$ part, leaving $m\ddot{y} = -ky$. Gravity has moved the equilibrium but not changed the equation or the frequency.

This is a general lesson: a constant force added to a spring only shifts where the oscillation is centered. It also gives a quick way to find a spring's frequency: $\omega^2 = k/m = g/\Delta y$. A mass that stretches its spring by $10$ cm oscillates at $\omega = \sqrt{9.8/0.10} \approx 9.9$ rad/s, whatever the mass or the spring.

9. Springs in combination

Two springs side by side, both attached to the mass, stretch by the same amount and each pulls with its own force, so their stiffnesses add: $k = k_1 + k_2$. The combination is stiffer and oscillates faster.

Two springs end to end carry the same force, and their stretches add. Then $1/k = 1/k_1 + 1/k_2$, and the combination is softer than either spring alone. Two identical springs in series have half the stiffness of one, and a mass on them oscillates at $1/\sqrt{2}$ of the single-spring frequency. Engineers use these rules to tune mountings and suspensions, and the same rules, turned around, describe capacitors in the circuits lessons.

10. The method, step by step, and how to check it

  1. Find the equilibrium and measure displacements from it.
  2. Write the equation $m\ddot{x} = -kx$, with the effective $k$ for combined springs.
  3. Solve with $B_1\cos\omega t + B_2\sin\omega t$ and fit the starting conditions.
  4. Use energy for speeds at positions, and the solution for positions at times.

Checking an answer. The solution must satisfy $\ddot{x} = -\omega^2x$ when differentiated twice, and must reproduce $x(0)$ and $\dot{x}(0)$. The period must not depend on the amplitude. A heavier mass must oscillate more slowly, a stiffer spring faster. And the speed must be zero at the turning points and largest at equilibrium.

11. Why this equation is everywhere

Any system slightly disturbed from a stable equilibrium feels a restoring force roughly proportional to the disturbance, so its motion obeys the same equation with its own $\omega$. A pendulum, a floating buoy, a vibrating guitar string's fundamental, the air in a bottle when you blow across it, and the charge in an LC circuit all oscillate this way.

That universality is why engineers learn one solution and use it in thousands of designs. The quartz crystal in a watch vibrates at $32{,}768$ Hz as a tiny mass on a stiff spring; a skyscraper sways at a fraction of a hertz as a huge mass on a flexible one. In each case the design question is the same: what is $k$, what is $m$, and so what is $\sqrt{k/m}$?

12. Resonance, briefly

A spring system has its own frequency, $\omega = \sqrt{k/m}$, and pushing it periodically at that frequency makes each push add to the motion. The amplitude builds until friction removes energy as fast as the pushes add it: resonance. Pushing at other frequencies produces much smaller motion.

Car suspensions, washing machines and tall buildings are all designed with resonance in mind, keeping their natural frequencies away from the frequencies they are likely to be driven at. The dampers added to real systems, shock absorbers in cars, are what keep a resonance from building up; the university mechanics course develops damped and driven oscillators in full.

13. Reading position, velocity and acceleration together

Differentiating $x = A\cos(\omega t + \phi)$ gives $v = -A\omega\sin(\omega t + \phi)$ and $a = -A\omega^2\cos(\omega t + \phi) = -\omega^2x$. The velocity runs a quarter cycle ahead of the position, and the acceleration is always opposite the displacement, which is the restoring force at work.

This gives three quick checks on any graph of the motion. Where $x$ peaks, $v$ is zero and $a$ is most negative. Where $x$ crosses zero going up, $v$ is largest and $a$ is zero. And the ratios of the peak values, $v_{\max}/x_{\max} = \omega$ and $a_{\max}/v_{\max} = \omega$, both give the angular frequency, so a single motion-sensor trace recorded in a high school lab measures $\omega$ three independent ways.

14. Position, velocity and acceleration together

Three curves against time in seconds for a mass released from rest at x = 1 m with angular frequency 1 rad/s. Position follows cos t, starting at its peak. Velocity follows −sin t, a quarter cycle ahead: zero at the ends of the swing and greatest passing through the center. Acceleration follows −cos t, always opposite to the position, largest at the ends where the spring pulls hardest.
Three curves against time in seconds for a mass released from rest at x = 1 m with angular frequency 1 rad/s. Position follows cos t, starting at its peak. Velocity follows −sin t, a quarter cycle ahead: zero at the ends of the swing and greatest passing through the center. Acceleration follows −cos t, always opposite to the position, largest at the ends where the spring pulls hardest.

The three curves are $x = \cos t$, $v = -\sin t$ and $a = -\cos t$ for a mass released from rest at $1$ m with $\omega = 1$ rad/s. The velocity curve is the slope of the position curve, and the acceleration curve the slope of the velocity curve. The acceleration is always the mirror image of the position, which is the equation $\ddot{x} = -\omega^2x$ drawn as a picture. The mass moves fastest where it crosses the center and stops at the ends, where the acceleration is largest.

15. In the world: how a car rides

Each corner of a car is a mass on a spring. A corner carrying $400$ kg on a $40{,}000$ N/m spring has $\omega = \sqrt{40{,}000/400} = 10$ rad/s, a bounce frequency of $1.6$ Hz. Suspension engineers in Detroit aim for frequencies around $1$ to $1.5$ Hz for comfortable family cars, close to the pace of walking, which people find natural, and higher for sports cars that need to corner flat.

Loading the car lowers the frequency, since $m$ rises; heavy trucks use stiffer springs, or springs that stiffen as they compress, to keep the ride from becoming slow and floaty when loaded. The dampers, shock absorbers, then take energy out of each bounce so the car settles after a bump instead of oscillating down the road.

16. In the world: the quartz crystal in a watch

A quartz watch keeps time with a tiny tuning fork of quartz crystal, cut so that it vibrates at exactly $32{,}768$ Hz, which is $2^{15}$. Its prongs act as a mass on a stiff spring, and quartz is piezoelectric: squeezing it makes a voltage, and a voltage bends it, so a circuit can drive the vibration and count it.

Because the period of a harmonic oscillator does not depend on its amplitude, small changes in the drive do not change the rate, and a quartz watch gains or loses only seconds a month. Dividing the count by two fifteen times gives one pulse a second. Quartz timekeeping, made practical in the 1960s, runs nearly every clock, phone and computer in use today.

17. Gravity shifts a hanging spring's equilibrium, not its frequency

Hanging a mass from a spring stretches it, and it seems that gravity should change how the mass oscillates. It does not. Measured from the stretched equilibrium, the equation is still $m\ddot{y} = -ky$ and the frequency still $\sqrt{k/m}$. Gravity only moves the center of the oscillation down by $mg/k$.

A second error is to think a larger amplitude means a longer period, as for a longer trip. For a spring, a larger amplitude brings a proportionally larger speed, and the period is exactly the same.

18. Release from rest

  1. A $0.50$ kg mass on a $200$ N/m spring is pulled $0.10$ m and released. Find the angular frequency.

    $\omega = \sqrt{\dfrac{200}{0.50}} = 20\ \text{rad/s}$

    Stiffness over mass.

  2. Write the position.

    $x = 0.10\cos(20t)\ \text{m}$

    Released from rest at the amplitude.

  3. Find the period.

    $T = \dfrac{2\pi}{20} = 0.314\ \text{s}$

    Independent of the $0.10$ m.

  4. Find the greatest speed.

    $v_{\max} = A\omega = 0.10 \times 20 = 2.0\ \text{m/s}$

    At equilibrium.

  5. Find the energy.

    $E = \tfrac{1}{2} \times 200 \times 0.10^2 = 1.0\ \text{J}$

    Check: $\tfrac{1}{2} \times 0.50 \times 2.0^2 = 1.0$ J.

19. A start with both position and velocity

  1. A glider with $\omega = 10$ rad/s starts at $x = 0.030$ m moving at $0.40$ m/s. Write the general solution.

    $x = B_1\cos 10t + B_2\sin 10t$

    Two constants to fit.

  2. Fit the starting position.

    $B_1 = 0.030\ \text{m}$

    At $t = 0$ only the cosine survives.

  3. Fit the starting velocity.

    $10B_2 = 0.40 \Rightarrow B_2 = 0.040\ \text{m}$

    Differentiate and set $t = 0$.

  4. Find the amplitude.

    $A = \sqrt{0.030^2 + 0.040^2} = 0.050\ \text{m}$

    The two parts combine at right angles.

  5. Find the greatest speed.

    $v_{\max} = 0.050 \times 10 = 0.50\ \text{m/s}$

    Faster than its starting speed.

  6. Check the speed at the start with energy.

    $v = 10\sqrt{0.050^2 - 0.030^2} = 10 \times 0.040 = 0.40\ \text{m/s}$

    It matches the given velocity.

20. A hanging spring

  1. A $2.0$ kg mass hung on a spring stretches it $0.098$ m. Find the spring constant.

    $k = \dfrac{mg}{\Delta y} = \dfrac{2.0 \times 9.8}{0.098} = 200\ \text{N/m}$

    Equilibrium: spring force equals weight.

  2. Write the equation about the new equilibrium.

    $m\ddot{y} = -ky$

    Gravity cancels the equilibrium stretch.

  3. Find the angular frequency.

    $\omega = \sqrt{\dfrac{200}{2.0}} = 10\ \text{rad/s}$

    Same as $\sqrt{g/\Delta y}$.

  4. It is pulled $0.050$ m further and released. Write the motion.

    $y = 0.050\cos 10t\ \text{m}$

    Measured from equilibrium.

  5. Find the greatest spring force.

    $F = k(\Delta y + A) = 200 \times 0.148 = 29.6\ \text{N}$

    At the lowest point.

  6. Find the least spring force.

    $F = k(\Delta y - A) = 200 \times 0.048 = 9.6\ \text{N}$

    At the highest point; still stretched.

21. Your turn: a $0.20$ kg mass on an $80$ N/m spring swings with amplitude $0.05$ m. Find its greatest speed.

  1. Find the angular frequency.

    $\omega = \sqrt{\dfrac{80}{0.20}} = 20\ \text{rad/s}$

    Stiffness over mass.

  2. Multiply by the amplitude.

    $v_{\max} = 0.05 \times 20$

    Greatest at equilibrium.

  3. Your turn: work this step out. Its working is at the end of the packet.

    Evaluate the speed.

22. Guided practice

A mass on a spring oscillates with period $0.5$ s. The mass is replaced by one four times as heavy. What is the new period?

23. Guided practice

Complete the worked solution: springs of $12$ N/m and $4$ N/m can hold a $4$ kg mass side by side or end to end. Find the combined stiffness side by side and end to end, in N/m, and $\omega^2$ for the mass on the end-to-end pair, in s⁻².

  1. Add the stiffnesses for springs side by side.

    $k_{\parallel} = k_1 + k_2 =$ p

    Both stretch the same amount and share the load.

  2. Combine the reciprocals for springs end to end.

    $k_{\text{series}} = \dfrac{k_1k_2}{k_1 + k_2} =$ q

    Both carry the full load and their stretches add.

  3. Divide the series stiffness by the mass.

    $\omega^2 = \dfrac{k_{\text{series}}}{m} =$ w

    The mass oscillates on the combined spring.

  4. Check the ordering of the stiffnesses.

    $\text{series} < \text{either spring} < \text{parallel}$

    End to end is softer than either; side by side is stiffer.

24. Guided practice

Match each part of simple harmonic motion to its expression.

$\ddot{x} = -\omega^2x$$A\cos(\omega t + \phi)$$\sqrt{k/m}$$\tfrac{1}{2}kA^2$
equation of motion
general solution
angular frequency
total energy

25. Practice

A $4$ kg mass hangs from a spring of stiffness $64$ N/m and oscillates vertically with amplitude $0.1$ m. With $g = 10$ m/s², fill in its angular frequency in rad/s, how far the spring is stretched at equilibrium in m, and the mass's greatest speed in m/s.

value
angular frequency (rad/s)
equilibrium stretch (m)
greatest speed (m/s)

26. Practice

A glider on a spring has $\omega = 4$ rad/s. At $t = 0$ it passes through equilibrium, $x = 0$, moving at $32$ cm/s in the positive direction. Write its position $x$, in cm, as a formula in $t$.

Answer:

27. Practice

A mass on a spring oscillates with amplitude $13$ cm and $\omega = 9$ rad/s. How fast is it moving when it is $12$ cm from equilibrium, in cm/s?

Answer: cm/s at that point

28. Somewhere new

An engineer in Detroit models one corner of a car as $400$ kg riding on a spring of stiffness $40000$ N/m. Ignoring the damper, at what frequency does that corner bounce, in hertz?

Answer: Hz bounce frequency

29. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

30. Test question

A glider on a spring has $\omega = 2$ rad/s. At $t = 0$ it passes through equilibrium, $x = 0$, moving at $12$ cm/s in the positive direction. Write its position $x$, in cm, as a formula in $t$.

Answer:

31. What you can do now

You can solve oscillation problems. Explain to someone why hanging a spring vertically does not change how fast a mass on it bounces.

Working for the steps left to you

21. Your turn: a $0.20$ kg mass on an $80$ N/m spring swings with amplitude $0.05$ m. Find its greatest speed., step 3

$v_{\max} = 1.0\ \text{m/s}$

Independent of where it started in the cycle.