Lesson 3 of 18

Work by Variable Force

Work by Variable Force

When force varies with position, work is the integral of force over displacement:

W=intabF(x),dxW = int_a^b F(x) , dx

Physical Interpretation

  • F(x)F(x) is the force (in Newtons) at position xx (in meters)
  • Work is measured in Joules (N·m)
  • Constant force: W=FcdotdW = F cdot d (special case where F is uniform)

Hooke's Law (Spring)

A spring with stiffness kk exerts force F(x)=kxF(x) = kx when stretched by xx:

W = int_0^d kx , dx = rac{k cdot d^2}{2}

Example: spring constant k=4k=4, stretched 3extm3 ext{m}: W=int034x,dx=[2x2]03=18extJW = int_0^3 4x , dx = [2x^2]_0^3 = 18 ext{ J}

Lifting Variable-Weight Loads

A chain of linear density ho ho being lifted: F(x)=hocdot(Lx)F(x) = ho cdot (L-x) where LL is chain length. The work to lift the full chain:

ho(L-x) , dx = rac{ ho L^2}{2}$$ ### Your Task Implement `double work(double (*force)(double), double a, double b, int n)` using the midpoint rule.
TCC compiler loading...
Loading...
Click "Run" to execute your code.