PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

Related simulators

Continue with similar topics in this category — or all 85 in Classical Mechanics.

View category →
School

Spring-Mass System

Launch Simulator

Simple harmonic motion with adjustable spring constant and damping.

NewSchool

Inclined Plane: Work & η

Launch Simulator

W = F·s, friction and gravity work, ΔU, efficiency η = ΔU/W_F; slide-down preset.

FeaturedSchool

Energy Conservation

Launch Simulator

Ball on a roller coaster track with real-time KE, PE, and total energy bars.

NewSchool

1D Force Field

Launch Simulator

U(x) presets, F = −U′, bead on potential, phase (x,v) and E(t).

NewSchool

Bernoulli Flow

Launch Simulator

Pipe narrows: speed up, pressure down. Continuity + Bernoulli.

NewSchool

Angular Momentum

Launch Simulator

Two masses on a rod: I = 2mr², change r or m and watch ω adjust to keep L constant.

PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Classical Mechanics/Spring Work (F–x)

Spring Work (F–x)

F = kx graph, shaded W = area = ½kx²; U(x) curve vs Spring-Mass dynamics.

Spring & stretch

80 N/m
0.22 m

Stretch slowly from x = 0 so the applied force matches the spring: F = kx. The work you put in is the area under the F–x graph. For a linear spring that area is a triangle: W = ½kx², equal to the elastic potential energy stored.

Shortcuts

  • •Space / Enter — reset sliders
  • •R — reset

Measured values

F at x17.60N
W = ½kx²1.936J
U spring1.936J

Live graphs

About this model

A fundamental principle in mechanics is Hooke's Law, which states that the restoring force exerted by an ideal spring is directly proportional to its displacement from equilibrium: F = -kx. This simulator visualizes the relationship between force (F) and displacement (x) on a graph, where the slope of the line is the spring constant, k. The core learning objective is to understand that the work done in stretching or compressing the spring is not simply force times distance, because the force changes continuously. The work is calculated as the area under the Force vs. Displacement curve. For a linear spring, this area forms a triangle, leading to the formula for work: W = (1/2)kx². This work is stored as elastic potential energy, U = (1/2)kx², which the simulator also plots. The dynamic portion connects this energy concept to motion, showing a mass on a frictionless horizontal surface. When released, the potential energy converts to kinetic energy, demonstrating simple harmonic motion governed by the conservation of mechanical energy: (1/2)kx² + (1/2)mv² = constant. Key simplifications include a massless spring, no damping or friction (in the dynamic view), and the assumption that the spring obeys Hooke's Law perfectly within its elastic limit. By interacting with sliders for k, mass, and displacement, students directly see how these parameters alter the force graph, the stored energy, and the resulting oscillation speed and amplitude, solidifying the integral connection between force, work, energy, and motion.

Who it's for: High school and introductory college physics students learning about Hooke's Law, work-energy theorem, and simple harmonic motion.

Key terms

  • Hooke's Law
  • Spring Constant
  • Work-Energy Theorem
  • Elastic Potential Energy
  • Simple Harmonic Motion
  • Force-Displacement Graph
  • Conservation of Energy
  • Area Under Curve

How it works

Unlike the Spring-Mass time simulation, this view stresses the geometric meaning of work: for a Hookean spring stretched quasistatically from equilibrium, F(x) = kx and the work ∫ F dx from 0 to x equals the triangular area ½kx², i.e. the stored elastic potential energy.

Key equations

W = ∫₀^x F(x') dx' = ∫₀^x kx' dx' = ½ k x² = U

Frequently asked questions

Why is the work ½kx² and not just kx * x (which would be kx²)?
Because the force is not constant; it starts at zero and increases linearly to kx. The average force during the stretch is (0 + kx)/2 = (1/2)kx. Work is average force times distance: (1/2)kx * x = (1/2)kx². Graphically, this is the area of the triangle under the F-x line, not a rectangle.
Does this model apply to compressing a spring as well as stretching it?
Yes. The physics is identical for compression. The displacement x is measured from the equilibrium position, and the force opposes the displacement (hence the negative sign in F = -kx). The work done to compress the spring and the stored elastic potential energy are also given by (1/2)kx².
What is the difference between the work done ON the spring and the work done BY the spring?
They are equal in magnitude but opposite in sign. The work you do on the spring to stretch it is positive (force and displacement in the same direction), storing energy. The work done by the spring on your hand as you slowly release it is negative (spring force opposes motion), releasing that stored energy. The simulator typically shows the work done on the spring.
When the mass is oscillating, why does it stop at the same displacement it started from?
In the idealized, frictionless model, mechanical energy is conserved. The energy starts entirely as potential energy (U = 1/2 k x_max²). At the equilibrium point, all energy is kinetic. The mass coasts back to the same maximum displacement because it must convert all that kinetic energy back into potential energy, satisfying conservation of energy.