Where a function is not differentiable (free preview) | StemPy Lab
Free previewCourse: Standard
Where a function is not differentiable
A function is not differentiable at a corner, a vertical tangent or a break. For ∣g(x)∣ the corners sit at the simple zeros of g, and a double zero leaves no corner. A product g(x)∣x−a∣ is differentiable at a exactly when g(a)=0. For piecewise and greatest integer functions, compare the left and right derivatives at each joining point.
This is the first lesson of Differentiability in Depth: Piecewise Functions and Functional Equations, free for everyone to read.
What you will be able to do
find the points where ∣g(x)∣, sums of absolute values and products with ∣x−a∣ are not differentiable;
handle the greatest integer function inside products;
count the points of non-differentiability of a piecewise function by comparing one-sided derivatives.
What to look for
A function can fail to be differentiable in three ways: a corner, a vertical tangent, or a break. Absolute values, greatest integers and joins of pieces create most corners and breaks. The method is always the same.
List the candidate points: zeros of absolute values, integers for [x], and joins of pieces.
At each candidate, find the left derivative and the right derivative.
A point is a point of non-differentiability when they differ, or when one does not exist.
The absolute value of a function
Let f(x)=∣g(x)∣ with g differentiable. Away from the zeros of g, f equals g or −g and is differentiable. At a zero a of g there are two cases.
A simple zero, g′(a)=0. The slope of f is −∣g′(a)∣ on one side and ∣g′(a)∣ on the other. This is a corner, with a slope jump of 2∣g′(a)∣.
A double zero, g′(a)=0. Now g(a+h) is much smaller than h, so the quotient h∣g(a+h)∣ tends to 0 from both sides. There is no corner.
For example, ∣x2−4∣ has corners at x=±2, where the slopes jump from −4 to 4 and from −4 to 4 again. But ∣(x−2)2∣=(x−2)2 has no corner at 2.
Three small graphs side by side. The first is y = absolute value of (x squared - 4), a W shape with two red dots at the corners at x = -2 and x = 2, where the graph touches the axis. The second is y = absolute value of (x - 1) times (x - 2) squared, which has a red corner dot at x = 1 and touches the axis smoothly at x = 2, with no corner. The third is y = absolute value of x cubed, a smooth U shape with a very flat bottom and no corner.
A product with ∣x−a∣
Let h(x)=g(x)∣x−a∣ with g differentiable at a. The left derivative at a is −g(a) and the right derivative is g(a). They are equal exactly when g(a)=0, and then both are 0.
So (x−1)∣x−1∣ is differentiable at 1, but x∣x−1∣ is not, because g(1)=1=0. Likewise ∣x∣3=x2∣x∣ is differentiable at 0, once and twice, but its third derivative has a jump: it is −6 for x<0 and 6 for x>0.
Sums, maxima and minima
In a sum such as ∣x−1∣+∣x−2∣+∣x−3∣, each term adds its own slope jump of 2 at its zero. Since all the jumps are positive, they never cancel. There are corners at 1, 2 and 3.
For max(f,g) and min(f,g), corners appear where the two graphs cross with different slopes. The function max(sinx,cosx) has a corner at x=4π.
Take sin∣x∣. At 0 the slopes are −1 and 1. It has a corner. But ∣sinx∣ has corners at every multiple of π.
The greatest integer function inside a product
The function [x] jumps at every integer n. In the product [x]g(x) the factor is n−1 just to the left of n and n just to the right. The function is continuous at n only if g(n)=0. It is differentiable at n only if the slopes (n−1)g′(n) and ng′(n) agree, which needs g′(n)=0 as well.
So [x]sinπx is continuous at every integer, but never differentiable there, because g′(n)=πcosπn=0.
A note on words. British and American texts say a graph has a corner or a point where the gradient is not defined. AP also calls a sharp point a cusp when the slopes tend to opposite infinities. NCERT and JEE use "not differentiable at".
A worked example
Find the points where f(x)=∣(x−1)(x−2)2∣+∣x−4∣ is not differentiable.
The candidates. The zeros inside the absolute values are 1, 2 and 4.
At x=1. This is a simple zero of (x−1)(x−2)2, since the factor (x−2)2=1 there. So the first term has a corner. The second term is smooth at 1. The slope jumps from −2 to 0. Not differentiable.
At x=2. This is a double zero of (x−1)(x−2)2, so the first term is smooth. The second term is smooth at 2. Differentiable, with slope −1.
At x=4. The second term has a corner, and the first is smooth. The slope jumps from 15 to 17.
The function is not differentiable at x=1 and x=4.
Practise with new numbers
Try it in Python
The program finds the corners of four functions by comparing the left and right slopes at a list of candidate points.
Common mistakes
Treating every zero of g as a corner of ∣g∣. A double zero is smooth.
Using the product rule at the join. At a point where the formula changes, compare one-sided derivatives.
Forgetting that [x] can be harmless. In [x]g(x) the product is differentiable at n only when both g(n) and g′(n) are zero.
Missing candidates. A sum of two absolute values has candidates at the zeros of both.
Remember these
∣g∣ has a corner at each simple zero of g and none at a double zero.
g(x)∣x−a∣ is differentiable at a exactly when g(a)=0.
[x]g(x) is differentiable at an integer n only if g(n)=0 and g′(n)=0.
Always compare the left and right derivatives at each candidate point.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
At which points is ∣x2−9∣ not differentiable?
Is (x−2)∣x−2∣ differentiable at x=2?
Is ∣x∣(x2+1) differentiable at x=0?
How many points of non-differentiability does ∣sinx∣ have in [0,2π]?
Is x[x] differentiable at x=2?
References
OpenStax, Calculus Volume 1, Chapter 3, section on the derivative as a function (where a function is not differentiable).
Liked this lesson? There is more
Differentiability in Depth: Piecewise Functions and Functional Equations is a Standard course. It adds 2 more lessons, practice and tests on top of the free chapter.
12Problems2Python Labs1Question Set1Mock Test
Functional equations and what continuity forces: A functional equation such as f(x+y)=f(x)+f(y)
is an equation for a whole function. Putting special values into it gives
f(0)=0
,
f(−x)=−f(x)
and
f(nx)=nf(x)
. If
f
is also continuous at a single point, then it is continuous everywhere and
f(x)=cx
. Similar results hold for
f(x+y)=f(x)f(y)
and
f(xy)=f(x)+f(y)
.
The n-th derivative and Leibniz's rule: Some functions have an n-th derivative that follows a pattern. For eax it is aneax, for sin(ax+b) it is ansin(ax+b+2nπ), and for x+11 it is (x+1)n+1(−1)nn!. For a product, Leibniz's rule gives (uv)(n)=k=0∑nnCku(k)v(n−k), with the same coefficients as the binomial theorem.