Multivariable calculus
Gradient of arctan(y/x): The Polar Angle Field
For f(x, y) = arctan(y/x) the gradient is (-y, x) divided by x^2 + y^2. Differentiate the arctangent to get 1 over 1 plus the square of y over x, then multiply by the derivative of y over x and clear the fractions. The result is perpendicular to the position vector, with length 1 over r.
Chain rule, then clear the compound fraction
Use with . For the partial, is frozen, so is a constant divided by and .
The compound fraction is the step people abandon. Multiply the top and bottom of the first factor by .
The partial is easier, since .
Both factors cancel completely, which is the sign that the answer wants to be written in terms of rather than in terms of the quotient you started with.
This function is the polar angle
For , is exactly the polar angle . Its level curves are rays out of the origin, and the gradient must be perpendicular to those rays, so it circles the origin.
The dot product with the position vector is zero at every point, confirming the circulation. The length is again , since the numerator vector has length .
At the gradient is , pointing counterclockwise, which is the direction in which the angle increases.
This field returns later in the course as the standard example that a curl-free field on a region with a hole need not be conservative. Its circulation around a loop enclosing the origin is , not zero, because itself cannot be defined continuously all the way round.
The mistake: mishandling the inner quotient
Two errors cover most wrong answers.
- Writing , losing the square in the denominator. Rewrite the quotient as and the power rule hands you with no ambiguity.
- Leaving the answer as and treating it as finished. It is correct but unusable, and it hides the fact that the two components differ only by a swap and a sign.
Check at , on the positive axis: the true gradient is . Moving in from there starts sweeping the angle upward at rate , while moving along the axis does not change the angle at all. Any candidate answer with a nonzero first component at that point is wrong.
One boundary condition to keep stated: everything here requires , since the formula is undefined on the axis even though the angle itself is perfectly well behaved there.
Frequently asked questions
Why does the gradient of have no in it?
Because the derivative of the arctangent is a rational function, . Once you substitute and clear the compound fraction, everything left is rational in and , so the inverse trig function disappears entirely.
Is this gradient perpendicular to the gradient of ?
Yes. That one is and this one is , and their dot product is zero. That is the polar coordinate picture: increases radially and increases tangentially, and the two directions are at right angles.