Master the step-by-step partial integration method to recover a scalar potential function \(\displaystyle f\) such that \(\displaystyle \nabla f = \mathbf{F}\) in both 2D and 3D.