Multivariable calculus

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

For f(x,y) = (x^2 - y^2)/(x^2 + y^2 + 1), the partial with respect to x is 2x(2y^2 + 1) divided by (x^2 + y^2 + 1) squared, and the partial with respect to y is -2y(2x^2 + 1) divided by the same square. Both come from the quotient rule after collecting terms.

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

The quotient rule, then the collection step

Set N=x2y2N = x^{2}-y^{2} and D=x2+y2+1D = x^{2}+y^{2}+1. In xx, the numerator has derivative 2x2x and the denominator has derivative 2x2x as well, which makes the cancellation unusually tidy.

fx=2xDN(2x)D2=2x(DN)D2\frac{\partial f}{\partial x} = \frac{2x\,D - N(2x)}{D^{2}} = \frac{2x\left(D - N\right)}{D^{2}}

The bracket DND - N is where the work happens: (x2+y2+1)(x2y2)=2y2+1\left(x^{2}+y^{2}+1\right) - \left(x^{2}-y^{2}\right) = 2y^{2}+1. The x2x^{2} terms cancel completely.

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

In yy the numerator derivative is 2y-2y and the denominator derivative is 2y2y, so the two quotient rule terms both carry 2y-2y once you factor, giving 2y(D+N)-2y(D+N) over D2D^{2}, and D+N=2x2+1D + N = 2x^{2}+1.

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

The mistake: stopping before you collect

An unsimplified quotient rule answer is not wrong, but it hides everything useful. Left as 2xD2xND2\frac{2xD - 2xN}{D^{2}}, you cannot see that the factor 2y2+12y^{2}+1 is strictly positive, so you cannot see that the sign of the xx-partial is exactly the sign of xx.

  • Since 2y2+1>02y^{2}+1 > 0 always, fx\frac{\partial f}{\partial x} is positive for x>0x>0 and negative for x<0x<0.
  • Since 2x2+1>02x^{2}+1 > 0 always, fy\frac{\partial f}{\partial y} has the sign opposite to yy.
  • Both partials vanish only at the origin, which is therefore the only critical point.

That sign information identifies the origin as a saddle without any second derivative test: the surface rises as you move away along the xx-axis and falls as you move away along the yy-axis.

Checking with symmetry

Swapping xx and yy turns ff into f-f, because the numerator changes sign and the denominator does not. So the yy-partial must be the negative of the xx-partial with the letters exchanged, and comparing the two boxed answers confirms exactly that.

At (1,1)(1,1) the denominator is 3, so D2=9D^{2} = 9, and the xx-partial is 2(3)9=23\frac{2(3)}{9} = \frac{2}{3} while the yy-partial is 23-\frac{2}{3}.

f(1,1)=23,  23\nabla f(1,1) = \left\langle \tfrac{2}{3},\; -\tfrac{2}{3} \right\rangle

The gradient points along the direction that increases xx and decreases yy, straight up the saddle.

Frequently asked questions

Why do the x-squared terms cancel in the x-partial?

Because the numerator and denominator have the same x2x^{2} coefficient. The quotient rule produces 2x(DN)2x(D - N), and DND - N subtracts x2y2x^{2}-y^{2} from x2+y2+1x^{2}+y^{2}+1, killing the x2x^{2} and doubling the y2y^{2}. This kind of cancellation is common when numerator and denominator share terms.

What is the range of this function?

The value is squeezed between 1-1 and 11, since x2y2x2+y2<x2+y2+1\left|x^{2}-y^{2}\right| \le x^{2}+y^{2} < x^{2}+y^{2}+1. The function approaches those bounds far out along the axes but never reaches them, which matches the fact that the partials tend to zero at large distances.