[Math] Are the following statements true or false (differentiability and continuity)

analysiscalculuscontinuityderivativesfunctions

A "yes" or "no" is enough, reasons aren't required but I'd like to
know them anyway to understand it better.

1) The mapping $g:\mathbb{R}\rightarrow\mathbb{R}$, with
$g(x)=\frac{1}{2}\cos^{2}(x)$ if $x\leq0$ and $g(x)=\frac{1}{2}(x-1)$
if $x\geq0$ is continuous.

2) The mapping $h:\mathbb{R} \setminus \left\{0\right\} \rightarrow
\mathbb{R}, h(x) = \left | \cos\left(\frac{1}{x}\right)\right|$ is
differentiable.

I have problems with this task (no homework) because I'm supposed to say if the mapping / function is differentiable and continuous while there is no position given where I need to check that…

1) I say yes. We can never get to a discontinuity position in $cos$, not even if $x$ is smaller or equal to zero. Also for the second condition we can never get a discontinuity position.
(But that's really a reason? Actually, in order to show the continuity, I would have checked the limit for both negative and positive sides, if equal, then continuous…But I don't know how this could be applied here)

2) I say yes. The discontinuity position $0$ has been excluded by the domain and thus there aren't any other discontinuity positions left.

Additonally, I have derivated the function $h$:

$$h'(x)=\frac{1}{x^{2}}\sin\left(\frac{1}{x}\right)$$

Because the derivative of the function exists, it is also differentiable. But again, there was no position given in the task, so I got my doubts if it works like that.

I got an additional question: If you have derivated a function and the derivation is a constant, is the function differentiable then?

Please tell me if my answers (yes/no) are correct and if possible, please also tell me if my reasonings are.

Best Answer

For (1): the function is discontinuous at $0$ because the limit from the left is: $$\frac{1}{2}\cos^2(0)=1/2,$$ while the limit from the right is $$\frac{1}{2}(0-1)=-1/2.$$

Note we can find these left and right limits be substitution because each piece ($(-\infty,0)$ and $(0,\infty)$) of the function is continuous.

(Actually $g$ is not a function because the two formulae do not agree at $x=0$. Probably one of the inequalities should be weak?)


For (2), your expression for the derivative (where it is defined) should be

$$h'(x)=\frac{\cos(1/x)\sin(1/x)}{|\cos(1/x)|x^2}.$$

To see why, note that $$h(x)=\begin{cases}\cos(1/x)& \cos(1/x)\geq0\\ -\cos(1/x) & \cos(1/x)<0\end{cases}$$

If $\cos(1/x)>0$ then your expression is correct. If $\cos(1/x)<0$, then $h(x)=-\cos(1/x)$ so:

$$h'(x)=-\frac{\sin(1/x)}{x^2}.$$

Thus $$h(x)=\begin{cases}\frac{\sin(1/x)}{x^2}& \cos(1/x)>0\\ -\frac{\sin(1/x)}{x^2}& \cos(1/x)<0\end{cases}$$

which is equivalent to the earlier expression.

The function $h$ is not differentiable at each point where $\cos(1/x)=0$. For example, it is not differentiable at $$\frac{1}{\frac{\pi}{2}}=\frac{2}{\pi}.$$ It is similar to why $|x|$ is not differentiable at $0$.

Related Question