### 13.7.6 Potential

Recall that a vector field F is conservative if there is a scalar-valued function f such that grad f=F. In this case, f is called a potential of F, and is only determined up to a constant.

The potential command computes the potential of a vector field, or signals an error if the vector field is not conservative.

- potential takes two arguments:
  - F, a vector field given as a list of n expressions involving n variables.
  - vars, a list of the variable names.
- potential(F,vars) returns a potential function for F if F is conservative, and raises an error otherwise.

Note that potential is the reciprocal function of derive.

Also note that in ℝ3, a vector field F is conservative if and only if its curl is zero; i.e., if curlF=0. In time-independent electro-magnetism, F=E is the electric field and f is the electric potential.

#### Example

potential([2*x*y+3,x^2-4*z,-4*y],[x,y,z])

x2 y+3 x−4 y z |  |  |  |  |  |  |  |  |  |