Solution (source code)

= Solution

A <conservative vector field> is the <gradient> of a single-valued differentiable scalar potential. Its <line integral> is path independent and equals the potential difference. If $\psi\mathbf A=\nabla F$ with a twice continuously differentiable potential, equality of mixed partial derivatives gives
$$
\partial_y(\psi A_1)=\partial_y\partial_xF=\partial_x\partial_yF=\partial_x(\psi A_2).
$$
The <product rule> then gives $\psi_yA_1+\psi A_{1,y}=\psi_xA_2+\psi A_{2,x}$. Rearranging proves the <integrating-factor equation for a planar vector field>:
$$
\boxed{\psi(A_{1,y}-A_{2,x})=A_2\psi_x-A_1\psi_y.}
$$
This argument does not require division by $\psi$, so it remains valid even at its zeros. A nonvanishing <integrating factor> is normally sought when one wants to recover useful potential curves for the original field.