0

Why is the derivative of $f(x) = x-(x^2-2x)$ not defined at $x= 0$?

For a function $f(x) = x-|x^2-2x|$, the differentiation is possible when is broken into a piece wise function. i.e.

$$f(x) =\begin{cases}x-(x^2-2x)&x^2-2x\ge0\\ x+(x^2-2x)&x^2-2x < 0\end{cases}$$

$$f'(x)=\begin{cases}1-(2x-2)&x^2-2x > 0\\ 1+(2x-2)&x^2-2x < 0\end{cases}$$

The derivative at $x=0$ is not defined. Why? Please explain.

user91500
  • 5,606
Minu
  • 971
  • 1
  • 9
  • 16
  • Have you checked to see if th right- and left -e expressions agree at $x=0$? – user99680 Jul 05 '14 at 04:09
  • The derivative of the function $f$ defined by $f(x) = x - (x^2 - 2x)$ is defined at $x=0$, but that's not what the rest of your question is asking. Have you tried computing the derivative at $x=0$? You could go all the way back to the limit definition of derivative if you need to. –  Jul 05 '14 at 04:12
  • The function is $f(x)=x-|x^2-2x|$?? – AsdrubalBeltran Jul 05 '14 at 04:13

3 Answers3

1

Let $x$ be small positive. Then $x^2-2x$ is negative, so $x-|x^2-2x|=x-(2x-x^2)=-x+x^2$.

Let $x$ be negative. Then $x^2-2x$ is positive, so $x-|x^2-2x|=x-(x^2-2x)=3x-x^2$.

So if $h$ is small positive, then $\frac{f(0+h)-f(0)}{h}=-1+h$.

If $h$ is negative, then $\frac{f(0+h)-f(0)}{h}=3-h$.

Thus the limit of $\frac{f(0+h)-f(0)}{h}$ as $h$ approaches $0$ from the right is $-1$.

The limit of $\frac{f(0+h)-f(0)}{h}$ as $h$ approaches $0$ from the left is $3$.

It follows that $\lim_{h\to 0}\frac{f(0+h)-f(0)}{h}$ does not exist.

Remark: It might be useful to have software graph the function, so that you can see the "kink" at $x=0$. This example is an more complicated version of the probably familiar fact that the function $g(x)=|x|$ is not differentiable at $x=0$.

André Nicolas
  • 507,029
  • Thank you. Because the limit at zero is two sided, the derivative at zero does not exist. – Minu Jul 06 '14 at 22:04
  • You are right, for the derivative to exist the limit of the "difference quotient" must exist. So if the limits from the right and from the left are different, the "full" limit does not exist. – André Nicolas Jul 06 '14 at 22:07
0

$$f'(0)=\lim_{x \to 0}\frac{f(x)-f(0)}{x-0}=\lim_{x \to 0}\frac{x-|x^2-2x|}{x}=\lim_{x \to 0}\frac{x-|x(x-2)|}{x} $$ If $x \to 0^+$ then $x(x-2)<0$: $$\lim_{x \to 0^+}\frac{x-|x(x-2)|}{x}=\lim_{x \to 0^{+}}\frac{x+x(x-2)}{x}=\lim_{x \to 0^{+}}1+(x-2)=-1$$

If $x \to 0^-$ then $x(x-2)>0$: $$\lim_{x \to 0^+}\frac{x-|x(x-2)|}{x}=\lim_{x \to 0^{+}}\frac{x-x(x-2)}{x}=\lim_{x \to 0^{+}}1-(x-2)=3$$ Then $$\lim_{x \to 0}\frac{x-|x(x-2)|}{x}=f'(0)$$ does not exist.

0

I think the problem is the way you were taught derivatives. There is a theorem which states that the derivative of $f(g(x))$ is $f'(g(x)) g'(x)$ in every point where both $f$ and $g$ are differentiable. In your case you have $g(x)=x^2-2x$ and $f(y) = |y|$ which is differentiable for $y\neq 0$ and from the theorem you find that your function is differentiable for $x\neq 0$ and $x\neq 2$. But the theorem tells you nothing in the case that the assumptions are not satisfied. When $g(x)=0$ i.e. for $x=0$ and $x=2$ you should use the definition of derivative and check if the limits exists and are finite: $$ \lim_{x\to 0} \frac{f(g(x+h))-f(g(x))}{h},\qquad \lim_{x\to 2} \frac{f(g(x+h))-f(g(x))}{h} $$

If you look at the function $|x^2-2x|$ as a function defined piecewise you are using another theorem which tells you that the derivative of a function in a point $x$ only depend on the values of $f$ in a neighbourhood of $x$. So if you have a function defined piecewise as: $$ f(x) = \begin{cases} g(x)\text{ if } x \in I\\ h(x) \text{ if } x \in J \end{cases} $$ and if $g$ and $h$ are differentiable, you can conclude that $f$ is differentiable in the interior of $I$ and in the interior of $J$. Again this tells you nothing about the points in the boundary of $I$ or $J$. In such points you need, again, to apply the definition of derivative.

Actually there is a positive result which you can use to avoid to check the limit of the incremental ratio. By l'Hopital theorem one can show that if a function $f$ is continuous in a point $x_0$ and if it is differentiable in a neighbourhood of $x_0$ and if $f'(x)\to \ell$ as $x\to x_0$, then $f$ is differentiable in $x_0$ and $f'(x_0)=\ell$.