Multivariable calculus

Partial Derivatives of x^2 y/(x^2 + y^2 + 1)

For f(x,y) = x^2 y/(x^2 + y^2 + 1), the partial with respect to x is 2xy(y^2 + 1) divided by (x^2 + y^2 + 1) squared, and the partial with respect to y is x^2(x^2 - y^2 + 1) divided by the same square. The function is not symmetric, so neither partial follows from the other by swapping letters.

f(x,y)=x2yx2+y2+1f(x,y) = \frac{x^{2}y}{x^{2} + y^{2} + 1}
fx=2xy(y2+1)(x2+y2+1)2\frac{\partial f}{\partial x} = \frac{2xy\left(y^{2}+1\right)}{\left(x^{2}+y^{2}+1\right)^{2}}
fy=x2(x2y2+1)(x2+y2+1)2\frac{\partial f}{\partial y} = \frac{x^{2}\left(x^{2}-y^{2}+1\right)}{\left(x^{2}+y^{2}+1\right)^{2}}

Two quotient rules that collect differently

Write D=x2+y2+1D = x^{2}+y^{2}+1 so the algebra stays short. Both partials are quotient rule problems, but they do not mirror each other, because xx appears squared in the numerator while yy appears only once.

Differentiating in xx with yy frozen, the numerator x2yx^{2}y has xx-derivative 2xy2xy, and DD has xx-derivative 2x2x.

fx=2xyDx2y(2x)D2=2xy(Dx2)D2\frac{\partial f}{\partial x} = \frac{2xy\,D - x^{2}y(2x)}{D^{2}} = \frac{2xy\left(D - x^{2}\right)}{D^{2}}

The bracket is where the simplification lives: Dx2=y2+1D - x^{2} = y^{2}+1, so every x2x^{2} cancels out of it.

fx=2xy(y2+1)(x2+y2+1)2\frac{\partial f}{\partial x} = \frac{2xy\left(y^{2}+1\right)}{\left(x^{2}+y^{2}+1\right)^{2}}

Now freeze xx. The numerator has yy-derivative x2x^{2} and DD has yy-derivative 2y2y, so this time the common factor pulled out front is x2x^{2} and the bracket is D2y2=x2y2+1D - 2y^{2} = x^{2}-y^{2}+1.

fy=x2Dx2y(2y)D2=x2(x2y2+1)(x2+y2+1)2\frac{\partial f}{\partial y} = \frac{x^{2}D - x^{2}y(2y)}{D^{2}} = \frac{x^{2}\left(x^{2}-y^{2}+1\right)}{\left(x^{2}+y^{2}+1\right)^{2}}

The mistake: reaching for a symmetry that is not there

When a function is unchanged by swapping xx and yy, the second partial comes free: swap the letters in the first. The shortcut is so convenient that people reach for it here, where it fails. Swapping letters in fx\frac{\partial f}{\partial x} produces 2xy(x2+1)/D22xy\left(x^{2}+1\right)/D^{2}, which is not the yy-partial at all.

  • Test the symmetry before you use it: f(y,x)=xy2x2+y2+1f(y,x) = \frac{xy^{2}}{x^{2}+y^{2}+1}, which is not f(x,y)f(x,y).
  • fx\frac{\partial f}{\partial x} carries a factor of yy, so it vanishes along the whole xx-axis.
  • fy\frac{\partial f}{\partial y} carries a factor of x2x^{2}, which is never negative, so its sign is decided entirely by the bracket x2y2+1x^{2}-y^{2}+1.

One line of checking catches a swapped answer. Put y=0y = 0: the function is identically zero along the xx-axis, so fx\frac{\partial f}{\partial x} has to vanish there, and the factor yy makes it do so. On the same axis fy=x2(x2+1)(x2+1)2=x2x2+1\frac{\partial f}{\partial y} = \frac{x^{2}\left(x^{2}+1\right)}{\left(x^{2}+1\right)^{2}} = \frac{x^{2}}{x^{2}+1}, which is positive away from the origin, and that is right: lifting yy off the axis makes ff positive.

Each vertical slice has a ridge

The sign of fy\frac{\partial f}{\partial y} is the sign of x2y2+1x^{2}-y^{2}+1. Fix xx and walk upward in yy: the surface climbs while y2<x2+1y^{2} < x^{2}+1 and falls once yy passes that value, so the slice has a single ridge rather than growing forever.

fy=0wheny=±x2+1\frac{\partial f}{\partial y} = 0 \quad \text{when} \quad y = \pm\sqrt{x^{2}+1}

At (1,1)(1,1) the denominator is 3, so D2=9D^{2} = 9. The xx-partial is 2(1)(1)(2)9=49\frac{2(1)(1)(2)}{9} = \frac{4}{9} and the yy-partial is 1(11+1)9=19\frac{1(1-1+1)}{9} = \frac{1}{9}.

f(1,1)=49,  19\nabla f(1,1) = \left\langle \tfrac{4}{9},\; \tfrac{1}{9} \right\rangle

The yy-component is still positive because 1<21 < \sqrt{2}, so (1,1)(1,1) sits below the ridge of its slice. Move to (1,2)(1,2) and the same formula gives 118-\frac{1}{18}: past the ridge, on the way down.

Frequently asked questions

Can I get the y-partial by swapping x and y in the x-partial?

No, because ff is not symmetric in the two variables. Swapping is legal only when f(y,x)=f(x,y)f(y,x) = f(x,y), and here the numerator x2yx^{2}y breaks that. Run the second quotient rule properly; it takes three lines and pulls out a different common factor.

Where is the gradient zero?

The xx-partial needs x=0x = 0 or y=0y = 0. The yy-partial needs x=0x = 0 or y2=x2+1y^{2} = x^{2}+1. Taking y=0y = 0 in the second condition would force x2=1x^{2} = -1, so the only way to satisfy both is x=0x = 0. The critical set is exactly the yy-axis, where ff is zero. Step off it with y>0y>0 and ff turns positive; step off with y<0y<0 and it turns negative.