Does there exists a function which is continuous everywhere but not differentiable at exactly two points? Justify your answer.
Consider the function
f(x)=|x|+|x−1|
Since, the f(x)=|x|+|x−1| is continuous everywhere, but it is not differentiable at
x=0 and x=1
f(x)=⎧⎪⎨⎪⎩−x−(x−1)x≤0x−(x−1)0<x<1x+(x−1)x≥1
f(x)=⎧⎪⎨⎪⎩−2x+1x≤010<x<12x−1x≥1
Check continuity when x=0
If f(x) is continuous at x=0, then
limx→0−f(x)=limx→0+f(x)=f(0)
L.H.L.=limx→0−−2x+1
L.H.L.=limh→0−2(0−h)+1
L.H.L.=limh→02h+1
Substituting h=0, we get
L.H.L.=2(0)+1=0+1=1
R.H.L.=limx→0+1=1
Find f(0)
f(x)=−2x+1 at x=0
f(0)=−2(0)+1=0+1=1
Hence, limx→0−f(x)=limx→0+f(x)=f(0)
Therefore, the function
f(x)=⎧⎪⎨⎪⎩−2x+1x≤010<x<12x+1x≥1
is continuous at x=0
Now, checking differentiability when x=0
R.H.D.=limh→0f(0+h)−f(0)h
R.H.D.=limh→0f(h)−f(0)h
R.H.D.=limh→0(1−(−2(0)+1)h
R.H.D.=limh→0(1−1)h=0
L.H.D.=limh→0f(0−h)−f(0)−h
L.H.D.=limh→0f(−h)−f(0)−h
L.H.D.=limh→0(2(−h)+1)−(−2(0)+1)−h
L.H.D.=limh→01−1−2h−h
L.H.D.=limh→02hh=2
Thus, L.H.D.≠R.H.D.
Hence, f(x)=⎧⎪⎨⎪⎩−2x+1x≤010<x<12x−1x≥1
is not differentiable at x=0
Check continuity when x=1
Given function is
f(x)=⎧⎪⎨⎪⎩−2x+1x≤010<x<12x−1x≥1
If f(x) is continuous at x=1, then
limx→1−f(x)=limx→1+f(x)=f(1)
L.H.L.=limx→1−1=1
R.H.L=limx→1+2x−1
R.H.L=limh→02(1+h)−1
R.H.L=limh→02+2h−1
R.H.L=limh→01+2h
Substituting h=0, we get
R.H.L.=1+2(0)=1
Find f(1)
f(x)=2x−1 at x=1
f(x)=2(1)−1=2−1=1
Hence,
limx→1−f(x)=limx→1+f(x)=f(1)
Therefore, the function
f(x)=⎧⎪⎨⎪⎩−2x+1x≤010<x<12x−1x≥1
is continuous at x=1
Now, checking differentiability when x=1
R.H.D.=limh→0f(1+h)−f(1)h
R.H.D.=limh→0(2(1+h)−1)−(2(1)−1)h
R.H.D.=limh→0(2+2h−1)−(2−1)h
R.H.D.=limh→0(1+2h)−1h
R.H.D.=limh→02hh=2
L.H.D.=limh→0f(1−h)−f(1)−h
L.H.D.=limh→01−1−h=0
Thus, L.H.D.≠R.H.D.
Hence, f(x)=⎧⎪⎨⎪⎩−2x+1x≤010<x<12x−1x≥1
is not differentiable at x=1
When x<0
For x<0,f(x)=−2x+1
Since the function f(x)=−2x+1 is a polynomial function of degree ‘one’, so it is continuous and differentiable. Therefore, f(x) is continuous and differentiable for x<0
When x>1
For x>1,f(x)=2x−1
Since the function f(x)=2x−1 is a polynomial of degree ‘one’, so it is continuous and differentiable. Therefore, f(x) is continuous and differentiable for x>1
When 0<x<1
For 0<x<1,f(x)=1
Since the function f(x)=1 is a constant polynomial so it is continuous and differentiable. . Therefore, f(x) is continuous and differentiable for 0<x<1
Therefore, the function
f(x)=|x|+|x−1|=⎧⎪⎨⎪⎩−2x+1x≤010<x<12x−1x≥1
is continuous everywhere but not differentiable at two points, x=0 & x=1