\subsection{Mechanical Energy Conservation}

This subsection packages work and potential energy into an energy-accounting method. In AP mechanics, the key step is to choose a system first, then decide which interactions are represented by potential energy and which must be tracked as nonconservative work.

\dfn{Mechanical energy and nonconservative work}{Let a chosen system move between an initial state and a final state. Let $K$ denote the total kinetic energy of the system, and let $U$ denote the total potential energy associated with all conservative interactions included in the system, such as gravitational and spring interactions. The \emph{mechanical energy} of the system is
\[
E_{\mathrm{mech}}=K+U.
\]

Let $W_{\mathrm{nc}}$ denote the total work done on the system by forces or processes that are not represented by a potential-energy function in the chosen model. With this sign convention,
\[
W_{\mathrm{nc}}>0 \text{ increases } E_{\mathrm{mech}},
\qquad
W_{\mathrm{nc}}<0 \text{ decreases } E_{\mathrm{mech}}.
\]
Typical examples include kinetic friction, air drag, and an external applied force not absorbed into $U$.}

\thm{Mechanical energy equation}{Let $K_i$ and $U_i$ denote the initial kinetic and potential energies of a chosen system, and let $K_f$ and $U_f$ denote the corresponding final quantities. If $W_{\mathrm{nc}}$ is the total nonconservative work done on the system, then
\[
\Delta E_{\mathrm{mech}}=\Delta(K+U)=W_{\mathrm{nc}}.
\]
Equivalently,
\[
K_i+U_i+W_{\mathrm{nc}}=K_f+U_f.
\]
If the motion is governed only by conservative forces already accounted for in $U$, then $W_{\mathrm{nc}}=0$ and mechanical energy is conserved:
\[
\Delta(K+U)=0,
\qquad
K_i+U_i=K_f+U_f.
\]}

\nt{Choose the system before writing any energy equation. If the system is \emph{object + Earth}, then gravitational potential energy belongs in $U$ and gravity should not also be counted as separate work. If the system is \emph{object + spring}, then spring potential energy belongs in $U$. If the system is \emph{object + Earth + spring}, then both $U_g$ and $U_s$ belong in $U$. Mechanical energy is conserved only when no nonconservative work changes $K+U$ for that chosen system. When friction, drag, or an external agent transfers energy into or out of the system, use
\[
\Delta(K+U)=W_{\mathrm{nc}}
\]
instead of setting $\Delta(K+U)$ equal to zero. Total energy is still conserved overall; it is specifically \emph{mechanical} energy that may change.}

\pf{Derivation from the work-energy theorem}{Let $W_{\mathrm{net}}$ denote the net work done on the chosen system. By the work-energy theorem,
\[
\Delta K=W_{\mathrm{net}}.
\]
Split the net work into conservative and nonconservative parts:
\[
W_{\mathrm{net}}=W_c+W_{\mathrm{nc}}.
\]
For the conservative forces represented by the potential energy $U$,
\[
W_c=-\Delta U.
\]
Therefore,
\[
\Delta K=-\Delta U+W_{\mathrm{nc}}.
\]
Rearranging gives
\[
\Delta K+\Delta U=W_{\mathrm{nc}},
\]
so
\[
\Delta(K+U)=W_{\mathrm{nc}}.
\]
If $W_{\mathrm{nc}}=0$, then
\[
\Delta(K+U)=0,
\]
which is the conservation of mechanical energy.}

\qs{Worked example}{A block of mass $m=2.0\,\mathrm{kg}$ is released from rest at a height $h=1.20\,\mathrm{m}$ above the bottom of a ramp. The ramp is frictionless. After reaching the bottom, the block crosses a rough horizontal surface of length $d=0.80\,\mathrm{m}$ with coefficient of kinetic friction $\mu_k=0.25$. The block then compresses a horizontal spring of spring constant $k=400\,\mathrm{N/m}$ on a frictionless section of track and momentarily comes to rest at maximum compression. Let $x$ denote the maximum spring compression.

Find $x$.}

\sol Choose the system to be \emph{block + Earth + spring}. Then gravity and the spring are accounted for through potential energy, and the only nonconservative work is the work done by kinetic friction on the rough horizontal section.

Take the initial state to be the release point and the final state to be the instant of maximum compression. Let the gravitational potential energy be zero at the bottom of the ramp, and let the spring potential energy be zero when the spring is uncompressed.

Use the mechanical energy equation
\[
K_i+U_i+W_{\mathrm{nc}}=K_f+U_f.
\]

At the initial state, the block is released from rest, so
\[
K_i=0.
\]
Its gravitational potential energy is
\[
U_i=mgh=(2.0\,\mathrm{kg})(9.8\,\mathrm{m/s^2})(1.20\,\mathrm{m})=23.52\,\mathrm{J}.
\]

At the final state, the block momentarily stops at maximum compression, so
\[
K_f=0.
\]
Its gravitational potential energy is zero because it is at the bottom level, and its spring potential energy is
\[
U_f=\tfrac12 kx^2.
\]

Now compute the nonconservative work. On the rough horizontal section, the kinetic friction force has magnitude
\[
f_k=\mu_k mg=(0.25)(2.0\,\mathrm{kg})(9.8\,\mathrm{m/s^2})=4.9\,\mathrm{N}.
\]
Because friction opposes the motion over the distance $d=0.80\,\mathrm{m}$, the work done by friction is
\[
W_{\mathrm{nc}}=-f_k d=-(4.9\,\mathrm{N})(0.80\,\mathrm{m})=-3.92\,\mathrm{J}.
\]

Substitute into the energy equation:
\[
0+23.52\,\mathrm{J}-3.92\,\mathrm{J}=0+\tfrac12 (400\,\mathrm{N/m})x^2.
\]
So
\[
19.60\,\mathrm{J}=200x^2.
\]
Hence
\[
x^2=0.0980,
\qquad
x=\sqrt{0.0980}\,\mathrm{m}\approx 0.313\,\mathrm{m}.
\]

Therefore the maximum spring compression is
\[
x\approx 0.31\,\mathrm{m}.
\]

If the rough section were absent, then $W_{\mathrm{nc}}=0$ and mechanical energy would be conserved exactly. Here the negative friction work reduces the mechanical energy before the block reaches the spring.
