Show that the function $f(x)=|\sin x+\cos x|$ is continuous at $x=\pi$.
We have, $$f(x)=|\sin x+\cos x| \text { at } x=\pi$$
Let $g(x)=\sin x+\cos x$
and $h(x)=|x|$
$$\begin{aligned} \therefore\quad \operatorname{hog}(x) & =h[g(x)] \\ & =h(\sin x+\cos x) \\ & =|\sin x+\cos x| \end{aligned}$$
Since, $g(x)=\sin x+\cos x$ is a continuous function as it is forming with addition of two continuous functions $\sin x$ and $\cos x$.
Also, $h(x)=|x|$ is also a continuous function. Since, we know that composite functions of two continuous functions is also a continuous function.
Hence, $f(x)=|\sin x+\cos x|$ is a continuous function everywhere.
So, $f(x)$ is continuous at $x=\pi$.
Examine the differentiability of $f$, where $f$ is defined by
$$f(x)=\left\{\begin{array}{ll} x[x], & \text { if } 0 \leq x<2 \\ (x-1) x, & \text { if } 2 \leq x<3 \end{array} \text { at } x=2 .\right.$$
We have, $$f(x)=\left\{\begin{array}{ll} x[x], & \text { if } 0 \leq x<2 \\ (x-1) x & \text { if } 2 \leq x<3 \end{array} \text { at } x=2 .\right.$$
At $x=2$,
$$L f^{\prime}(2)=\lim _{h \rightarrow 0} \frac{f(2-h)-f(2)}{-h}$$
$$=\lim _\limits{h \rightarrow 0} \frac{(2-h)[2-h]-(2-1) 2}{-h}$$
$\{\because[a-h]=[a-1]$, where $a$ is any positive number $\}$
$$=\lim _\limits{h \rightarrow 0} \frac{(2-h)(1)-2}{-h}$$
$$=\lim _\limits{h \rightarrow 0} \frac{2-h-2}{-h}=\lim _\limits{h \rightarrow 0} \frac{-h}{-h}=1$$
$$R f^{\prime}(2)=\lim _\limits{h \rightarrow 0} \frac{f(2+h)-f(2)}{h}$$
$$=\lim _\limits{h \rightarrow 0} \frac{(2+h-1)(2+h)-(2-1) \cdot 2}{h}$$
$$=\lim _\limits{h \rightarrow 0} \frac{(1+h)(2+h)-2}{h}$$
$$=\lim _\limits{h \rightarrow 0} \frac{2+h+2 h+h^2-2}{h}$$
$$=\lim _\limits{h \rightarrow 0} \frac{h^2+3 h}{h}=\lim _\limits{h \rightarrow 0} \frac{h(h+3)}{h}=3$$
$$\therefore \quad L f^{\prime}(2) \neq R f^{\prime}(2)$$
So, $f(x)$ is not differentiable at $x=2$.
$f(x)=\left\{\begin{array}{ll}x^2 \sin \frac{1}{x}, & \text { if } x \neq 0 \\ 0, & \text { if } x=0\end{array}\right.$ at $x=0$
We have, $f(x)=\left\{\begin{array}{ll}x^2 \sin \frac{1}{x}, & \text { if } x \neq 0 \\ 0, & \text { if } x=0\end{array}\right.$ at $x=0$
$$\begin{aligned} &\text { For differentiability at } x=0 \text {, }\\ &L f^{\prime}(0)=\lim _{x \rightarrow 0^{-}} \frac{f(x)-f(0)}{x-0}=\lim _{x \rightarrow 0^{-}} \frac{x^2 \sin \frac{1}{x}-0}{x-0} \end{aligned}$$
$$\begin{aligned} & =\lim _{h \rightarrow 0} \frac{(0-h)^2 \sin \left(\frac{1}{0-h}\right)}{0-h}=\lim _{h \rightarrow 0} \frac{h^2 \sin \left(\frac{-1}{h}\right)}{-h} \\ & =\lim _{h \rightarrow 0}+h \sin \left(\frac{1}{h}\right) \quad[\because \sin (-\theta)=-\sin \theta] \\ & =0 \times[\text { an oscillating number between }-1 \text { and } 1]=0 \\ R f^{\prime}(0) & =\lim _{x \rightarrow 0^{+}} \frac{f(x)-f(0)}{x-0}=\lim _{x \rightarrow 0^{+}} \frac{x^2 \sin \frac{1}{x}-0}{x-0} \\ & =\lim _{h \rightarrow 0} \frac{(0+h)^2 \sin \left(\frac{1}{0+h}\right)}{0+h}=\lim _{h \rightarrow 0} \frac{h^2 \sin (1 / h)}{h} \\ & =\lim _{h \rightarrow 0} h \sin (1 / h) \quad \\ & =0 \times[\text { an oscillating number between }-1 \text { and } 1]=0 \end{aligned}$$
$$\begin{aligned} &\because \quad L f^{\prime}(0)=R f^{\prime}(0)\\ &\text { So, } f(x) \text { is differentiable at } x=0 \text {. } \end{aligned}$$
$f(x)=\left\{\begin{array}{l}1+x, \text { if } x \leq 2 \\ 5-x, \text { if } x>2\end{array}\right.$ at $x=2$.
We have, $f(x)=\left\{\begin{array}{l}1+x, \text { if } x \leq 2 \\ 5-x, \text { if } x>2\end{array}\right.$ at $x=2$.
For differentiability at $x=2$,
$$ \begin{aligned} L f^{\prime}(2) & =\lim _{x \rightarrow 2^{-}} \frac{f(x)-f(2)}{x-2}=\lim _{x \rightarrow 2^{-}} \frac{(1+x)-(1+2)}{x-2} \\ & =\lim _{h \rightarrow 0} \frac{(1+2-h)-3}{2-h-2}=\lim _{h \rightarrow 0} \frac{-h}{-h}=1 \\ R f^{\prime}(2) & =\lim _{x \rightarrow 2^{+}} \frac{f(x)-f(2)}{x-2}=\lim _{x \rightarrow 2^{+}} \frac{(5-x)-3}{x-2} \\ & =\lim _{h \rightarrow 0} \frac{5-(2+h)-3}{2+h-2} \\ & =\lim _{h \rightarrow 0} \frac{5-2-h-3}{h}=\lim _{h \rightarrow 0} \frac{-h}{+h} \\ & =-1 \\ \because\quad L f^{\prime}(2) & \neq R f^{\prime}(2) \end{aligned}$$
So, $f(x)$ is not differentiable at $x=2$.
Show that $f(x)=|x-5|$ is continuous but not differentiable at $x=5$.
$$\begin{aligned} \text{We have,}\quad & f(x)=|x-5| \\ \therefore\quad & f(x)=\left\{\begin{array}{l} -(x-5) \text {, if } x<5 \\ x-5, \quad \text { if } x \geq 5 \end{array}\right. \end{aligned}$$
For continuity at $x=5$,
$$\begin{aligned} \mathrm{LHL} & =\lim _{x \rightarrow 5^{-}}(-x+5) \\ & =\lim _{h \rightarrow 0}[-(5-h)+5]=\lim _{h \rightarrow 0} h=0 \\ \mathrm{RHL} & =\lim _{x \rightarrow 5^{+}}(x-5) \\ & =\lim _{h \rightarrow 0}(5+h-5)=\lim _{h \rightarrow 0} h=0 \\ \therefore \quad \mathrm{f}(5) & =5-5=0 \\ \Rightarrow \quad \mathrm{LHL} & =\mathrm{RHL}=f(5) \end{aligned}$$
Hence, $f(x)$ is continuous at $x=5$.
Now,
$$\begin{aligned} L f^{\prime}(5) & =\lim _{x \rightarrow 5^{-}} \frac{f(x)-f(5)}{x-5} \\ & =\lim _{x \rightarrow 5^{-}} \frac{-x+5-0}{x-5}=-1 \\ R f^{\prime}(5) & =\lim _{x \rightarrow 5^{+}} \frac{f(x)-f(5)}{x-5} \\ & =\lim _{x \rightarrow 5^{+}} \frac{x-5-0}{x-5}=1 \end{aligned}$$
$$\therefore \quad L f^{\prime}(5) \neq R f^{\prime}(5)$$
So, $f(x)=|x-5|$ is not differentiable at $x=5$.