Differentiability of $\cos{|x|}$ and $\sin{|x|}$ at $x=0$

849 Views Asked by At

Define differentiability of $\cos{|x|}$ and $\sin{|x|}$ at $x=0$

It is said that $\cos|x|$ is continuous and $\sin|x|$ is discontinuous at $x=0$. $$ Lf'(0)=\lim_{h\to 0^-}\frac{\cos|0+h|-\cos|0|}{h}=\lim_{h\to{0}}\frac{\cos h-1}{h}=Rf'(0) $$ Thus $\cos|x|$ is continuous. Fine, but applying chain rule, let $|x|=t$ $$ \frac{d}{dx}\cos|x|\bigg|_{x=0}=\frac{d}{dx}\cos t\bigg|_{x=0}=\frac{d(\cos t)}{dt}.\frac{dt}{dx}\bigg|_{x=0}=-\sin t.\frac{dt}{dx}\bigg|_{x=0}=-\sin t.\frac{d|x|}{dx}\bigg|_{x=0} $$ As $|x|$ is not differentiable at $x$=$0$, how can we define the derivative of $\cos|x|$ at $x=0$ ?

4

There are 4 best solutions below

4
On BEST ANSWER

Since the functions, $|x|,\;\cos(x),\;\sin(x)$ are continuous, and since a composition of continuous functions is continuous, it follows that the functions $\cos(|x|)$, and $\sin(|x|)$ are both continuous.

With regard to differentiability . . .

By the chain rule, if two functions are both differentiable, their composition is also differentiable.

However, if one or both of two functions is not differentiable, the chain rule is not applicable, so yields no information.

Thus, for the question of whether $\cos(|x|)$ or $\sin(|x|)$ is differentiable at $x=0$, the chain rule doesn't apply.

Instead, we can argue as follows . . .

If $x\ge 0$, then $\cos(|x|)=\cos(x)$.

If $x < 0$, then $\cos(|x|)=\cos(-x) = \cos(x)$.

Thus, $\cos(|x|)=\cos(x)$, for all $x$.

Hence, since $\cos(x)$ is differentiable, so is $\cos(|x|)$.

On the other hand, $\sin(|x|)$ is not differentiable at $x=0$, since at $x=0$, the slope from the right is $1$, and the slope from the left is $-1$.

More precisely, let $f(x) = \sin(|x|)$.

If we restrict the domain of $f$ to $[0,\infty)$, we have $f(x) = \sin(|x|)=\sin(x)$, so on that domain, we have $f'(0)=\cos(0)=1$.

If we restrict the domain of $f$ to $(-\infty,0]$, we have $f(x) = \sin(|x|)=\sin(-x)=-\sin(x)$, so on that domain, we have $f'(0)=-\cos(0)=-1$.

3
On

Just through definition. For small $|h|>0$, then \begin{align*} \dfrac{\cos|h|-1}{h}=\dfrac{\cos h-1}{h}, \end{align*} so \begin{align*} \lim_{h\rightarrow 0}\dfrac{\cos|h|-1}{h}=\lim_{h\rightarrow 0}\dfrac{\cos h-1}{h}=-\sin 0=0. \end{align*}

0
On

(1) Both $\cos|x|$ and $\sin|x|$ are continuous at $x=0$.

(2) $\cos|x|$ is differentiable at $x=0$.

$$\lim_{x\to 0^+}\frac{\cos|x|-\cos|0|}{x-0}=\lim_{x\to 0^+}\frac{\cos x -\cos 0}{x-0}=\left.\frac{d\cos x}{dx}\right|_{x=0}=0$$

$$\lim_{x\to 0^-}\frac{\cos|x|-\cos|0|}{x-0}=\lim_{x\to 0^+}\frac{\cos (-x) -\cos 0}{x-0}=\lim_{x\to 0^+}\frac{\cos x -\cos 0}{x-0}=\left.\frac{d\cos x}{dx}\right|_{x=0}=0$$

Therefore $\displaystyle \left.\frac{d\cos |x|}{dx}\right|_{x=0}$ exists and equals to $\displaystyle \left.\frac{d\cos x}{dx}\right|_{x=0}$.

(3) $\sin|x|$ is not differentiable at $x=0$.

$$\lim_{x\to 0^+}\frac{\sin|x|-\sin|0|}{x-0}=\lim_{x\to 0^+}\frac{\sin x -\sin 0}{x-0}=\left.\frac{d\sin x}{dx}\right|_{x=0}=1$$

$$\lim_{x\to 0^-}\frac{\sin|x|-\sin|0|}{x-0}=\lim_{x\to 0^+}\frac{\sin (-x) -\sin 0}{x-0}\lim_{x\to 0^+}\frac{-(\sin x -\sin 0)}{x-0}=\left.\frac{d(-\sin x)}{dx}\right|_{x=0}=-1$$

Therefore $\displaystyle \left.\frac{d\sin |x|}{dx}\right|_{x=0}$ does not exist.

0
On

1) Here is a graph of $f=\sin \vert x \vert$ where $x$ ranges over $-1$ to $1$:

enter image description here

There is a "corner" at $x=0$, so $f$ is not differentiable there.

2) $g=\cos \vert x \vert$ where $-2 \leq x \leq 2$

enter image description here

How can we define the derivative of $\cos \vert x \vert $ at $x=0$ ?

If $h \neq 0$, then the two distinct points $(0,g(0))$ and $(0+h,g(0+h))$ determine a straight line whose slope is $$\frac{g(0+h)-g(0)}{h}$$ The tangent line at $(0,g(0))$ seems to be the limit in some sense of these secant lines as $h$ approaches $0$. The slope of the tangent line through $(0,g(0))$ should be $$\lim_{h \rightarrow 0} \frac{g(0+h)-g(0)}{h}$$ With this limit exist then $g$ is differentiable at $0$. Refer This computation given by CY Aries