Graph of maxsint:0≤t≤x in x∈[0,π]

& the graph of y=2+cosx for x∈[π,∞)

So graph of
f(x)={\begin{matrix}\mathrm{sin}x, & 0\leq x\leq \frac{\pi }{2} \\ 1, & \frac{\pi }{2}\leq x\leq \pi \\ 2+\mathrm{cos}x, & x>\pi \end{matrix}

f(x) is differentiable everywhere in (0,∞)