When Directional Information Is Not Enough
A directional derivative measures how a function changes when we approach a point along one chosen straight line. It is tempting to think that if this rate exists in every direction, then all those rates must fit together as the components of a gradient. That conclusion is false.
The key distinction is that directional derivatives test one direction at a time. Differentiability requires a single linear approximation that works for all small changes at once. We will examine a continuous function whose directional derivative exists in every direction at the origin, but whose directional rates cannot come from any gradient vector.
For a differentiable function, the gradient predicts the directional derivative: \(D_{\mathbf{v}}f(\mathbf{p})=\nabla f(\mathbf{p})\cdot\mathbf{v}\). The dot product is linear in \(\mathbf{v}\). The example below shows that directional derivatives may all exist without obeying this linearity requirement.
A Continuous Counterexample
Define \(f:\mathbb{R}^2\to\mathbb{R}\) by
The formula away from the origin is a quotient, so it is not defined there. The separate value at the origin makes \(f\) a function on all of \(\mathbb{R}^2\). We will calculate its directional derivatives at the origin, compare them with a possible gradient, and then check differentiability directly.
Worked Example: Compute the Directional Derivative in an Arbitrary Direction
Fix \(\mathbf{v}=(a,b)\). If \((a,b)\ne(0,0)\) and \(t\ne0\), then \((ta,tb)\ne(0,0)\). Substitution gives
Since \(f(0,0)=0\), the difference quotient is
This expression does not depend on \(t\), so its limit exists. If \((a,b)=(0,0)\), the difference quotient is instead \(0\) for every \(t\ne0\). Thus the derivative exists in every direction, with
For a check, take \(\mathbf{v}=(2,1)\). The formula gives \(D_{(2,1)}f(0,0)=\frac{2^3}{2^2+1^2}=\frac{8}{5}\). Directly, \(f(2t,t)=\frac{8t^3}{5t^2}=\frac{8t}{5}\), so \(\frac{f(2t,t)-f(0,0)}{t}=\frac{8}{5}\), as required.
This computation establishes existence for every fixed direction. It does not yet show whether these rates are consistent with a gradient. For that, we must check how the derivative values relate to one another as the direction changes.
What Differentiability Would Require
Here differentiability means that there is a vector \(\mathbf{g}\) such that
The vector \(\mathbf{g}\) is the gradient \(\nabla f(\mathbf{p})\). The condition on the remainder says that the error in the linear approximation becomes negligible compared with the length of the displacement.
To justify the theorem, fix a nonzero \(\mathbf{v}\) and put \(\mathbf{h}=t\mathbf{v}\). The differentiability expansion becomes
As \(t\to0\), the last term tends to zero: indeed, its absolute value is \(\frac{|r(t\mathbf{v})|}{\|t\mathbf{v}\|}\|\mathbf{v}\|\), which tends to zero by the defining remainder condition. Therefore the difference quotient tends to \(\mathbf{g}\cdot\mathbf{v}\), proving the directional derivative formula. For the zero direction, both the directional derivative and the dot product are zero. Since dot products are linear in \(\mathbf{v}\), the directional derivatives of a differentiable function must have that same linear dependence.
Worked Example: Test Whether the Rates Can Come from a Gradient
The coordinate directions determine the only possible gradient. For \(\mathbf{e}_1=(1,0)\), the formula gives
For \(\mathbf{e}_2=(0,1)\), it gives
If a gradient existed, its components would be these coordinate directional derivatives, so the only candidate would be \(\nabla f(0,0)=(1,0)\). This candidate predicts a rate of \((1,0)\cdot(1,1)=1\) in direction \((1,1)\). But the actual directional derivative is
The prediction and the computed derivative disagree: \(1\ne\frac12\). Thus no gradient vector can produce all the directional derivatives. Equivalently, the directional rates fail additivity: \(D_{(1,0)}f+D_{(0,1)}f=1\), whereas \(D_{(1,1)}f=\frac12\). This contradicts the necessary linearity of directional derivatives at a differentiability point.
Checking Differentiability from the Definition
The failed gradient test already proves that \(f\) is not differentiable at the origin, by the theorem. A direct remainder calculation makes the failure concrete. First, the coordinate directions force any gradient at the origin to be \((1,0)\). We can test the linear approximation associated with that only possible candidate.
Worked Example: The Linear Approximation Remainder Does Not Vanish
Approach the origin along points \(\mathbf{h}=(s,s)\), where \(s\ne0\). Then
The candidate linear approximation is \(f(0,0)+(1,0)\cdot(s,s)=s\). Its remainder is therefore
The displacement length is \(\|(s,s)\|=\sqrt{2}|s|\), so the relative error is
This ratio is a fixed positive number, not a quantity tending to zero as \(s\to0\). The required differentiability condition fails. The check confirms that the candidate gradient does not give a valid linear approximation.
Continuity Does Not Repair the Problem
This example is continuous at the origin, so the failure is not merely caused by a jump in function values. For every \((x,y)\ne(0,0)\),
As \((x,y)\to(0,0)\), the final bound tends to zero. Since \(f(0,0)=0\), this proves continuity there. The example therefore has all three properties: it is continuous at the point, its directional derivative exists in every direction, and it is not differentiable there.
The different conditions measure different things. Continuity controls the function values near a point. Directional derivatives control limits along individual lines through that point. Differentiability requires one linear map to approximate changes in every direction simultaneously. Neither continuity nor existence of all directional derivatives supplies that common linear approximation.
A Useful Contrast
For comparison, consider \(g(x,y)=x^2+y^2\) at the origin. Along \((ta,tb)\),
Thus \(D_{(a,b)}g(0,0)=0\) for every direction, which is the linear function of direction given by the zero gradient. In addition, \(g(x,y)=o(\sqrt{x^2+y^2})\) at the origin, since \(g(x,y)/\sqrt{x^2+y^2}=\sqrt{x^2+y^2}\to0\); hence \(g\) is differentiable there. This comparison reinforces the distinction: linear directional data are necessary for differentiability, while the differentiability definition also requires the actual function values to admit the corresponding first-order approximation.
How to Evaluate Directional Data
When all directional derivatives at a point are available, a practical test for whether they could arise from a gradient is to compare them with the linearity that a gradient would impose. In two variables, the coordinate directions fix the only possible gradient. Other directions then test that candidate. A mismatch rules out differentiability immediately; agreement in selected directions, however, does not by itself prove differentiability.
These are the partial derivatives, when they exist, and they give the only possible gradient components.
Use the candidate gradient's dot product with a direction vector.
If the values differ, the directional derivatives cannot come from a gradient, so differentiability fails.
To establish differentiability, verify that the remainder divided by the displacement length tends to zero, rather than checking only a few lines.
Check Your Understanding
Use the definition of a directional derivative and the relationship between differentiability and linear approximation to answer these questions.
- For the function \(f\) in this tutorial, calculate \(D_{(1,-1)}f(0,0)\).
- What gradient is forced by the directional derivatives in the two coordinate directions?
- Why does the value of \(D_{(1,1)}f(0,0)\) rule out that gradient?
- State the theorem that relates differentiability to directional derivatives, and explain why it requires linear dependence on the direction.
- How does the remainder along \((s,s)\) demonstrate failure of differentiability?
- Does existence of directional derivatives in every direction guarantee continuity? Does continuity together with their existence guarantee differentiability? Explain what this example establishes.