I have done quite a few introductory physics problems where calculus is involved .When refreshing the concept of work done by variable force,I find myself unsure about an application of calculus.The underlying concept which is puzzling me is at the very root of calculus .The work done by the force is given by dW =f(x)dx ,where we take f(x) to be constant over dx . An example is the spring force f(x)=kx. How and why do we take f(x) to remain same over dx i.e function f remains same over the interval from x to x+dx ? Function f has a definite value for x i.e f(x) but how does it have same value as x changes to x+dx .May be the infinitesimal change dx has something to do with it which i am unable to understand. I would deeply appreciate if someone could clarify this doubt in a simple language .