Multivariable calculus

Gradient of xy/(z^2+1): A Three Variable Gradient

For f(x, y, z) = xy/(z^2 + 1) the gradient components are y/(z^2 + 1), then x/(z^2 + 1), then -2xyz divided by (z^2 + 1) squared. Only the z component needs the chain rule, because z appears only in the denominator. At (1, 2, 0) the gradient is (2, 1, 0).

f(x,y,z)=xyz2+1f(x,y,z) = \dfrac{xy}{z^2 + 1}
f(x,y,z)=yz2+1, xz2+1, 2xyz(z2+1)2\nabla f(x,y,z) = \left\langle \dfrac{y}{z^2 + 1},\ \dfrac{x}{z^2 + 1},\ \dfrac{-2xyz}{\left(z^2 + 1\right)^2} \right\rangle
fx=yz2+1\frac{\partial f}{\partial x} = \frac{y}{z^2 + 1}
fy=xz2+1\frac{\partial f}{\partial y} = \frac{x}{z^2 + 1}
fz=2xyz(z2+1)2\frac{\partial f}{\partial z} = \frac{-2xyz}{\left(z^2 + 1\right)^2}

Two easy partials, then one that needs the chain rule

Sort the variables by where they live. Both xx and yy appear only upstairs, and zz appears only downstairs. That tells you in advance which partial is the awkward one.

For fx\frac{\partial f}{\partial x}, everything except xx is a constant, so the whole function is (yz2+1)x\left(\frac{y}{z^2+1}\right)x.

fx=yz2+1,fy=xz2+1\frac{\partial f}{\partial x} = \frac{y}{z^2 + 1}, \qquad \frac{\partial f}{\partial y} = \frac{x}{z^2 + 1}

For fz\frac{\partial f}{\partial z}, pull out the constant xyxy and differentiate (z2+1)1\left(z^2+1\right)^{-1} with the power and chain rules.

fz=xy(1)(z2+1)2(2z)=2xyz(z2+1)2\frac{\partial f}{\partial z} = xy \cdot \left(-1\right)\left(z^2 + 1\right)^{-2}(2z) = \frac{-2xyz}{\left(z^2 + 1\right)^2}

At (1,2,0)(1,2,0) the denominator is 11, and the third component carries a factor of z=0z = 0, so f(1,2,0)=2,1,0\nabla f(1,2,0) = \langle 2, 1, 0\rangle. At (1,1,1)(1,1,1) the denominator is 22 and the gradient is 12,12,12\left\langle \tfrac{1}{2}, \tfrac{1}{2}, -\tfrac{1}{2}\right\rangle.

The mistake: treating the denominator as inert in the z direction

Because zz never appears in the numerator, students often conclude that fz=0\frac{\partial f}{\partial z} = 0. That would say the value of ff does not depend on zz at all, which is false: at z=0z = 0 the fraction is xyxy, and at z=3z = 3 it is only xy10\frac{xy}{10}.

The other slip is dropping the minus sign. Increasing z\left|z\right| grows the denominator, which shrinks f\left|f\right|, so the zz partial must oppose the sign of xyzxyz.

  • A variable in the denominator still counts as a variable.
  • z[(z2+1)1]=2z(z2+1)2\frac{\partial}{\partial z}\left[\left(z^2+1\right)^{-1}\right] = -2z\left(z^2+1\right)^{-2}, so the sign flips and the exponent drops to 2-2.
  • Slice check with x=y=1x = y = 1: g(z)=1z2+1g(z) = \frac{1}{z^2+1} has g(1)=24=12g'(1) = \frac{-2}{4} = -\tfrac{1}{2}, matching the third component at (1,1,1)(1,1,1).

Reading the geometry from the three components

The factor 1z2+1\frac{1}{z^2+1} never exceeds 11 and never reaches zero, so it acts as a damping dial. Sliding away from the plane z=0z = 0 in either direction flattens the saddle shape xyxy without changing which way it tilts.

The plane z=0z = 0 is exactly where the third component vanishes, because of the factor zz. On that plane the gradient reduces to y,x,0\langle y, x, 0\rangle, the gradient of xyxy with a zero appended.

The gradient is the zero vector when y=0y = 0, x=0x = 0 and xyz=0xyz = 0 all hold, which is the whole zz-axis. Along that axis f=0f = 0, and nearby values take both signs, so none of those points is a maximum or a minimum.

Frequently asked questions

Why is the z component of this gradient zero on the plane z = 0?

The numerator 2xyz-2xyz carries a factor of zz. Geometrically, 1z2+1\frac{1}{z^2+1} has a maximum at z=0z = 0, so moving a little in either zz direction changes the damping factor only to second order and the first derivative vanishes.

How large can the directional derivative of xy/(z^2+1) be at (1, 1, 1)?

At most the length of the gradient, 12,12,12=32\left|\left\langle \tfrac12, \tfrac12, -\tfrac12\right\rangle\right| = \frac{\sqrt{3}}{2}, which is about 0.8660.866. That value is attained in the unit direction 131,1,1\frac{1}{\sqrt{3}}\langle 1, 1, -1\rangle.