In physics, work done and gravitational potential energy are linked to integration in mathematics because both concepts involve accumulating small contributions over a distance.
$$ W = \int_{x_1}^{x_2} F(x) \, dx $$
$$ W = mg \Delta h $$
$$ U = -\int F(h) \, dh = -\int mg \, dh = -mgh $$
Where:
Relationship through Integration:
The work-energy theorem states that the work done on an object is equal to the change in its energy. Since work done in lifting an object results in a change in gravitational potential energy, the integral for work directly gives the potential energy function:
$$ W = \Delta U = mgh $$
In essence, integration helps accumulate the small forces applied over a distance to give a complete picture of work done and the resulting change in gravitational potential energy.