When in physics we assume a quantity is constant over an interval dt, why/how is this justified? Unsure about whether I should have posted it here or on the physics stackexchange, but since this feels to me more like a question about calculus, I have posted it here.
An example would be when we're finding the work done by a varying force $F(x)$ over some interval $[x_1,x_2]$. We assume that the force is constant over $\Delta x$ as we take the limit $\Delta x \to 0$. What I want to know is, what exactly is the mathematical assumption we're making here? I.e what quantity's limit is approaching zero or some quantity, as we take $\Delta x\to 0$. I want to know this so I know how to verify if this assumption is valid.
 A: The way the calculation works is a bit more subtle. Let's say the interval $[a,b]$ is given, and you want to calculate the work done by the force $F(x)$ as $x$ changes from $a$ to $b$.
We now do subdivide the interval $[a,b]$ into parts, which are usually equal (but sometimes inequal). This is done by placing additional points $a=x_0<x_1<x_2<\cdots<x_n=b$. For example, set $x_i=a+\frac{b-a}{n}i$.
What we do next is not exactly keeping $F(x)$ constant on the intervals $[x_i,x_{i+1}]$ - this is sort of a simplification of what we really do.
Instead, on each of those intervals we take the maximum and the minimum force: the actual work done on $[x_i,x_{i+1}]$ by real $F(x)$ must be between $(x_{i+1}-x_i)\min_{x_i\le x\le x_{i+1}}F(x)$ and $(x_{i+1}-x_i)\max_{x_i\le x\le x_{i+1}}F(x)$. (For pedants: we are really taking the supremum and infimum, not maximum and minimum, but I will use the symbols $\max$, $\min$ throughout.)
Now we sum those across $i=0,1,2,\ldots,n-1$ to get something we call lower Darboux sum and upper Darboux sum:
$$\sum_{i=0}^{n-1}(x_{i+1}-x_i)\min_{x_i\le x\le x_{i+1}}F(x)$$
$$\sum_{i=0}^{n-1}(x_{i+1}-x_i)\max_{x_i\le x\le x_{i+1}}F(x)$$
Now, if we can prove that those two sums converge to the same number as the division of $[a,b]$ grows finer and finer, then it is natural to call that number the work done by $F(x)$ on $x\in[a,b]$. Or, in maths, we call that the Riemann integral of $F(x)$ on interval $[a,b]$ and denote it:
$$\int_a^b F(x)dx$$
More precisely, if the upper and lower Darboux sums exist for every subdivision of $[a,b]$ and converge to the same value as the maximum size of the intervals in the subdivision tends to $0$, then we call the function $F$ Riemann-integrable, and we call the common limit of the two sums the Riemann integral of $F(x)$ over $[a,b]$. Otherwise, we say that $F$ is not Riemann-integrable.

