# How to “see” discontinuity of second derivative from graph of function

Suppose we have a real function $$f: \mathbb{R} \to \mathbb{R}$$ that is two times differentiable and we draw its graph $$\{(x,f(x)), x \in \mathbb{R} \}$$. We know, for example, that when the first derivative is not continuous at a point we then have an "corner" in the graph. How about a discontinuity of $$f''(x)$$ at a point $$x_0$$ though? Can we spot that just by drawing the graph of $$f(x)$$ -not drawing the graph of the first derivative and noticing it has an "corner" at $$x_0$$, that's cheating. What about discontinuities of higher derivatives, which will of course be way harder to "see"?

• It's likely that you actually have something else that you are thinking of and not what you ask. For example, you might be thinking that $|x|$ has discontinuous derivative, but that is not true. Actually, $|x|$ has no derivative at $0$ at all. Could you name from top of your head a differentiable function on whole $\mathbb R$, but it's derivative not continuous? What you probably have in mind is $n$ times differentiable, but not $n+1$ times. – Ennar Nov 6 '18 at 21:00
• Yeah I might have mistakenly (?) said discontinuous at a point meaning either undefined (which is what the answers cover) or defined but discontinuous (so any examples on this?). – Dimitris Nov 6 '18 at 21:12
• Defined but discontinuous is not as easy to find as it might seem. The problem is that derivatives, even though not necessarily continuous, still have intermediate value property, so functions with jump discontinuities are not derivatives. Classic example of differentiable function with discontinuous derivative is $x^2\sin(1/x)$ for $x>0$, and $0$ otherwise. Plot it and tell me if you can spot that the derivative is discontinuous :) – Ennar Nov 6 '18 at 21:16
• I don't think you can see it, but you can feel it. The second derivative is acceleration, or force. If you're cruising down the freeway and then step on the gas (maybe you're passing someone), your distance ($f(t)$) and speed ($f^\prime(x)$) are both continuous, but your acceleration ($f^{\prime\prime}(x)$) just had a jump discontinuity. – JonathanZ Nov 7 '18 at 21:29
• @CarstenS Sure, but if I remember correctly, cubic splines have jumps in the third derivative and the junction points – martini Nov 7 '18 at 22:36

Seeing the second derivative by eye is rather impossible as the examples in the other answers show. Nonetheless there is a good way to visualize the second derivative as curvature, which gives a good way to see the discontinuities if some additional visual aids are available.

Whereas the first derivative describes the slope of the line that best approximates the graph, the second derivative describes the curvature of the best approximating circle. The best approximating circle to the graph of $$f:\mathbb{R}\to\mathbb{R}$$ at a point $$x$$ is the circle tangent to $$(x,f(x))$$ with radius equal to $$((1+f'(x)^2)^{3/2})/\left\vert f''(x) \right\vert$$. This leaves exactly two possible circles, and the sign of $$f''(x)$$ determines which is the correct one. That is, whether the circle should be above ($$f''(x)>0$$) or below ($$f''(x)<0$$) the graph. Note that the case when $$f''(x)=0$$ corresponds to a circle with "infinite" radius, i.e., just a line.

As a demonstration, consider the difference between some of the functions mentioned before. For $$x\mapsto x^3$$, the second derivative is continuous, and the best approximating circle varies in a continuous manner ("continuous" here needs to be interpreted with care, since the radius passes through the degenerate $$\infty$$-case when it switches sign)

For $$x\mapsto \begin{cases}x^2,&x>0\\-x^2,&x\leq 0\end{cases}$$ the best approximating circle has a visible discontinuity at $$x=0$$, where the circle abruptly hops from one side to the other.

The pictures above were made with Sage. The code used to create the second one is below to play around with:

def tangent_circle(f,x0,df=None):
if df is None:
df = f.derivative(x)
r = (1+df(x=x0)^2)^(3/2)/df.derivative(x)(x=x0)
tang = df(x=x0)
unitnormal = vector(SR,(-tang,1))/sqrt(1+tang^2)
c = vector(SR,(x0,f(x0)))+unitnormal*r
return c,r

fplot = plot(f,(x,plotrange[0],plotrange[1]),aspect_ratio=1,color="black")
xmin = xran[0]
xmax = xran[1]
return [fplot+circle((x0,f(x0)),0.03,fill=True,color="blue")+circle(*tangent_circle(f,x0,df),color="blue") for x0 in pts]

f = lambda x: x^2 if x>0 else -x^2
df = 2*abs(x)
frames = plot_curvatures(f,df)
animate(frames,xmin=-1.5,xmax=1.5,ymin=-1,ymax=1)

• Great figures. Did you make them yourself? [otherwise, please cite the source! Thanks] – AccidentalFourierTransform Nov 6 '18 at 20:11
• +1 lovely picture – Ethan Bolker Nov 6 '18 at 21:30
• Lines for first derivative, circles for second derivative, is there an analogue for the third derivative? – Surb Nov 7 '18 at 8:31
• @surb we're talking about a point (0D) on a curve (zeroth derivative), which get's inflated to a line (1D) for the first derivative and to a circle (2D) for the second derivative. A sphere (3D) for the third derivative seems only logical to me. Think of it like pulling the sphere through the plane which results in changing circles on the plane. The faster the circles change, the smaller the sphere. – DonQuiKong Nov 7 '18 at 10:07
• @DonQuiKong yeah, it is just a representation, however both the line and circle seem kind of the “aesthetically unique way to go” for approximating a curve to match the first and second derivative, respectively. It would be nice to formalise this in such a way that every order gives rise to a unique approximation, but I'm pretty sure they wouldn't be closed loops of any sort. And a sphere would not even be a better approximation to third order. – leftaroundabout Nov 7 '18 at 11:23

Whether or not you can "see" this is in some sense a question about the acuity of human vision. I think the answer is "no". If you graph the function $$g(x) = \int_0^x |t|dt$$ you will see the usual parabola in the right half plane and its negative in the left half plane. They meet at the origin with derivative $$0$$. The derivative of this function is $$|x|$$, whose derivative is undefined at $$0$$. The second derivative is $$-1$$ on the left and $$1$$ on the right, undefined at the origin.

Plot that and see if you can see the second derivative. Unless you draw it really carefully and know what you are looking for the graph will look like that of $$x^3$$, which is quite respectable.

• +1, I was just about to write this example. – Ennar Nov 6 '18 at 19:19
• FWIW, $g(x)=\frac12 x|x|$. – AccidentalFourierTransform Nov 6 '18 at 20:10
• Also FWIW, $2g(x)$ is the second function in Eero Hakavuori's answer, whereas $x \mapsto x^3$ is his first, and he shows how to see the different behaviour of their second derivatives at $0$. – Torsten Schoeneberg Nov 13 '18 at 7:51

Assuming your graph is made from reflective material, you can see discontinuous second derivatives in the reflection. For example, if you stand at $$(0,-1)$$ and look upwards at the graph of $$f(x)=\max\{x,0\}$$ the reflection will have a discontinuity at the point of nondifferentiability of $$f$$, namely $$(0,0)$$, even though $$f$$ is continuous there. Similarly, if you look at a diffferentiable graph that is differentiable but not twice differentiable, the reflection will not be differentiable.

Some years ago I crammed my adult body into a rather small car of a child's ride called The Wild Mouse. It was a "roller coaster" with no perceptible vertical drops as it went in a helical fashion on a path that consisted of alternating line segments and quarter circles. Children could be delighted at a transition between line and circle because the path has a discontinuity in its second derivative at each transition.

The car essentially moved at a constant speed, so on the straight segments the car was not accelerating, and there was "no" force on the car. However, a particle moving at constant speed in a circular path has constant non-zero acceleration pointing toward the circle's center, so the car, and child, experiences a force toward the circle center. The children could feel the discontinuity in the second derivative of the car's path.

Railroad engineers have known about this abrupt change in force since before the mid 19th century, and used curves with spiral characteristics, now called "transition curves." Such curves are used by railroad and highway designers to provide smoother rides for their customers.

Not sure if there is a "picture rigorous" way of checking, but there are subtle clues that could indicate it's possible.

For instance, if you know the first derivative $$f'$$ has a "corner" at $$x=a$$, then the graph of $$f$$ has to be monotonically increasing/decreasing around $$x=a$$. Furthermore, this indicates a change in concavity has to be present. So places where you have

• a change in concavity AND
• don't change increasing/decreasing behavior (we allow derivative of zero here),

then it could happen at that point (in terms of limiting down the choice of possibilities). Take for instance the antiderivative of $$|x|$$.

Obviously this isn't saying this is always true (see $$x^3$$ for instance). Just that if you want to narrow your focus to potential points, do this trick.

Please let me know if there is something I'm missing or wrong about.

• So, what exactly do you see at that plot that would tell you there is no second derivative at $0$? Why don't you plot $x^3$ next to it and tell me the qualitative difference. – Ennar Nov 6 '18 at 19:23
• Not saying it occurs. Just that it is possible. – welshman500 Nov 6 '18 at 19:24
• The question is how to spot it from the graph. With $|x|$ it's quite obvious where it isn't differentiable, and similarly for any continuous function not differentiable at some point. I wouldn't say you could see the same thing about second derivative just from the graph. – Ennar Nov 6 '18 at 19:25
• The antiderivative of $2x+|x|$ is strictly increasing and strictly concave up everywhere, but still has the same problems. – Teepeemm Nov 6 '18 at 20:08