(a) If there is a scalar function f(x, y) such that ∇ f(x, y) = x² i + y² j, then
∂f/∂x = x²
∂f/∂y = y²
Integrating both of these equations with respect to x and y (respectively) gives
f(x, y) = 1/3 x³ + g(y)
f(x, y) = 1/3 y³ + h(x)
Differentiating with respect to the other variable gives
∂f/∂y = g'(y) = y²
∂f/∂x = h'(x) = x²
so it follows that
f(x, y) = 1/3 x³ + 1/3 y³ + C
for some constant C.
(b) By the gradient theorem,
[tex]\displaystyle \int_C \nabla f \cdot d\vec r = f(0,0) - f(-1,2) = \boxed{-\dfrac73}[/tex]