Potential of vector field
potential(V,X)
potential(V,X,Y)
potential(
computes
the potential of the vector field V
,X
)V
with respect
to the vector X
in Cartesian coordinates. The
vector field V
must be a gradient field.
potential(
computes
the potential of vector field V
,X
,Y
)V
with respect
to X
using Y
as base point
for the integration.

Vector of symbolic expressions or functions. 

Vector of symbolic variables with respect to which you compute the potential. 

Vector of symbolic variables, expressions, or numbers that you
want to use as a base point for the integration. If you use this argument, 
Compute the potential of this vector field with respect to the
vector [x, y, z]
:
syms x y z P = potential([x, y, z*exp(z)], [x y z])
P = x^2/2 + y^2/2 + exp(z)*(z  1)
Use the gradient
function to verify the result:
simplify(gradient(P, [x y z]))
ans = x y z*exp(z)
Compute the potential of this vector field specifying the integration
base point as [0 0 0]
:
syms x y z P = potential([x, y, z*exp(z)], [x y z], [0 0 0])
P = x^2/2 + y^2/2 + exp(z)*(z  1) + 1
Verify that P([0 0 0]) = 0
:
subs(P, [x y z], [0 0 0])
ans = 0
If a vector field is not gradient, potential
returns NaN
:
potential([x*y, y], [x y])
ans = NaN
curl
 diff
 divergence
 gradient
 hessian
 jacobian
 laplacian
 vectorPotential