Inside the sphere, the electric field has the form , including at the origin. Thus it is a conservative vector field. Outside, use the gradient of a radial function to obtain
This is also an explicit potential of a conservative vector field, single-valued throughout the exterior region. Equivalently, the curl vanishes in both regions: for a radial coefficient , because is radial. The interior formula avoids any apparent issue at the origin. The vector-field potentials here have the opposite sign from the electric potential convention used in (b).
For , use the gradient of a radial function with :
Equivalently each component is by differentiating . The origin is excluded from the function's domain.
For , the multivariable chain rule gives , with the corresponding expressions for . Thus the gradient of a radial function is
The origin needs a separate check because is undefined there. If the one-variable function has a finite right derivative at zero, the radial composite is differentiable at the origin exactly when , in which case its gradient is zero. A nonzero radial slope gives incompatible opposite-direction derivatives.