MATH2060A Solution to Assignment 1
Section 6.1
4. Let f : R → R be defined by f (x) = x2 for rational x and f (x) = 0 for irrational x. Show
that f is differentiable at x = 0 and find f 0 (0).
We claim that f is differentiable at 0 with f 0 (0) = 0. Consider the difference quotient
f (x) − f (0)
x 6= 0.
x−0
When x is rational, it is equal to x and, when x is irrational, it is equal to 0. Therefore,
f (x) − f (0)
− 0 ≤ |x| .
x−0
For every ε > 0, we take δ = ε, then
f (x) − f (0)
− 0 ≤ |x| < ε, x 6= 0, |x| < δ.
x−0
We conclude that f 0 (0) = 0.
g(x) − g(c) |f (x)| − |f (c)| f (x) − f (c)
7. = = sgn(x − c) , since f (c) = 0.
x−c x−c x−c
0 f (x) − f (c)
g+ (c) = lim sgn(x − c) = |f 0 (c)|.
x→c+ x−c
0 f (x) − f (c)
g− (c) = lim sgn(x − c) = −|f 0 (c)|.
x→c− x−c
0 (c) = g 0 (c) ⇔ |f 0 (c)| = −|f 0 (c)| ⇔ f 0 (c) = 0.
Hence g is differentiable at c iff g+ −
2x + 1, for x ≥ 0
8. (a) f (x) = |x| + |x + 1| = 1, for − 1 ≤ x < 0
−2x − 1, for x < −1
2, for x > 0
Clearly, f 0 (x) = 1, for − 1 < x < 0
−2, for x < −1
f (x) − f (0) (2x + 1) − 1
For x > 0, = = 2 ⇒ f+0 (0) = 2
x−0 x−0
f (x) − f (0) 1−1
For x < 0, = = 0 ⇒ f−0 (0) = 0 6= 2 = f+0 (0).
x−0 x−0
Similar procedures proceed for x < −1, x > −1.
Hence f is differentiable except 0, −1.
3x, for x ≥ 0
(b) g(x) = 2x + |x| =
x, for x < 0
0 3, for x > 0
Clearly, g (x) =
1, for x < 0
g(x) − g(0) 3x − 0 0
For x > 0, = = 3 ⇒ g+ (0) = 3
x−0 x−0
g(x) − g(0) x−1 0
For x < 0, = = 1 ⇒ g− (0) = 1.
x−0 x−0
Hence g is differentiable except 0.
Spring 2019 MATH2060A 2
x2 ,
for x ≥ 0
(c) h(x) = x|x| =
−x2 , for x < 0
2x, for x > 0
Clearly, h0 (x) =
−2x, for x < 0
h(x) − h(0) x2 − 0
For x > 0, = = x ⇒ h0+ (0) = 0
x−0 x−0
h(x) − h(0) −x2 − 0
For x < 0, = = −x ⇒ h0− (0) = 0.
x−0 x−0
Hence h is differentiable on the whole R.
sin x, for sin x ≥ 0 ⇔ 2nπ ≤ x ≤ (2n + 1)π
(d) k(x) = | sin x| = , ∀n ∈ Z.
− sin x, for sin x < 0 ⇔ (2n − 1)π < x < 2nπ
cos x, for 2nπ < x < (2n + 1)π
Clearly, k 0 (x) = , ∀n ∈ Z.
− cos x, for (2n − 1)π < x < 2nπ
k(x) − k(2nπ) sin x sin(x − 2nπ) 0
For n ∈ Z and x > 2nπ, = = ⇒ k+ (2nπ) = 1
x − 2nπ x − 2nπ x − 2nπ
k(x) − k(2nπ) − sin x sin(x − 2nπ)
For n ∈ Z and x < 2nπ, = =−
x − 2nπ x − 2nπ x − 2nπ
0
⇒ k− (2nπ) = −1
Similar procedures proceed for x < (2n + 1)π, x > (2n + 1)π, n ∈ Z.
Hence, k is differentiable except nπ for n ∈ Z.
f (−x + h) − f (−x) f (x − h) − f (x) f (x + h0 ) − f (x)
9. f 0 (−x) = = − lim = − lim = −f 0 (x).
h h→0 −h h0 →0 h0
Hence f 0 is an odd function.
g(−x + h) − g(−x) [−g(x − h)] − [−g(x)] g(x + h0 ) − g(x)
g 0 (−x) = = lim = lim = g 0 (x).
h h→0 −(−h) h0 →0 h0
Hence g 0 is an even function.
f (c + h) − f (c) f (c + h) − f (c)
13. Denote g(h) := . Hence lim g(h) = lim = f 0 (c) ∈ R.
h h→0 h→0 h
By sequential criterion for limits (Theorem 4.1.8 page 101), denote hn := 1/n 6= 0 for all
1
n, and lim hn = lim = 0, we have lim g(hn ) = lim g(h) = f 0 (c), where
n h→0
f (c + 1/n) − f (c)
g(hn ) = = n{f (c + 1/n) − f (c)}. Hence f 0 (c) = lim (n{f (c + 1/n) − f (c)}).
1/n
sin π/x, x > 0
Take f (x) :=
0, x ≤ 0.
At c = 0, n{f (1/n) − f (0)} = n(0 − 0) = 0 ∀ n.
Hence, lim (n{f (c + 1/n) − f (c)}) = 0.
However, f 0 (c) doesn’t exist because f is not continuous at c.
Or, we may take f := χQ = Dirichlet
function. Fix c ∈ R.
n(1 − 1), c ∈ Q
Then n{f (c + 1/n) − f (c)} = = 0 ∀ n.
n(0 − 0), c 6∈ Q
The Dirichlet function χQ is not continuous.
Remark If x is rational and y is irrational, why is x + y irrational?
Spring 2019 MATH2060A 3
14. Now h0 (x) = 3x2 + 2 > 0 ∀ x ∈ R. Hence, by Theorem 6.1.8, h−1 is differentiable and
1 1
(h−1 )0 (y) = 0 = 2 ∀ x ∈ R,
h (x) 3x + 2
where y is related to x by y = h(x).
1 1
For x = 0, we have y = h(0) = 1, and (h−1 )0 (1) = =
3(0) + 2 2
−1 0 1 1
For x = 1, we have y = h(1) = 4, and (h ) (4) = =
3(1) + 2 5
1 1
For x = −1, we have y = h(−1) = −2, and (h−1 )0 (−1) = = .
3(1) + 2 5
Supplementary Exercises
1. Consider the function f defined on [0, ∞)
1
f (x) = xα sin , α>0,
x
and f (0) = 0. Determine the range of α in which
(a) f is continuous on [0, ∞),
(b) f is differentiable on [0, ∞), and
(c) f 0 exists and is differentiable on [0, ∞).
Solution. This function is smooth, that is, infinitely many times differentiable on (0, ∞).
It suffices to consider the case at x = 0.
(a) As
1
|xα sin | ≤ xα ,
x
by Sandwich rule
1
lim xα sin
=0,
x→0+x
so f is continuous at x = 0 hence we conclude that it is continuous on [0, ∞).
(b) By definition,
1
xα sin −0 1
f 0 (0) = lim x = lim xα−1 sin = 0 ,
x→0+ x−0 x→0 + x
when α > 1. This limit does not exist when α ∈ (0, 1]. So f is differentiable on [0, ∞)
if and only if α ∈ (1, ∞).
(c) The derivative of f is
1 1
f 0 (x) = αxα−1 sin − xα−2 cos , x ∈ (0, ∞) ,
x x
and f 0 (0) = 0. At x = 0, using the definition of the derivative, we have, for α > 1,
1 1
αxα−1 sin − xα−2 cos − 0 1 1
f 00 (0) = lim x x = lim αxα−2 sin − xα−3 cos = 0 ,
x→0+ x−0 x→0+ x x
when α ∈ (3, ∞). The limit does not exist when α ∈ (0, 3]. We conclude that f 0 is
differentiable on [0, ∞) if and only if α ∈ (3, ∞).
Spring 2019 MATH2060A 4
2. Find (a) the maximal domain on which the function is well-defined, (b) the domain on
which it is continuous and (c) the domain on which it is differentiable in each of the
following cases. Justify your answer in (c).
(a) f (x) = |x2 − 5x + 6| .
(b) h(x) = log(16 − x2 ) .
(c) j(x) = cos |x| .
Solution.
(a) The function is the composition of two functions f (x) = g(h(x)) where h(x) = x2 −
5x + 6 and g(y) = |y|. Both g and h are continuous on R. As continuity if preserved
under composition, f is continuous on (−∞, ∞).
Next, write f (x) = |x2 − 5x + 6| = |x − 2||x − 3|. It is known that x 7→ |x − 2| is not
differentiable at 2 and x 7→ |x − 3| is non-zero and differentiable at 2. It follows that f
is not differentiable at 2. (See the proposition on next page.) By the same reason f is
not differentiable at 3. We conclude that f is differentiable on (−∞, 2)∪(2, 3)∪(3, ∞).
(b) The function h = log(16 − x2 ) = log(k(x)) where k(x) = 16 − x2 is differentiable
everywhere. Using the fact that the log function is defined and smooth only for
positive number, h is defined, continuous and differentiable as long as 16 − x2 > 0,
that is, on (−4, 4).
(c) j is defined and continuous everywhere. The function x 7→ |x| is differentiable except
at x = 0 and y 7→ cos y is differentiable everywhere. So j is differentiable at all
non-zero x. However, as the derivative of cos y is equal to 0 at y = 0. We must
examine the differentiability of j at 0 using definiton. Indeed, using the fact the
cosine function is even,
cos |h| − cos 0 cos h − 1
lim = lim = 0,
h→0 h−0 h→0 h
from which we conclude that j is also differentiable at x = 0. Hence j is differentiable
everywhere.
A shortcut is to realize that the cosine is an even function, so j(x) = cos x is dif-
ferentiable everywhere. In this approach we do not view j as the composite of two
functions.
3. Find a function which is not differentiable exactly at the following points on (−∞, ∞) in
each of the following cases:
(a) n-many distinct points {a1 , a2 , · · · , an },
(b) The set of integers Z, and
1 1
(c) 0, 1, , · · · , , · · · , .
2 n
Solution. I forgot to require these functions to be continuous. In the following functions
are continuous.
(a)
n
X
f (x) = |x − ak | .
k=1
Spring 2019 MATH2060A 5
(b)
∞
X
g(x) = ϕ(x − k),
k=−∞
where ϕ is a function which makes a corner at 0 but otherwise smooth and vanishes
outside [−1, 1].
(c) You may try this
π
h(x) = x sin .
x
Of course, set h(0) = 0.
4. A function f : (a, b) → R has a symmetric derivative at c ∈ (a, b) if
0 f (c + h) − f (c − h)
fs (c) = lim
h→0 2h
0 0 0
exists. Show that fs (c) = f (c) if the latter exists. But fs (c) may exist even though f is
not differentiable at c. Can you give an example?
Solution.
f (c + h) − f (c − h) f (c + h) − f (c) + f (c) − f (c − h)
=
2h 2h
1 f (c + h) − f (c) 1 f (c − h) − f (c)
= + .
2 h 2 −h
Hence we have
f (c + h) − f (c − h)
fs0 (c) = lim
h→0 2h
1 f (c + h) − f (c) 1 f (c − h) − f (c)
= lim + lim
2 h→0 h 2 h→0 −h
1 f (c + h) − f (c) 1 f (c + h0 ) − f (c)
= lim + lim
2 h→0 h 2 h0 →0 h0
1 0 1
= f (c) + f 0 (c) = f 0 (c)
2 2
Observation. The set-up for fs0 (c) = limh→0 f (c+h)−f
2h
(c−h)
doesn’t involve the value
f (c), a simple idea to construct a counter example is by changing the value f (c) from a
differentiable function f , so that the new function is not differentiable at c.
1, for x = c f (c + h) − f (c − h)
Take f (x) = . Then fs0 (c) = lim = 0.
0, for x 6= c h→0 2h
But f 0 (c) doesn’t exist since f is not continuous at x = c.
5. Let f : R → R satisfy f (x + y) = f (x)f (y) for all x, y ∈ R. Suppose f is differentiable at
0 0
0 with f (0) = 1. Show that f is differentiable on R and f (x) = f (x) for all x ∈ R.
Solution. If f ≡ 0, then f 0 (0) = 0 6= 1, contradiction arises. Hence ∃ x0 ∈ R s.t.
f (x0 ) 6= 0.
Spring 2019 MATH2060A 6
Then f (x0 ) = f (x0 + 0) = f (x0 )f (0) ⇒ f (0) = 1.
f (h) − 1 f (0 + h) − f (0)
Also, f is differentiable at 0, hence lim = lim = f 0 (0) = 1.
h→0 h h→0 h
f (x + h) − f (x) f (x)f (h) − f (x) f (h) − 1
Fix x. For all h 6= 0, = = f (x)
h h h
0 f (x + h) − f (x) f (h) − 1
⇒ f (x) = lim = f (x) lim = f (x).
h→0 h h→0 h
Hence, f is differentiable on R.
Spring 2019 MATH2060A 7
The following observation was discussed in class. I formulate it as a proposition below.
Proposition. Let f and g be defined on (a, b) such that f is not differentiable at c ∈ (a, b)
but g is differentiable at c and g(c) 6= 0. Then f g is not differentiable at c.
h(x)
Proof Assume on the contrary that h(x) = f (x)g(x) is differentiable at c. Then f (x) =
g(x)
is differentiable at c by the quotient rule, contradiction holds.