Multivariable calculus

Directional derivative of arctan(y/x) at (1, 1)

At (1, 1) the gradient of f(x,y) = arctan(y/x) is (-1/2, 1/2). Dotting with the unit direction (-0.6, 0.8) gives 7/10, that is 0.7. This function measures the polar angle, so its gradient points around the origin rather than away from it.

f(x,y)=arctan ⁣(yx)f(x,y) = \arctan\!\left(\frac{y}{x}\right)
Duf(1,1)=710=0.7D_{\mathbf{u}} f(1,1) = \frac{7}{10} = 0.7

At x = 1, y = 1, in the unit direction (-0.6, 0.8).

Chain rule through the quotient

Let u=y/xu = y/x. Then arctan(u)\arctan(u) differentiates to u1+u2\frac{u'}{1+u^2}, and the denominator 1+y2/x21 + y^2/x^2 becomes x2+y2x2\frac{x^2+y^2}{x^2}, which is what clears the fractions.

fx=y/x21+y2/x2=y/x2x2x2+y2=yx2+y2\frac{\partial f}{\partial x} = \frac{-y/x^2}{1 + y^2/x^2} = \frac{-y/x^2 \cdot x^2}{x^2 + y^2} = -\frac{y}{x^2+y^2}

The yy partial runs the same way with inner derivative 1/x1/x, giving xx2+y2\frac{x}{x^2+y^2}. At (1,1)(1,1) the denominator is 2.

f(1,1)=12,12,Duf(1,1)=12(0.6)+12(0.8)=710\nabla f(1,1) = \left\langle -\frac{1}{2}, \frac{1}{2} \right\rangle, \qquad D_{\mathbf{u}} f(1,1) = -\tfrac{1}{2}(-0.6) + \tfrac{1}{2}(0.8) = \frac{7}{10}

The mistake: losing the minus sign

The inner derivative x ⁣(yx)\frac{\partial}{\partial x}\!\left(\frac{y}{x}\right) is yx2-\frac{y}{x^2}, not yx2\frac{y}{x^2}. Drop that sign and the gradient becomes 12,12\langle \frac{1}{2}, \frac{1}{2} \rangle, and the answer drops to 0.10.1 instead of 0.70.7.

There is a quick sanity check. Moving in the +x+x direction from (1,1)(1,1) swings the point closer to the positive xx axis, so the polar angle goes down. A negative xx partial is the only sign that can be right.

The domain trap matters too: y/xy/x is undefined on the yy axis, so this formula for the angle only works on x0x \neq 0, and only equals the polar angle on the right half plane x>0x > 0.

A gradient that circles the origin

The level curves of the polar angle are rays out of the origin, so the gradient must be perpendicular to those rays, meaning it points tangentially. At (1,1)(1,1) that is the direction 1,1/2\langle -1, 1 \rangle / \sqrt{2}, counterclockwise.

f(1,1)=120.7071\lVert \nabla f(1,1) \rVert = \frac{1}{\sqrt{2}} \approx 0.7071

Our answer 0.7 is nearly that maximum, because 0.6,0.8\langle -0.6, 0.8 \rangle misses the steepest direction by only about 8.1 degrees. Moving radially outward instead would give exactly 0, since the angle does not change along a ray.

The expression needs x nonzero, and (1, 1) sits safely in the right half plane. The build rebuilds the gradient there by central differences on arctan(y/x) and fails unless the dot product with (-0.6, 0.8) is still 0.7.

Frequently asked questions

Does the answer depend on how far the point is from the origin?

Yes. The gradient has length 1/x2+y21/\sqrt{x^2+y^2}, so it shrinks as you move out. At (2,2)(2,2) the same direction gives 0.350.35, half as much, because the same angular change takes twice the distance.

Which direction makes the polar angle change fastest at (1, 1)?

The unit vector 1,1/20.707,0.707\langle -1, 1 \rangle / \sqrt{2} \approx \langle -0.707, 0.707 \rangle, tangent to the circle of radius 2\sqrt{2}, with rate 1/20.7071/\sqrt{2} \approx 0.707.