Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm searching for counterexamples of functions $f$ and $g$ such that one of them is not differentiable but $f+g$ is differentiable. I've already found counterexamples of the product case ($f(x)=|x|$ and $g(x)=-|x|$) but I couldn't find examples of the sum case.

share|cite|improve this question
$f+(-f)$?${}{}{}{}{}$ – David Mitra Feb 25 '13 at 12:23
@DavidMitra thanks – user42912 Feb 25 '13 at 12:25
up vote 11 down vote accepted

Choose your favourite non-derivable function $f$, and let $g = h - f$, where $h$ is your favourite derivable function.

$g$ cannot be derivable, either, otherwise $f = h - g$ would.

share|cite|improve this answer

Let $f:\mathbb R\to \mathbb R$, $f(x)=1$ if $x\in \mathbb Q$ and $f(x)=0$ if $x\not\in \mathbb Q$.

Let $g:\mathbb R\to \mathbb R$, $g(x)=0$ if $x\in \mathbb Q$ and $g(x)=1$ if $x\not\in \mathbb Q$.

Then $f$ and $g$ are continuous nowhere but $f+g=1$ and $f\times g=0$ are differentiable everywhere.

share|cite|improve this answer
The strongest example, thanks! – user42912 Feb 25 '13 at 12:36

Have you tried the same example as in multiplication? In general $f+(-f)$ is derivable.

share|cite|improve this answer
you're right, thanks – user42912 Feb 25 '13 at 12:28

For a little less trivial example you can take the functions

$$f(x)=|x|\;\;,\;\;g(x)=\begin{cases}x&,\;\;\;x\le 0\\{}\\x^2-x&,\;\;\;x>0\end{cases}\Longrightarrow (f+g)(x)=f(x)+g(x)=\begin{cases}0&,\;\;\;x\le 0\\{}\\x^2&,\;\;\;x>0\end{cases}$$

Check that none is derivable at $\,x=0\,$ , yet their sum is.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.