Work done by a force

Work is the integral of force along the displacement, $W = \int F\,dx$, so only the component of force along the motion does work.

From Physics 1.