# Confused about the differential of a quantity

We know that by definition, the differential of a single variable function $$f(x)$$ is $$df(x)=\frac{df}{dx}dx$$ analogously, for a multi-variable function $$f(x,y,z)$$ $$df(x,y,z)=\frac{\partial f}{\partial x}dx+\frac{\partial f}{\partial y}dy+\frac{\partial f}{\partial z}dz$$

Taking the work done by a force $$W=W(x)$$ as an example: $$dW(x)=\frac{dW}{dx}dx=Fdx \tag{1}$$ but doesn't this assume straight away that W=Fx (or is this a common assumption when using differential?)

I've always seen the differential of the magnitude of an electric field E being written in the form $$dE=\frac{1}{4\pi \epsilon}\frac{dQ}{r^2} \tag{2}$$ if we use the similar assumption in (1) that $$E(Q)=\frac{1}{4\pi \epsilon}\frac{Q}{r^2}$$ (which is the electric field outside of a spherically symmetric object with r=constant)

So is such an assumption correct? Or in other words can we use $$E=\frac{1}{4\pi \epsilon}\frac{Q}{r^2}$$ as a "starting point" of the differential to determine the electric field outside of ANY asymmetrical object (e.g. a half of a loop)? (just like $$W=Fx$$ as a starting point for $$dW=Fdx$$)

If you are working in one dimension, then you can say $$\text dW=F\text dx$$ means $$W=Fx$$ only if $$F$$ is not a function of $$x$$ (i.e. $$F$$ is constant). In general you will still need to perform an integral to get the total work done:

$$W=\int\text dW=\int F\text dx$$

Notice how if $$F$$ does not depend on $$x$$ then you can pull $$F$$ out of the integral and get $$W=Fx$$.

Or in more than one dimension you need to consider the component of $$\mathbf F$$ along the displacement $$\text d\mathbf x$$:

$$W=\int \text dW=\int\mathbf F\cdot\text d\mathbf x$$

The same is true for your electric field case, assuming your expression is based on Coulomb's law (see the end of the below example for a better understanding of this qualification). You can say that $$\text d\mathbf E=1/4\pi\epsilon_0\cdot\text dq\hat r/r^2$$ yields $$\mathbf E=1/4\pi\epsilon_0\cdot Q\hat r/r^2$$ only if your integrand is constant over the region of space you are integrating over. In this case one usually replaces $$\text dq$$ with either $$\lambda\ \text dl$$, $$\sigma\ \text dA$$, or $$\rho\ \text dV$$ for line, area, or volume charge densities respectively. The charge density as well as the distance vector $$\mathbf r$$ from the charge $$\text dq$$ to the point you are calculating the field at could vary over the integration region. In general you will have to perform an integral, just like in the work case.

Your half loop example comes close to this through symmetry arguments. Let's assume the half loop of total charge $$\int\text dq=Q$$ and of radius $$R$$ has a uniform line charge density $$\lambda$$ and is part of a ring centered at the origin. Let's also say the half loop is in the first and fourth quadrants of the x-y plane, and we want the field at the origin. Then the field due to some element of charge $$\text dq=\lambda\text dl$$ on the loop is $$\text d\mathbf E=\frac{1}{4\pi\epsilon_0}\frac{\lambda\text dl}{r^2}\hat r=\frac{1}{4\pi\epsilon_0}\frac{\lambda R\text d\theta}{r^2}\hat r$$

where $$\theta$$ is the polar angle that ranges from $$-\pi/2$$ to $$\pi/2$$ for our loop.

Now, the distance from any charge element to the origin is always $$r=R$$, but the unit vector $$\hat r$$ changes direction as we integrate over the half loop. However, we can use symmetry to argue that the net field will only have a horizontal component to the left. Therefore, we only need to consider the horizontal component of $$\hat r$$, which is actually just $$-\cos\theta\ \hat x$$ (since for any $$\theta$$, $$\hat r=-\cos\theta\ \hat x-\sin\theta\ \hat y$$).

Therefore, we end up with $$\text d\mathbf E=-\frac{1}{4\pi\epsilon_0}\frac{\lambda R\cos\theta d\theta}{R^2}\hat x=-\frac{1}{4\pi\epsilon_0}\frac{\lambda \text d(\sin\theta)}{R}\hat x$$

And now we have an integrand that is constant over the region of integration. Therefore: $$\mathbf E=\int\text d\mathbf E=\int_{-1}^1-\frac{1}{4\pi\epsilon_0}\frac{\lambda \text d(\sin\theta)}{R}\hat x=-\frac{1}{4\pi\epsilon_0}\frac{\lambda}{R}\hat x\int_{-1}^1\text d(\sin\theta)=-\frac{1}{2\pi\epsilon_0}\frac{\lambda}{R}\hat x$$

Or, knowing that $$\lambda=Q/\pi R$$, $$\mathbf E=-\frac{1}{2\pi^2\epsilon_0}\frac{Q}{R^2}\hat x$$

This result is pretty close to what you were proposing$$^*$$, and it is all because our integrand (technically the part of the integrand that didn't integrate to $$0$$) was constant along the region of integration. If we had a more complicated charge distribution, or if we tried to find the field at some other point in space, then we would most likely not end up with something that looks so simple and close to the field of a point charge (assuming we would even be able to write an actual solution out).

Coming full-circle, I also want to point out that we could at this point technically write out $$\text d\mathbf E=-\frac{1}{2\pi^2\epsilon_0}\frac{\text dQ}{R^2}\hat x$$ however, this expression has a different physical interpretation as before. Earlier, the $$\text d\mathbf E$$ was the "little amount of field" provided by the charge element $$\text dq$$. In this expression, we would instead be thinking of $$\text d\mathbf E$$ as the change in the electric field given a change $$\text dQ$$ in total charge of the half-loop. This example just goes to show how you need physical knowledge to backup your understanding of your equations. When we started with $$\text d\mathbf E=\frac{1}{4\pi\epsilon_0}\cdot\frac{\text dQ\hat r}{r^2}$$ we understood this equation to mean "This is Coulomb's law. To find the value of the total field I need to integrate over my charge distribution." In this new equation, we understand it to mean "I already know the total field at the center of a half-loop of charge. How does this field vary as I change the total charge of the uniform charge distribution?"

In physics, our differentials have physical meaning, and that meaning then corresponds to how you should handle the equation to determine the values you are interested in.

$$^*$$ We could even be clever and say that the total charge is actually $$Q'=-\pi Q/2$$, where $$Q$$ now stands for some other unit of charge that is $$-2/\pi$$ times the total charge. Then $$\mathbf E=\frac{1}{4\pi\epsilon_0}\frac{Q}{R^2}\hat x$$

and then we win.