# Regarding functions from R² to R: continuity and differentiability

Let $f : U \rightarrow \mathbb{R}$ where $U \subseteq \mathbb{R}^2$ is an open set and $P \in U$.

I am almost sure the following statements are correct, but please confirm:

1. The only requirement for $f$ to have a tangent plane at $P$ is: $\exists \ \nabla f(P)$ (in other words, both $\frac{\partial f}{\partial x}$ and $\frac{\partial f}{\partial y}$ exist at $P$. Edit: the partial derivatives must be continuous!

2. If the tangent plane exists, still not necessarily the function is continuous at $P$.

3. The statement 2 is reverse order: if the function is continuous at $P$, still not necessarily the tangent plane exists.

4. If the function happen to be continuous at $P$, still not necessarily the function is differentiable at $P$.

And now, assuming those are correct, my main question comes:

If $f$ is continuous at $P$, and $f$ has a tangent plane at $P$, is it possible that $f$ still is not differentiable?

I might have misunderstood what my teacher said, but it seems that the answer is yes! If you agree, can you provide at least one example?

Thank you!

EDIT (Six months later): This question awarded me the Tumbleweed badge and even after six months there hasn't been any answers, comments or even votes! Today something made me remember of this question. Fortunately, I already made some progress: I was able to confirm the statements 1, 3 and 4. I couldn't confirm statement 2 yet, and my main question also still stands (I put it in italic above). Thanks for any help.

EDIT 2 (May 28): Thanks for the attention. I have felt the need to quote James Stewart in his definition of tangent plane:

Suppose f has continuous partial derivatives. An equation of the tangent plane to the surface $z = f(x, y)$ at the point $P(x_0, y_0, z_0)$ is $$z - z_0 = f_x(x_0, y_0)(x - x_0) + f_y(x_0, y_0)(y - y_0)$$

Therefore, Stewart needs only continuous partial derivatives to define the tangent plane.

This shows that I was wrong about my statement 1. I have edited it now, adding the "must be continuous" requirement. This doesn't change any of my other thoughts though (yet).

I would like to emphasize that I am considering any weird function you could come up with, not just real life functions and such. In this question I am looking for properties that will formally apply in any case.

If anyone disagrees that statements 1, 3 and 4 are true please comment for further discussion (maybe I did miss something!).

Now I'll try to give an example of what makes me believe in statement 2: Please correct me if I'm wrong!

Take this weird function:

$$f(x, y)=\begin{cases} 0, & \text{if x = 0 or y = 0}.\\ \\ 1, & \text{otherwise}. \end{cases}$$

Hopefully, if I'm not mistaken, this function is an example that shows that my second statement is true. (please let me know if I'm mistaken).

Assuming everything is fine by now, don't forget of my main question:

If $f$ is continuous at $P$, and $f$ has a tangent plane at $P$, is it possible that $f$ still is not differentiable?

• How do you define a tangent plane? The definition I'm familiar with requires that $f$ is differentiable at the point, the existence of the partial derivatives is not sufficient for that definition. Consequently, continuity at a point is a necessary condition for the existence of a tangent plane at that point then. Commented May 23, 2015 at 22:40
• Thanks for your support! According to my Stewart Calculus book, 7th edition (translated), the tangent plane at $P = (x_0, y_0, z_0)$ is defined as the plane whose equation is $z - z_0 = f_x(x_0, y_0)(x - x_0) + f_y(x_0, y_0)(y - y_0)$, and does not need conditions except the existance of $f_x$ and $f_y$. Stewart even comments the fact that if the function is not differentiable, the tangent plane will give a terrible approximation to the function. But the tangent plane still exists. Commented May 24, 2015 at 23:42
• Hmm, I had the impression that Stewart assumes the partial derivatives are continuous when he defines the tangent plane, cf. the conversation between John Jack and me starting here. It seems he doesn't, going by your comment. Which means his definition differs from everybody else's (well, perhaps not everybody else). Commented May 25, 2015 at 11:12
• Wait, you're right!! Sorry about that! Indeed the partial derivatives must be continuous! I missed that. But is that equivalent to differentiability? (I will now look at the link you mentioned). Commented May 25, 2015 at 11:17
• It's not equivalent, it's stronger than differentiability. A function can be differentiable at a point without the partial derivatives even existing at any other point. But such examples are pathological, in cases one "naturally" comes across, that doesn't happen. Commented May 25, 2015 at 11:25

Like Daniel mentions in the comments, you have to first very carefully define what you mean by a "tangent plane."

Here's how I might do it: for any differentiable curve $\gamma: [-1,1]\to U,\ 0\mapsto P$, the tangent vector associated to $\gamma$, if it exists, is given by $$\frac{d}{dt}\left[\gamma(t), f(\gamma(t))\right]_{t\to 0}.$$

I'd say a tangent plane exists at $P$ if (i) the tangent vector exists for all $\gamma$, and (ii) they span a two-dimensional linear space.

Existence of the partial derivatives $f_x$ and $f_y$ is not enough to guarantee both of these conditions. Consider the standard counterexample

$$f(x,y) = \frac{(x-y)^2}{x^2+y^2}.$$

Here are a few $\gamma$ and their tangent vectors at $P=(0,0)$: \begin{align*} (t,0) &: (1,0,0)\\ (0,t) &: (0,1,0)\\ (t,t^2) &: (1,0,-2) \end{align*} these already span all of $\mathbb{R}^3$ so I would not say a tangent "plane" exists at $P=0$.

1. Existence of a tangent plane means that the limit of $f(x,y)$ as you approach $P$ along any path must be equal to $f(P)$, and so $f$ is continuous.

2. Certainly not.

3. Nope.

To summarize:

$$\nabla f \textrm{ exists and continuous} \Rightarrow f\textrm{ differentiable} \Leftrightarrow \textrm{tangent plane exists} \Rightarrow \begin{cases}f_x, f_y \textrm{ exist}\\f \textrm{ continuous}\end{cases}$$

• A differentiable function need not have a continuous gradient. Commented May 27, 2015 at 3:40
• @SantiagoCanez Quite right; fixed. Commented May 27, 2015 at 4:58
• Thank you. I like your idea to define a tangent plane, but I will have to study it more carefully later, to guarantee that I fully understood it. I am curious to see if your definition is equivalent to Stewart's definition (that I quoted on my newest edit on the question), or if it is stronger. Commented May 29, 2015 at 1:15