Multivariable calculus
Gradient of ln of sqrt(x^2 + y^2): The Log Potential
For f(x, y) = ln sqrt(x^2 + y^2) the gradient is (x, y) divided by x^2 + y^2. Use the log rule to rewrite f as one half ln(x^2 + y^2) before differentiating. The result is a radial field pointing away from the origin whose length is 1 over r, the classic two dimensional logarithmic potential.
Simplify with log rules before you differentiate
A square root inside a logarithm is a half power, and logarithms turn powers into multipliers. Do that first and the chain rule has only one layer to handle.
Now differentiate. The outer derivative gives , the inner derivative gives , and the out front cancels the .
The component is identical with the letters exchanged, which the symmetry of demands. In polar form, , and the gradient is in the radial direction.
What the field looks like
Level curves of are circles about the origin, so the gradient must be radial, and since increases outward it points away from the origin. Its length falls off like .
At , where , the gradient is , of length .
This field is worth recognising on sight. It is the two dimensional analogue of an inverse square law, it is the velocity field of a point source in fluid flow, and it is the potential whose Laplacian vanishes everywhere except the origin. That last fact is easy to check: .
Nothing here is defined at the origin. Both and its gradient blow up there, so any statement about this surface carries the standing condition .
The mistake: differentiating the square root by brute force
Attacked without the log rule, the derivative becomes a two layer chain: the derivative of evaluated at , times the derivative of the square root, times the derivative of the inside. Done correctly it still works.
Done in a hurry it produces , which drops one of the two square roots. The give-away is the size of the answer far from the origin: the true gradient shrinks like , while the wrong one has constant length , which would mean a logarithm climbing at a fixed rate forever.
A second slip is writing for the whole partial, forgetting the inner and the that tames it.
Frequently asked questions
Why does the disappear from the answer?
It cancels against the produced by differentiating . Written out, collapses to . If your answer still carries a stray factor of or , that cancellation is where to look.
What happens to this gradient at the origin?
It does not exist there, and neither does , since is undefined. The gradient has length , which grows without bound as you approach the origin, so no limiting value can be assigned. The natural domain is the punctured plane.