Multivariable calculus

Gradient of xy + yz + zx: Symmetric Quadratic Form

For f(x, y, z) = xy + yz + zx the gradient is (y + z, x + z, x + y). Each component is the sum of the two variables you did not differentiate, because only the two terms containing that variable survive. At (1, 2, 3) the gradient is (5, 4, 3).

f(x,y,z)=xy+yz+zxf(x,y,z) = xy + yz + zx
f=y+z,  x+z,  x+y\nabla f = \left\langle y + z,\; x + z,\; x + y \right\rangle
fx=y+z\frac{\partial f}{\partial x} = y + z
fy=x+z\frac{\partial f}{\partial y} = x + z
fz=x+y\frac{\partial f}{\partial z} = x + y

Only the terms containing your variable survive

Differentiate term by term. With respect to xx, the term xyxy gives yy, the term zxzx gives zz, and the term yzyz has no xx in it, so it contributes zero.

fx=x(xy)+x(yz)+x(zx)=y+0+z\frac{\partial f}{\partial x} = \frac{\partial}{\partial x}\left(xy\right) + \frac{\partial}{\partial x}\left(yz\right) + \frac{\partial}{\partial x}\left(zx\right) = y + 0 + z

The function is completely symmetric in the three variables, so the other components follow by relabelling. Each one is the sum of the two variables you did not differentiate.

f=y+z,  x+z,  x+y\nabla f = \left\langle y + z,\; x + z,\; x + y \right\rangle

If you write s=x+y+zs = x + y + z, there is a compact form worth remembering: f=sx,  sy,  sz\nabla f = \left\langle s - x,\; s - y,\; s - z \right\rangle. It makes the symmetry obvious and speeds up substitution.

The mistake: leaving the variable in its own component

The error to watch for is fx=x+y+z\frac{\partial f}{\partial x} = x + y + z, which keeps xx in the answer. It usually comes from differentiating the compact expression sxs - x carelessly, or from pattern matching on the symmetry without checking the terms.

  • Every component of this gradient must be missing its own variable. If xx appears in fx\frac{\partial f}{\partial x}, look again.
  • A second slip is forgetting the zxzx term when differentiating with respect to xx, giving just yy. Scan all three terms every time.
  • Degree check: ff is degree 2, so each component must be degree 1. Both y+zy+z and x+y+zx+y+z pass that test, which is why the term by term scan matters more here.

Notice also that the gradient of a quadratic is linear, so the components should contain no products and no squares. Anything like xyxy inside a component is wrong.

The origin is a saddle, not a minimum

At (1,2,3)(1, 2, 3) the value is f=2+6+3=11f = 2 + 6 + 3 = 11 and the gradient falls out immediately.

f(1,2,3)=2+3,  1+3,  1+2=5,  4,  3\nabla f(1,2,3) = \left\langle 2+3,\; 1+3,\; 1+2 \right\rangle = \left\langle 5,\; 4,\; 3 \right\rangle

For critical points, solve y+z=0y + z = 0, x+z=0x + z = 0 and x+y=0x + y = 0 together. Subtracting the second from the third gives y=zy = z, and combining with y+z=0y + z = 0 forces y=z=0y = z = 0 and then x=0x = 0. The origin is the only critical point.

It is a saddle. Along the line (t,t,t)(t, t, t) the function is f=3t2f = 3t^2, which climbs away from zero, while along (t,t,0)(t, -t, 0) it is f=t2f = -t^2, which falls. A single critical point with both behaviours nearby cannot be a maximum or a minimum.

One more identity that shows up in algebra and in optimisation problems with a fixed sum: xy+yz+zx=(x+y+z)2(x2+y2+z2)2xy + yz + zx = \frac{(x+y+z)^2 - \left(x^2+y^2+z^2\right)}{2}.

Frequently asked questions

Why does each component leave out its own variable?

Because the two terms containing that variable are each linear in it. Differentiating xyxy with respect to xx leaves yy, and differentiating zxzx leaves zz. The variable itself is always the factor that gets differentiated away.

Is the gradient ever zero away from the origin?

No. The three equations y+z=0y+z=0, x+z=0x+z=0, x+y=0x+y=0 form a linear system whose only solution is x=y=z=0x=y=z=0, so the origin is the sole critical point.