Existence of partial derivatives not implies differentiable
Contents
Statement
For a function of two variables at a point
It is possible to have the following: a function of two variables
and a point
in the domain of the function such that both the partial derivatives
and
exist, but the gradient vector of
at
does not exist, i.e.,
is not differentiable at
.
For a function of two variables overall
It is possible to have the following: a function of two variables
such that the partial derivatives
and
exist everywhere on
, but the gradient vector
is not defined everywhere, i.e., there is some point in
where
does not exist.
For a function of multiple variables
We can replace functions of two variables by functions of more than two variables in both the above formulations.
Related facts
- Separately continuous not implies continuous
- Existence of directional derivatives in every direction not implies differentiable
- Continuous along every linear direction not implies continuous
Proof
Example of a function for which the partial derivatives exist but it is not continuous
We give a single example that illustrates both versions of the statement.
Consider the function:
It's clear that is differentiable at all points other than
. At the point
, we note that:
- On the
-axis, the function is
, i.e., it is identically the zero function along the
-axis. Thus,
, i.e., the partial derivative exists and equals zero.
- On the
-axis, the function is
, i.e., it is identically the zero function along the
-axis. Thus,
, i.e., the partial derivative exists and equals zero.
On the other hand, is not continuous at
. To see this, consider the limit along the line
. Setting
, we get that the limit is:
Note that if the function were indeed continuous at , the limit along every direction would equal the value at the point, so this shows that the function is not continuous at
.
Since is not continuous at
, it cannot be differentiable at
. Another way of seeing the above computation is that since
is not continuous along the direction
, the directional derivative along that direction does not exist, and hence
cannot have a gradient vector.
Idea behind example
The secret behind the example can be better understood using polar coordinates, though this is not necessary to understand the example itself. In polar coordinates, we can rewrite where:
Here's how we get this. Plug in and
in the original expression for points other than the origin. We have:
- If
is a multiple of
(this includes the positive
-direction, positive
-direction, negative
-direction, and negative
-direction), the function is identically zero along the half-line corresponding to
.
- If
is not a multiple of
, the function along the half-line corresponding to
is the constant function with value
, a nonzero number. In particular, it is discontinuous at
, where the value suddenly jumps to zero. In particular, it is not differentiable along this direction.
Example of a function where the partial derivatives exist and the function is continuous but it is not differentiable
Consider the multiplicatively separable function:
We are interested in the behavior of at
.
This is slightly different from the other example in two ways. First, the partials do not exist everywhere, making it a worse example than the previous one. Second, the function is continuous at the point
where both partial derivatives exist, and is still not differentiable, making it a better example than the previous one.
We first note that:
- For
and
, both partial derivatives
exist. We have
and
.
- For points on the
-axis other than the origin (i.e., we have
),
exists and equals zero. This is because the function
is identically zero along the
-axis. However,
does not exist.
- For points on the
-axis other than the origin (i.e., we have
),
exists and equals zero. This is because the function
is identically zero along the
-axis. However,
does not exist.
- At the origin, both the partial derivatives
exist and equal zero. This is because the function
is identically zero along both the
- and the
-axis.
The upshot is that has partial derivatives at
.
However, is not differentiable at
. To see this, consider computing the directional derivative of
along the line
, i.e., along the unit vector
. We get that the directional derivative is:
The limit simplifies to:
The denominator approaches zero, so the limit expression is not finite. In particular, the directional derivative in this direction does not exist. The conclusion is that the function is not differentiable.