Solution (source code)

= Solution

Integrate $f_x=ye^x$ with respect to $x$, obtaining $f=ye^x+g(y,z)$. Matching $f_y=e^x+2yz^3$ gives $g_y=2yz^3$, so $g=y^2z^3+h(z)$. Finally, $f_z=3y^2z^2+h'(z)$ must equal the third component, so $h'=0$. Thus a <scalar potential> is
$$
\boxed{f(x,y,z)=ye^x+y^2z^3+C,\qquad v=\nabla f.}
$$
The <fundamental theorem for line integrals> now gives $\int_Cv\cdot dr=f(1,1,1)-f(0,0,0)=e+1$ for either path, confirming both direct computations. Since the <curl of a gradient> is zero for this smooth <function>, it also confirms the result in part (b). The potential is defined throughout $\mathbb R^3$, so no domain obstruction to <path independence> occurs.