# Existence of directional derivatives in every direction not implies differentiable

## Contents

## Statement

### For a function of two variables at a point

It is possible to have a function of two variables and a point in the domain of such that has a directional derivative in *every* direction at , but is not differentiable at , i.e., the gradient vector of at does not exist.

### For a function of two variables overall

It is possible to have a function of two variables and a point in the domain of such that has a directional derivative along *every* direction at *every point* but is not differentiable everywhere, i.e., there exists a point where the gradient vector of does not exist.

### For a function of multiple variables

We can replace functions of two variables by functions of more than two variables.

## Related facts

- Continuous in every linear direction not implies continuous
- Separately continuous not implies continuous
- Existence of partial derivatives not implies differentiable

## Proof

### Example

Consider the function:

Alternatively, we can describe it as:

We first argue that is continuous at all points other than :

- At any point with , the function is the zero function
*around*the point, hence is differentiable with gradient vector the zero vector. - At any point with , the function is the zero function
*around*the point, hence is differentiable with gradient vector the zero vector. - At any point with , the function has the rational function description
*around*the point, hence is differentiable with gradient vector the zero vector. - At any point on the line other than the origin, there are two definitions of the function around the point: the definition 0 (from the side), and the definition (from the side). Both definitions evaluate to zero at the point,
*and*the gradient vectors corresponding to both definitions are zero vectors, so the function is differentiable and its gradient vector is the zero vector. - At any point on the curve other than the origin, there are two definitions of the function around the point: the definition 0 (from the side), and the definition (from the side). Both definitions evaluate to zero at the point,
*and*the gradient vectors corresponding to both definitions are zero vectors, so the function is differentiable and its gradient vector is the zero vector.

We now argue that has directional derivative zero in every *linear* direction at . It suffices to consider *half-line* directions because continuity from a linear direction is continuity from both half-line directions.

- For the half-line directions that are below or along the line, the function is identically zero along the half-line, so the directional derivative is zero.
- For the half-line directions that are above , we note that,
*sufficiently close to the origin*, this half-line is completely above the curve (explicitly, if the slope of the line is , then the half-line is above for ). Thus, sufficiently close to the origin, looks like the zero function on this half-line. Thus, the directional derivative is zero.

We finally demonstrate that is not continuous at by finding a curve approaching the origin along which the limit at the origin is not zero. Consider the curve:

Consider the limit:

Since the function is not continuous at , it cannot be differentiable and cannot have a gradient vector at .