Suppose, I have the following function:
$$f(x,y) = -x^2 - y^2 + 4 \qquad (1)$$
Partial derivative of $(1)$ w.t.r. $x$ would be:
$$\frac{\partial f}{\partial x} = -2x \qquad (2)$$
Partial derivative of $(1)$ w.t.r. $y$ would be:
$$\frac{\partial f}{\partial y} = -2y \qquad (3)$$
So, the partial derivative of $(1)$ w.r.t. both $x$ and $y$ would be:
$$ \text{Gradient of } f = \nabla f = \begin{bmatrix}\frac{\partial f}{\partial x} \\ \frac{\partial f}{\partial y}\end{bmatrix} = \begin{bmatrix}-2x \\ -2y\end{bmatrix} \qquad (4)$$
I have two questions here:
- Is the above description correct?
- What would the graph/plot of $(4)$ look like?
The important result you should remember here is
The level sets of $f$ are circles. For example $0 = -x^2 -y^2 +4 $ is a circle of radius $2$. And the gradient must be perpendicular to that circle, so it is a radius. Here's a sketch
Arrows represent the gradient, and colors the function. The circles are level sets