0

The function $$f(x)=\cos(e^{|x|}-1)$$

At x=0

The left and right hand limit are 0

$$\lim_{h\to 0^{\pm}}\frac{f(0+h)-f(0)}{h}=0 $$

This must mean the function is diffrentiable at zero. But wolfram alpha is contradicting this, say in it is undefined. Even the online derivitive calculator is showing undefined. Is this an error? WOLFRAM ALPHA

SYMBOLAB

Sid
  • 1,234
  • How did you evaluate the limit ? –  Apr 01 '17 at 12:30
  • http://math.stackexchange.com/questions/991475/why-is-the-absolute-value-function-not-differentiable-at-x-0/991559 the same manner as this link except with my function, then used l'hopital – Sid Apr 01 '17 at 12:47
  • 3
    I think the derivative exists at 0 and is 0. –  Apr 01 '17 at 12:51
  • 3
    WA is at fault here. Learning math via software tools should be avoided. – Paramanand Singh Apr 01 '17 at 13:10
  • #paramanand I understand if the left hand derivitive= right hand the derivitive is that finite number. But how can the chain rule be wrong? – Sid Apr 01 '17 at 13:21
  • 2
    The chain rule isn't wrong. It just doesn't apply in this situation, where the inner function $g$ isn't differentiable. That doesn't prevent the composite function $f \circ g$ from being differentiable; it all depends on what $f$ is. (Trivial example: if $f$ is a constant function, then so is $f \circ g$, no matter what $g$ is, so $(f \circ g)'=0$.) – Hans Lundmark Apr 01 '17 at 13:39
  • Even though the chain rule has denominator |x| there is always a way to simply this. I am Still searching for a way to do so. Sinx is odd so I'm Still working with this – Sid Apr 01 '17 at 13:44
  • Actually you are all right. It satisfies the formal definition of a derivitive at a point. So it MUST hold. Thanks for clarifying – Sid Apr 01 '17 at 13:48
  • Even though WA is wrong about the derivative, using it for plotting the function provides pretty convincing evidence (although not a proof, of course) that $f'(0)=0$: link. – Hans Lundmark Apr 01 '17 at 13:51
  • Please verify this sir: $e^{|x|}$ is NOT diffrentiable at 0 as the left hand derivitive and right hand derivative are not equal at this point. – Sid Apr 01 '17 at 13:53
  • I don't know why this was downvoted. The function in question is very good example which shows the limitation of chain rule. +1 for the same. Also I would request you to unaccept the wrong answer. – Paramanand Singh Apr 01 '17 at 16:06

2 Answers2

3

Using the chain rule we have that for $x\in\Bbb R\setminus\{0\}$

$$f'(x)=-\sin(e^{|x|}-1)e^{|x|}\operatorname{sign}(x)$$

and

$$\lim_{x\to 0}f'(x)=0$$

where the above limit is equivalent to

$$f'(0)=\lim_{x\to 0^+}\frac{\cos(e^x-1)-1}{x}=\lim_{x\to 0^-}\frac{\cos(e^{-x}-1)-1}{x}=0$$

due to L'Hôpital rule.

P.S.: dont trust wolfram alpha or any other mathematical software.

Masacroso
  • 30,417
  • so you are saying it is differentiable at 0? – Sid Apr 01 '17 at 12:53
  • @Sid yes, it is. The two limiting process are equivalent... remember L'Hôpital rule! – Masacroso Apr 01 '17 at 12:53
  • yes, i have used l'hopital in evaluating the limits. but how can all famous mathematical softwares be wrong? wolfram, symbolab, online derivitive calculator? – Sid Apr 01 '17 at 12:55
  • @Sid they are wrong all the time, believe me. Intelligence cannot be copied as easily! – Masacroso Apr 01 '17 at 12:57
  • yes but they are right for other limits. IS this function a special case, where it is differentable at x=0? – Sid Apr 01 '17 at 12:58
  • @Sid Just evaluate the right and left side limits with WA and also there are many examples of WA being wrong with limits. –  Apr 01 '17 at 13:01
  • @Sid Special case in what sense ? there are infinitely many functions differentiable at 0. –  Apr 01 '17 at 13:03
  • anyway probably wolfram-alpha is taking $f$ as a function defined in $\Bbb C$, that is, by default the wolfram language take all variables as complex. Anyway all CAS fail most of the time in many evaluations, so dont trust so much except for boring but easier calculations. – Masacroso Apr 01 '17 at 13:04
  • then why is symbolab and the online derivative calculator showing error too? and not to $cos|x|$ or $x^2e^{|x|}$ – Sid Apr 01 '17 at 13:07
  • the denominator of the derivative has |x| that is not possible to simplify! – Sid Apr 01 '17 at 13:09
  • @Masacroso why would the chain rule ever be incorrect? – Sid Apr 01 '17 at 13:09
  • Just other example more of WA being wrong. There are many, and reading posts in ME one can surely find dozens of cases. Most probably WA wants to apply directly the chain rule, and since the derivative of $;|x|;$ at $;x=0;$ doesn't exist the mistake follows. Don't over trust WA or similar programs. – DonAntonio Apr 01 '17 at 13:14
  • Actually you are all right. It satisfies the formal definition of a derivitive at a point. So it MUST hold. Thanks for clarifying – Sid Apr 01 '17 at 13:49
3

It appears that you have a hard time trying to come to terms with this example where chain rule does not apply. But then you have to understand that chain rule is a one way implication:

If $g$ is differentiable at $a$ and $f$ is differentiable at $g(a)$ then $f\circ g$ is differentiable at $a$.

The following converse does not hold:

If $f\circ g$ is differentiable at $a$ then $g$ is differentiable at $a$ and $f$ is differentiable at $g(a)$.

In your example the function $G(x) = e^{|x|} - 1$ is not differentiable at $0$ and $F(x) = \cos x$ is differentiable at $G(0) = 0$ and yet $F\circ G$ is differentiable at $0$. Here is an intuitive way to look at this. Since we are only interested in the troublesome point $x = 0$ we need to analyze the behavior of $f(x) = \cos(e^{|x|} - 1)$ near point $x = 0$. Now if $x$ is near $0$ then $e^{|x|} \approx 1 + |x|$ and hence $f(x) \approx \cos |x| = \cos x$ so that the modulus sign goes away and we should expect $f$ to be differentiable there.

Note that the even nature of $\cos$ plays a significant role here. The function $g(x) = \sin (e^{|x|} - 1)$ looks similar but is not differentiable at $0$. You should be able to show in general that if $F$ is an even function differentiable at $0$ then $F'(0) = 0$ and if $g(x) = F(e^{|x|} - 1)$ then $g'(0) = 0$.

  • Yes, this is the correct answer, but will the OP be able to recognize it as such? – Alex M. Apr 01 '17 at 16:12
  • @AlexM.: Don't worry, OP already has taken a step in right direction by unaccepting the wrong answer. – Paramanand Singh Apr 01 '17 at 16:16
  • Yes but $\cos(e^{|x|})$ is NOT diffrentiable at 0 and the left hand ad right hand derivatives are not equal. – Sid Apr 01 '17 at 17:25
  • @Sid $F(\color{red}{e^{|x|} - 1})$ not $F(e^{|x|})$. Anyway don't use capitals because they are against the policy. Don't ask me I still don't get why. –  Apr 01 '17 at 21:03