# Continuity, partial derivatives and total differential

Is it true that if I have some function $$f(x,y)$$, for which partial derivatives exist but it's not continuous, that this function cannot be differentiable (total differential doesn't exist)? But if my function is continuous and the partial derivatives do exist (and are also continuous), then it must be differentiable?

I am confused, for a long time. I have found some examples but I just want to be clear.

• How can partial derivatives exist at a point where the function isn't even defined (not continuous)? Commented Jun 14, 2017 at 2:03
• @KhalidT.Salem What?
– user223391
Commented Jun 14, 2017 at 2:07
• Partial derivatives can exist, they just aren't continuous, right?
– Leif
Commented Jun 14, 2017 at 2:09
• And the continuity of these partial derivates I can get if I take a limit of them... then the total differential exists? How actually I can find out that it exists? Like I have seen the definition with $''Lh''$ as the total differential but it was written implicitly.
– Leif
Commented Jun 14, 2017 at 2:17
• @Leif under right conditions total derivative can be expressed via Jacobian matrix Commented Jun 14, 2017 at 3:00

Here is a rough sketch of how you prove continuous first partials implies differentiability.

A function $f$ is differentiable at $x$ iff the change $f(x+h)-f(x)$ can be approximated by a linear map with a remainder term which is $o(h)$.

If a function has first partial derivatives defined at $x$ then it has arbitrary directional derivatives at $x$

A generalisation of the mean value theorem shows that in a small region, you can approximate the change by $f(x+h) - f(x)$ about $x$ by the values of the directional derivative of $f$ in the direction $h$ on the line segment joining $x$ and $x+h$.

If you construct a map $L$ which takes a vector and returns the directional derivative of $f$ in that direction, you will find that it is linear. If the partials are continuous, then you can prove that the remainder $f(x+h) - f(x) - Lh$ is $o(h)$ so $L$ is the derivative of $f$ at $x$.

I used this as a reference: https://www.math.ucdavis.edu/~hunter/book/ch13.pdf

Take the function

$$f (x,y)=(x^2+y^2)\cos (\frac {1}{\sqrt {x^2+y^2}})$$ and $f (0,0)=0$.

it is differentiable at $(0,0)$ but the partial derivatives are not continuous at $(0,0)$.

In two dimensions, differentiability always implies continuity. Because of this, the idea of a multi variable function having existing partials without continuity seems impossible. However, there is a small workaround. If we consider the definition of a partial derivative (assuming 3-D for now) it looks like this: $$\frac{\delta f(x, y)}{\delta x}=\lim_{h\to 0}\frac{f(x+h,y)-f(x,y)}{h}$$ This can evaluate without issue without the function being "continuous with respect to $y$", or more precisely, without $f(k, y)$ being continuous for some $k$. However, the function must be "continuous with respect to $x$", or more precisely $f(x, k)$ must be continuous. An example of such a function can be found below: $$f(x, y) = \begin{cases} x+1, &y\geq 0 \\ x^2, &y<0 \end{cases}$$ Take for example point $(0, 0)$. The function evaluates to $1$ at this point, however it is not continuous since $$\lim_{y\to 0}{f(0,y)}=0$$ However, if we plug this equation into the definition of the derivative, we get $$\frac{\delta f(x, y)}{\delta x}= \begin{cases} 1, & y\geq 0 \\ 2x, & y<0 \end{cases}$$ In the end, you are right in asserting that this entire function cannot have all partial derivatives defined everywhere, as this would require continuity everywhere.

For your second question, this is true. The differentiability of a multi variable function is implied by the existence and continuity of all partial derivatives. Because of this, your function having existing continuous partial derivatives everywhere necessarily means it is differentiable.

• I'm not sure I agree with your last two paragraphs. First, a continuous function can have partial derivatives defined everywhere, but not have them be continuous. See, for example math.tamu.edu/~tvogel/gallery/node18.html. Second, I have not seen anyone define differentiability via existence and continuity of all partial derivatives (though I've only read a small number of sources). What I have seen (e.g., in Marsden's book) is that a multivariate function $f(\vec{x})$ is differentiable at $\vec{x}_0$ if there is a linear map $A$ with .... Commented Jun 14, 2017 at 4:11
• $\lim_{\vec{x}\rightarrow \vec{x}_0} \frac{\|f(\vec{x}) - f(\vec{x_0}) - A\vec{x}\|}{\|\vec{x}-\vec{x}_0\|} = 0.$ It is then a theorem that if all the partials existence and are continuous, then $f$ is differentiable. In fact, in this case, $A$ is the matrix of partials evaluated at $\vec{x}_0$. Finally, there are known examples where all the partials exist everywhere, but the function is nonetheless not differentiable. Commented Jun 14, 2017 at 4:14
• I used wikipedia for my definition of differentiability, which says that "if all the partial derivatives of a function exist and are continuous in a neighborhood of a point, then the function is differentiable at that point." Admittedly, I have not looked into this much either. However, if you read carefully, what I say does not dispute your second sentence (which I agree with). What is new to me however is what you said in the last sentence, can you show me an example? Commented Jun 14, 2017 at 4:38
• I just added a "continuous" to the last sentence which I realize now is necessary to make it correct. Sorry if this created any confusion. Commented Jun 14, 2017 at 4:42
• I agree with wikipedia that those conditions guarantee that the function is differentiable, but they are not the definition of differentiable. According to en.wikipedia.org/wiki/…, the function $f(x,y) = \begin{cases} \frac{y^3}{x^2 + y^2} & \text{ if } (x,y)\neq (0,0)\\ 0 & \text{ if } (x,y) = (0,0)\end{cases}$ is continuous everywhere, with partials existing everywhere, but is nonetheless not differentiable at $(0,0)$. I confess I haven't checked the details to verify it. Commented Jun 14, 2017 at 4:43