Side note: If a function $F$ is Riemann-integrable on $[a,b]$, this automatically means that the method of keeping $F(x)$ constant on the intervals $[x_1,x_{i+1}]$ also works! Namely, as long as you pick $F(x)$ on each interval equal to some value of it on that interval (e.g. keep it equal to $F(x_i)$ or to $F(x_{i+1})$ or even to $\frac{1}{2}(F(x_i)+F(x_{i+1})$) - the sum you're getting is between the lower and the upper Darboux sums. That means that, having both the upper and lower Darboux sums converge to $\int_a^b F(x)dx$, your sum (squeeze theorem!) converges to the same value!

Back to the integration: why does it work in physics so well that you don't ever get to ask the question about Riemann integrability? I believe this mostly comes from the fact that (unlike some very hairy functions that we study in maths), in physics most functions are assumed to be well-behaved: normally continuous, often more than that (smooth - i.e. differentiable, often infinitely many times). So a theorem comes handy:
Theorem: Every continuous real function $F$ on $[a,b]$ is Riemann-integrable.
Proof (sketch): I won't go down to show the full proof here, but there is a bunch of prerequisites:

*

*Every continuous real function $F$ on a closed interval is bounded.

*

*This means, for every subdivision $a=x_0<x_1<x_2\cdots<x_n=b$ of $[a,b]$ both the lower and upper Darboux sum make sense.



*Every continuous real function $F$ on a closed interval is uniformly continuous.

*

*This is a condition often stronger than "just" being continuous, and it means that, if you pick a small $\epsilon>0$, you can always find the size $\delta>0$ of a small interval so that, whenever $|x-y|<\delta$ you have $F(x)-F(y)<\epsilon$. In other words, the values of $F$ come close "enough" to each other across the whole interval as the points on which you calculate $F$ come close "enough".



Because of the above uniform continuity, all of $\max_{x_i\le x\le x_{i+1}}F(x)$ and $\min_{x_i\le x\le x_{i+1}}F(x)$ are also smaller (or equal) than $\epsilon$ if we set $|x_i{+1}-x_i|<\delta$, so one can see that the upper and lower Darboux sums differ by at most $\epsilon(b-a)$. You see that you can now make that difference arbitrarily small by choosing $\epsilon$ arbitrarily small and then choosing the subdivision to be as fine as the corresponding $\delta$ (or finer).$\,\blacksquare$
This theorem is then extended in different directions:

*

*If a bounded function has finitely many discontinuities, it can still be proven to be Riemann-integrable.

*If a function is not bounded on $[a,b)$ but is Riemann-integrable on all $[a,c]$ with $a<c<b$, we may still try to define $\int_a^b F(x)dx:=\lim_{c\to b-}\int_a^c F(x)dx$ (if the limit exists) and we call that value an improper integral of $F$ on $[a,b)$. $b$ could be taken to be a finite real number or $+\infty$.

*There is a different definition of something called Lebesgue integral, which is a generalization of the previous two, although in fact it is more than "just" a generalization and covers many more pathological cases.

Anyways - the bottom line is that, as long as your force $F(x)$ is continuous (or has finitely many discontinuities), it is Riemann-integrable, and so your method works, and it produces the value of the Riemann integral $\int_a^b F(x)dx$, which (as we concluded above) is the only sensible number to call the "work done by this function".
Further reading:

*

*Riemann integral (original definition)

*Riemann-Darboux integral (an equivalent definition which is explored in this answer)

*Improper integral

*Lebesgue integral

*Continuous functions are bounded (a question here, on MSE)

*Uniform continuity

*How to prove that continuous functions are Riemann-integrable (another MSE question)

A: Let me first rephrase the question to make sure I understand it right. You have a function $F(x)$, and you are trying to find out what conditions are required on $F$ to assume that $F$ is constant over an infinitesimal interval.
Basically, you need to ensure that your function does not vary highly in suitable small intervals and that any change in $F$ that happened in $\Delta x$ should limit to $0$, as $\Delta x \to 0$. You would like to avoid $F$ from being functions such as, say, Dirichlet function.
Short answer : Yeah, as you have noted in a comment, continuity of $F$ seems to be a sufficient condition for this.

Slightly longer answer: Note that trying to make sense of this process of dividing up the domain into very small intervals, assuming $F$ is constant on that interval, and adding all the $F \Delta x$ up to form an approximation of what the integral (in this case, the Work) should be; such that it becomes a better and better approximation as $\Delta x \to 0$, is exactly what Riemann integration, and constructing Riemann integrals, are all about.
So the class of functions you are looking for is probably the class of Riemann integrable functions. But then, all the continuous functions on $\Bbb R$ are Riemann integrable, and thus checking for continuity is a sufficient condition for you in this case.
A: You need to separate motivations from definitions (or theorems). This is I think unfortunately not clearly distinguished in introductory Physics explanations. We often gain our intuition and motivations when things are constant/piecewise constant, and then we use that insight to formulate a general definition/theorem.
For example, since middle/high school, we introduce the concept of work done (by a given force on a given object) to be the product of the force with the distant moved in the direction of the force. This idea makes a lot
sense when we look at “simple” everyday idealizations, e.g moving a ball from the ground to the top of a shelf etc. But, once you have this idea for constant forces, you can easily generalize the intuition to piecewise constant forces. Finally, once we have enough of an idea, we formulate a rigorous definition:

Definition.
Let $U\subset\Bbb{R}^n$ be an open set, $\mathbf{F}:U\to\Bbb{R}^n$ a continuous vector field, and $\gamma:[a,b]\to U$ a (piecewise) $C^1$ path. We define the work done by $\mathbf{F}$ along the path $\gamma$, $W_{\mathbf{F},\gamma}$, to be the line integral
\begin{align}
W_{\mathbf{F},\gamma}&:=\int_{\gamma}\mathbf{F}\cdot d\mathbf{l}:=\int_a^b\mathbf{F}(\gamma(t))\cdot\gamma’(t),dt.
\end{align}

If you only wish to focus on the one-dimensional case, this reduces to $\int_{x_1}^{x_2}F(x)\,dx$ (where the path starts at $x_1$ and ends at $x_2$).
So, this integral formula is just a definition! We as humans are allowed to make whatever definitions we like (as long as it doesn’t cause logical contradictions with the theory we have already developed). So, there is no longer any question of why we’re allowed to “assume forces are constant over $\Delta x$, and then take $\Delta x\to 0$“. A definition is a definition. However, you can ask why it is a good definition, and here some of the reasons are:

*

*It is a pretty general definition for work done by a force field, and as a result applies to a wide range of scenarios, and also due to the generality, it “unifies” many previously separate ideas. For instance, the definition makes no reference to any specific type of force field, i.e the definition applies equally well to gravitational fields, electricmagnetic fields, to frictional forces acting on a curved inclined ramp etc.

*One can easily see that in the case of constant/piecewise-constant forces and piecewise-linear paths, this definition reproduces what we already expect. So, it conforms to our intuition.

*A slightly more difficult-to-motivate reason is because the mathematical quantity $\int_{\gamma}\mathbf{F}\cdot \,d\mathbf{l}$ appears all over physics, so giving this quantity a name is convenient. Part of the reason this quantity appears all over is because Newton’s second law is given in ODE format: $\sum_i\mathbf{F}_i=m\mathbf{a}$ (now you can of course question why it is valid to describe nature using a second order ODE, but this is just an approximation… though a very good one for most everyday (and even slightly beyond) purposes. So in this sense, the definition is also physically reasonable). This is a vector quantity, so not necessarily easy to deal with, so one of the things we like to do is consider specific scalar quantities, and it has proven (by experience) to be useful to consider various integrated quantities (work done, kinetic energy, potential energy etc etc, and to consider relationships between them).


Above, I described the situation for the motiviation/definition of work done. We can make exactly the same argument for other things, like mass of a rigid body, center of mass, moment of inertia and so on. These are usually given by various integral formulae, whereby the motivation for these integral formulae comes by considering the case of constant/piecewise-constant/pointlike things. For mass/mass density specifically, you may find some of the remarks here What does it mean to integrate with respect to mass? helpful (but be warned, that answer was intentionally written at a higher level of math sophistication).
A: This, to me, looks similar to the analogy used to explain that the Riemann integral is a “good approximation” of the area underneath a function: if you take $\Delta x\to 0$ you are taking such a small interval that the function changes value so little that considering it constant is a good approximation: thus you can approximate the area underneath a function with the sum of many little rectangulars.
Note that I chose the analogy with the integral because the work done by a changing force is actually the integral of the force function, over the time interval that you’re interested in.
For visual intuition, see https://commons.wikimedia.org/wiki/File:Somme-superiori.png#/media/File:Somme-superiori.png
A: Riemann integration has 'upper sums' and 'lower sums'.  They get introduced in university mathematics.
Divide the interval $[x_1,x_2]$ into $n$ intervals, so $\Delta x=(x_2-x_1)/n$.
Let $m_i$ be the lowest value of $F(x)$ in the $i$th interval of $\Delta x$.  The sum $L_n = \Sigma m_i\Delta x$ is a lower bound for the true answer.
In the same way, let $M_i$ be the highest value of $F(x)$ in the $i$th interval.  Then $U_n=\Sigma M_i\Delta x$ is an upper bound for the true answer.
If $F(x)$ is always increasing, or if it is always decreasing, then $$|U_n-L_n|\le 
\left(\max(F(x))-\min(F(x))\right)\Delta x$$
So, as $\Delta x\to0$, the upper bounds and lower bounds approach the same value.
If $F(x)$ increases and decreases a finite number of times, the difference between the upper bounds and the lower bounds still approaches zero.  The integral is the only number left between all the lower bounds and all the upper bounds.
