Source: Principles of Physics
Problem
A cart on a frictionless horizontal rail is pulled by a cord that passes over a pulley. The pulley is at a fixed height $h$ above the rail. The cart moves from an initial position $x_1$ to a final position $x_2$. During the move, the tension $T$ in the cord is constant.
P0547-problem-1
According to the work-energy theorem, the change in kinetic energy of the cart, $\Delta K$, is equal to the net work done on it, $W_{net}$. The forces on the cart are the tension $\vec{T}$, the normal force $\vec{N}$, and gravity $\vec{F}_g$. Since the rail is frictionless and the displacement is horizontal, the normal force and gravity do no work. Thus, the net work is the work done by the tension, $W_T$.
The work done by the constant tension force $T$ is equal to the magnitude of the tension multiplied by the length of the cord pulled over the pulley. Let $L_1$ and $L_2$ be the lengths of the cord between the pulley and the cart at positions $x_1$ and $x_2$, respectively.
Using the Pythagorean theorem:
$$L_1 = \sqrt{x_1^2 + h^2}$$ $$L_2 = \sqrt{x_2^2 + h^2}$$The length of the cord pulled in is $\Delta L = L_1 - L_2$. The work done by the tension on the cart is:
$$W_T = T \cdot \Delta L = T(L_1 - L_2)$$Therefore, the change in kinetic energy is:
$$\Delta K = W_T = T(\sqrt{x_1^2 + h^2} - \sqrt{x_2^2 + h^2})$$