11

The question here asks:

Given that $f$ and $g$ are two real functions and both are differentiable, is it true to say that $h=max(f,g)$ is differentiable too?

Convincing arguments have been presented there that the answer is No.

So, how about a slightly weaker question: Given that $f$ and $g$ are two real, differentiable functions, is it always true that $h=max(f,g)$ is piecewise-differentiable?

(For the purposes of this question, 'piecewise' is to be taken as user86418 defined it in a comment: "The domain can be divided into subintervals so that the set of endpoints is discrete", i.e., "each endpoint is isolated in the set of endpoints." Further, the set of endpoints may or may not be finite.)

hBy2Py
  • 337
  • 1
    What do you mean by "piecewise"? In the sense: do you want the set of points where the derivative fails to exist to be finite? –  Apr 22 '15 at 19:12
  • @G.Sassatelli or presumably countably infinite. – Matt Gutting Apr 22 '15 at 19:18
  • 1
    @G.Sassatelli A countably infinite number of such points is fine [e.g., $h(x) = max(cos(x), sin(x))$]. – hBy2Py Apr 22 '15 at 19:31
  • Math is not my background, so I'm open to suggestions for better terms than 'piecewise differentiable' for what I'm looking for -- I will gladly revise the question if you all can help me identify a more precis term for what I'm envisioning. – hBy2Py Apr 22 '15 at 19:33
  • 4
    @Brian: In my experience, "piecewise" usually means "the domain can be divided into subintervals so that the set of endpoints is discrete", i.e., "each endpoint is isolated in the set of endpoints". With that definition, the answer is still no: If $f(x) = x^{2} \sin(1/x)$, $f(0) = 0$, and $g(x) = 0$, then their maximum fails to be differentiable at a set of points having $0$ as a limit point. – Andrew D. Hwang Apr 22 '15 at 20:10
  • Let's go with that definition of 'piecewise,' I think it captures what I'm picturing. Is $f(x) = x^2 \mathrm{sin}(1/x)$ itself a differentiable function, though? Doesn't its being undefined at $x=0$ disqualify it? – hBy2Py Apr 22 '15 at 20:20
  • @Brian: We explicitly define $f(0) = 0$. :) This $f$ is the standard example of an everywhere-differentiable function with discontinuous derivative. (One has to use the difference quotient to prove $f'(0)$ exists.) – Andrew D. Hwang Apr 22 '15 at 22:11
  • @user86418 Ahhhh, now I see, you're explicitly declaring $f(x)$ as a piecewise-defined function. Didn't catch that. – hBy2Py Apr 23 '15 at 00:13
  • @Brian: Regarding the new wording: 1. The same oscillatory example shows that the intervals' endpoints (in the domain of $h'$) can "accumulate" in the technical sense, so the answer is still "no". :) 2. Even if $h$ is differentiable everywhere, its derivative needn't be piecewise continuous. (It may be important to note that piecewise continuity of a function $F$ usually comes with a condition in addition to "isolated endpoints": One requires $F$ to have one-sided limits at each discontinuity.) – Andrew D. Hwang Apr 23 '15 at 00:51
  • Aaaand, this shows how completely out of my depth I am. :-) I hesitated posting this question for exactly this sort of reason -- I know how little I know about formal mathematics. Thank you for your time! – hBy2Py Apr 23 '15 at 00:56

4 Answers4

9

With the indicated definition of "piecewise", the answer is no: If $g$ is the zero function and $$ f(x) = \begin{cases} x^{2} \sin(1/x) & \text{if $x \neq 0$,} \\ 0 & \text{if $x = 0$,} \end{cases} $$ (which is well-known to be everywhere-differentiable), then their maximum, $$ \max(f, g)(x) = \frac{f(x) + \left|f(x)\right|}{2} $$ fails to be differentiable at each point $x$ with $\sin(1/x) = 0$, namely for $x_{n} = 1/(n\pi)$ with $n \neq 0$ an integer, since $f'(x_{n}) \neq 0 = g'(x_{n})$. (Vertical scale below exaggerated for clarity.)

A maximum of differentiable functions that is not piecewise-differentiable

Since the set of "corners", $$ E = \{1/(n\pi) : n \neq 0\}, $$ has $0$ as a limit point, $\max(f, g)$ is not piecewise-differentiable.

  • @Brian: That's okay. :) But if I understand your revised intent, the same function is still a counterexample: The domain of $h'$ is a union of open intervals whose endpoints accumulate at $0$. – Andrew D. Hwang Apr 23 '15 at 00:52
  • Mmm... because the spacing between $E{n}$ goes to zero as $n \rightarrow \infty$? – hBy2Py Apr 23 '15 at 00:53
  • I de-revised the question, sorry for the back and forth. – hBy2Py Apr 23 '15 at 00:53
  • 3
  • Yes, exactly. (If necessary, we can arrange more pathological behavior.... :) 2. This is the reality of mathematical exploration and discovery; it takes trial and error. Lecturers and textbook authors make it look easy, but formulating one's thoughts precisely can be tricky. So, no need to apologize.
  • – Andrew D. Hwang Apr 23 '15 at 00:57
  • Wow, I definitely thought the answer to this was yes. Nice answer! – Cruncher Apr 23 '15 at 13:33