In electrostatics, one often desires to know the electrostatic potential generated from the outside of a charge distribution; however, I am interested in finding the electrostatic potential inside of a charge distribution.
For example, let's consider a parabolic charge distribution: $\rho(x) = x(L-x)$ Where L is the length of the distribution. Now if we wish to calculate the electrostatic potential, we would need to calculate:
$\Phi(z) = \int_0^L \frac{\rho(x)}{|z-x|} dx = \int_0^L \frac{x(L-x)}{|z-x|} dx$
In turn one could take the derivative of $\Phi(z)$ to obtain the electric field inside the distribution.
My attempt to do this in mathematica:
L = 1;
s[z_] := z (L-z)
fen[x_] := Integrate[s[z]/Abs[z - x], {z, 0, L}, PrincipalValue -> True, Assumptions :> {L > x > 0}]
V = fen[x]
El = fen'[x]
Plot[{V, El}, {x, 0, 1}]
Any ideas? Thanks!
1/r. So, either you have to change the formula, or add integration volume for 2D and 3D. – Leonid Shifrin Jan 16 '14 at 23:18