Solution (source code)

= Solution

For $a=0$, differentiate the proposed <scalar potential> directly:
$$
\nabla\left(-\frac12e^{-(x^2+y^2+z^2)}\right)
=e^{-r^2}(x,y,z).
$$
Thus
$$
\boxed{\Phi(\boldsymbol r)=-\frac12e^{-r^2}+C\quad\text{when }a=0.}
$$
For $a\ne0$, the <curl> is the nonzero <vector> $(0,0,2a)$. A <gradient> of a twice differentiable scalar field has zero <curl>, so no such scalar field exists. Equivalently the closed <line integral> in part (d) is nonzero, contradicting the path independence of a <conservative vector field>. The field is smooth on all of $\mathbb R^3$, so no excluded singular set complicates this conclusion.