40

I am new in this forum. My question: Suppose a real valued function $f: \mathbb{R} \rightarrow \mathbb{R}$ is continuous everywhere. Is it possible to construct $f$ that is differentiable at only one point? If possible, please give an example.

Note: I am aware that there is a function which is differentiable at a single point but discontinuous elsewhere. I also know about Weierstrass function that continuous everywhere but nowhere differentiable. But is there a function which is continuous but only differentiable in one point?

In fact, I found this discussion but unfortunately it still does not give a definitive answer. Moreover they consider only in an interval, whereas my problem is for the entire domain. Thank you very much

netsurfer
  • 591
  • 6
  • 6

1 Answers1

39

It is certainly possible. Fix a nowhere-differentiable function $f$ such that $0\leq f(x)\leq 1$ for all $x$. Now consider $x^2f(x)$. This is differentiable at $0$ but nowhere else. You can verify it is differentiable at $0$ using the limit definition of derivative. $$\lim_{h\to 0} \frac{h^2f(h)-0^2f(0)}{h}=\lim_{h\to 0}hf(h)$$ and $0\leq f(h)\leq 1$ implies $0\leq hf(h)\leq h$. So the limit goes to $0$ by the squeeze theorem.

To see it is not differentiable elsewhere is a slightly harder exercise. Suppose $x^2f(x)$ is differentiable at $x\neq 0$. Then $$\lim_{h\to 0} \frac{(x+h)^2f(x+h)-x^2f(x)}{h}=L.$$ Adding and subtracting a mixed term $x^2f(x+h)$ in the middle, this becomes $$ \lim_{h\to 0} \frac{(x+h)^2f(x+h)-x^2f(x+h)}{h}+\frac{x^2f(x+h)-x^2f(x)}{h}=L $$ The left-hand term limits to $2x f(x).$ The right-hand term limits to $x^2f'(x)$. This implies that $f'(x)$ exists, since it is equal to $x^{-2}(2xf(x)-L)$. (This fails for $x=0$.)

  • 2
    Presumably you mean to take $f$ continuous as well? In that case $xf(x)$ works. – Jonas Meyer Feb 12 '12 at 04:36
  • 1
    Thanks @Jonas for the improvement. I was fixated on getting a derivative of $0$... – Cheerful Parsnip Feb 12 '12 at 04:43
  • 13
    To show that $x^2 f(x)$ is not differentiable anywhere else, just use the fact that $g(x) h(x)$ is differentiable where $g$ and $h$ are, with $g(x) = x^2 f(x)$ and $h(x) = 1/x^2$. – Robert Israel Feb 12 '12 at 04:55
  • Thanks for your answers. Could you please give an example what $f$ is? If it is assumed to be continuous as @Jonas said, should it be Weierstrass function? Or can it be discontinuous function? – netsurfer Feb 12 '12 at 04:56
  • 1
    @netsurfer: If you take $x^2$ as Jim did, it could be any nowhere differentiable function that is bounded in a neighborhood of $0$. If you want the result to be continuous, then $f$ should be taken to be a continuous nowhere differentiable function, of which the Weierstrass function is only one example while any would do. And if $f$ is continuous, then $xf(x)$ is differentiable at $0$ with derivative $f(0)$, but not differentiable elsewhere because $f(x)=\frac{1}{x}\cdot xf(x)$ when $x\neq 0$ and $\frac{1}{x}$ is differentiable (see Robert's comment). – Jonas Meyer Feb 12 '12 at 05:01
  • Great! Thanks very much for your explanation. – netsurfer Feb 12 '12 at 05:14
  • Really nice answer! But I cannot understand only the last moment: you have shown that $f'(x)=x^{-2}(L-2xf(x))$, right? And what is the contradiction? You said this fails for $x=0$. But when we derived it we assumed that $x\neq 0$. Would be thankful for explanation! – RFZ Apr 15 '21 at 09:34
  • @ZFR Sorry for phrasing it so confusingly. The contradiction is that $f'(x)$ exists when $x\neq 0$. $f$ is nowhere differentiable. When I mentioned that this fails for $x=0$, I meant that this argument fails to produce a contradiction when $x=0,$ as expected. – Cheerful Parsnip Apr 15 '21 at 15:40
  • 1
    Thanks for your reply! Just want to be sure that I am understanding it in a correct way. We want to show that $g(x)$ is nowhere differentiable on $\mathbb{R} \setminus {0}$. Suppose it is differentiable at some point $x\neq 0$ then you have shown that $f'(x)=x^{-2}(L-2xf(x))$ which means that $f(x)$ is differentiable at $x\neq 0$ but this is a contradiction since $f(x)$ is a nowhere differentiable function. Right? – RFZ Apr 15 '21 at 16:00
  • @zfr yup, you got it. – Cheerful Parsnip Apr 15 '21 at 16:44
  • @CheerfulParsnip, Thank you so much for your help! I appreciate it – RFZ Apr 15 '21 at 16:49