Multivariable calculus
Partial Derivatives of sqrt(x^2 + y^2 + z^2 + 1)
For f(x,y,z) = sqrt(x^2 + y^2 + z^2 + 1), the partial derivative with respect to x is x divided by that same square root, and the y and z partials replace x with y and z. A useful check is that f times the x partial equals x exactly.
Rewrite the root as a power, then chain
Square roots are easiest to differentiate once you write them as a one half power. Put , so . The power rule gives , and the chain rule multiplies by .
The from the inside derivative cancels the from the power rule, which is why the numerator ends up as a bare rather than . That cancellation happens every time you differentiate the square root of a sum of squares, so it is worth recognising on sight.
The mistake: taking the root apart
The tempting shortcut is to treat as though the root distributes over the sum. It does not. There is no valid step from to , and any answer built on that is wrong from the first line.
The other frequent error is forgetting the cancellation and leaving unsimplified, or worse, leaving , which is twice the true value. Write the two half powers out explicitly the first few times so the cancellation is visible rather than remembered.
- Wrong: distributing the root across the sum before differentiating.
- Wrong: , which keeps the inside derivative but drops the one half.
- Right: , where the and the have cancelled.
Two checks and why the plus one is there
Because the numerator is and the denominator is itself, multiplying through gives a clean identity. If your answer does not satisfy it, a factor has gone astray.
At the inside is , so and the partial is , about . Multiplying those two gives , which is the coordinate, as the identity promises.
The inside the root is what makes this function well behaved everywhere. The pure distance function has no partial derivatives at the origin, because the graph comes to a point there. Adding lifts the surface off that corner, so is smooth on all of space.
Frequently asked questions
How big can the gradient of this function get?
Its length is , which is always less than and approaches far from the origin. So the surface steepens toward slope but never reaches it.
Why does the pure distance function fail at the origin?
Along the axis reduces to , and the absolute value has a corner at where the left and right slopes are and . The in this page's function removes that corner.