6. Potential From Field Integrator — Theory
1) Core idea
Electric potential difference is related to the electric field by a line integral:
\( \Delta V = V(\mathbf{r}_1)-V(\mathbf{r}_0) = -\int_C \mathbf{E}\cdot d\boldsymbol{\ell} \).
Here, \(C\) is any path that starts at \(\mathbf{r}_0\) and ends at \(\mathbf{r}_1\).
Units check: \( \mathbf{E} \) has units N/C = V/m, and \( d\boldsymbol{\ell} \) has units m, so the integral gives volts.
2) Parameterizing a path
A convenient way to compute the line integral is to parameterize the curve:
\(\mathbf{r}(t)=(x(t),y(t))\) with \(t\in[0,1]\).
Then \(d\boldsymbol{\ell}=\mathbf{r}'(t)\,dt\) and
The calculator uses this form and evaluates the integral numerically (composite Simpson).
3) Conservative fields and path independence
If the electrostatic field is conservative (typical for static charge configurations away from singularities),
then the potential difference depends only on the endpoints:
\(\Delta V\) is the same for any path between \(\mathbf{r}_0\) and \(\mathbf{r}_1\).
In 2D, a quick diagnostic is the (out-of-plane) curl:
\( \partial E_y/\partial x - \partial E_x/\partial y \).
If this is (approximately) zero in a region (and the region has no singularities),
the field is consistent with being conservative there.
4) Common special cases
Uniform field
For \(\mathbf{E}=(E_x,E_y)\) constant,
\(\mathbf{E}\cdot d\boldsymbol{\ell}=E_x\,dx+E_y\,dy\), so
This is path independent: any curve between the same endpoints gives the same \(\Delta V\).
Point charge (away from the charge)
For a point charge \(q\), \(V(r)=kq/r\) and
The field becomes singular at the charge position; numerical integrals become unreliable if your path passes too close to it.
5) Sample from the prompt
Uniform field \(E=100\,\mathrm{N/C}\) in the \(x\)-direction and points \((0,0)\to(0.1,0)\):