Spring energy uses displacement squared

The mistake

Using kx or mgx as spring energy instead of ½kx².

Why it feels right

Spring force is kx, so energy feels like it should be the same expression.

How to catch it

Your spring energy has units of newtons instead of joules, or changes sign when x changes sign.

The first principle

Spring potential energy is the area under F = kx: U_s = ½kx². Compression and extension with equal |x| store equal energy.

worked mini-example

A spring with k = 200 N/m is compressed 0.10 m. Energy stored?

Common wrong move

kx = 20 N.

Correct

½kx² = 1.0 J.

Test the repair EN-06 · transfer
include J

Make a fresh prediction before referring to the worked example.