3

Another exercise I did without any solutions.

I highly doubt this is correct so pls correct me :)

Let $f: \mathbf{R} \rightarrow \mathbf{R}$ be given by $f(x):=x|x| .$ Show that $f$ is continuous and differentiable on $\mathrm{R}$

$$ \begin{array}{l} \text { Continuous: } \lim _{x \rightarrow c} f(x)=f(c) \\ \begin{aligned} \lim _{x \rightarrow c} x \cdot|x| &=\lim _{x \rightarrow c} x \cdot \lim _{x \rightarrow c}|x|=f(c) \\ &=\lim _{x \rightarrow c} c \cdot \lim _{x \rightarrow c}|c|=f(c) \\ &=c \cdot|c|=f(c)=c \cdot|c| \end{aligned} \end{array} $$ So $f(x)$ is continuous

Differentiable: show $f^{\prime}(x)$ exists atall $x \in \mathbb{R}$ : $$ \begin{array}{l}\lim _{h \rightarrow 0} \frac{f(x+h)-f(x)}{h} \\ \lim _{h \rightarrow 0} \frac{(x \cdot|x|)+h-(x \cdot|x|)}{h} \\ =\lim _{h \rightarrow 0} \frac{h}{h}=1\end{array} $$ $$ So f(x) \text { is differentiable } $$

Arctic Char
  • 16,007
  • 4
    Your computation for differentiability is not correct. –  Aug 18 '20 at 20:55
  • 1
    Recheck $f(x+h)$. – Umesh Shankar Aug 18 '20 at 20:55
  • 5
    This proof would seem to show that every function is differentiable with derivative always $1$. $\lim _{h \rightarrow 0} \frac{f(x+h)-f(x)}{h} = \lim _{h \rightarrow 0} \frac{f(x)+h-f(x)}{h} =\lim _{h \rightarrow 0} \frac{h}{h}=1$. But that would make calculus pretty boring. – Jair Taylor Aug 18 '20 at 20:58
  • Observation: Since that $lim_{x \to c}x$ exists and $lim_{x \to c} |x|$ exists, so you can say that $lim_{x \to c} x|x|=lim_{x \to c}x \cdot \lim_{x \to c}|x|$ exists and also $c|c|=lim_{x \to c} x|x|=lim_{x \to c}x \cdot \lim_{x \to c}|x|=f(c)$Then $f$ is continuous function $\forall c \in \mathbb{R}$. –  Aug 18 '20 at 21:00

3 Answers3

2

The continuity part is correct, but not the differentiability part. Note that $f(x)=x^2$ is $x\geqslant0$. This shows that $f'(x)=2x$ is $x>0$ and that the right derivative of $f$ at $0$ is $0$. By the same argument, $f'(x)=-2x$ is $x<0$ and the left derivative of $f$ at $0$ is $0$. So, $f$ is differentible in $\Bbb R\setminus\{0\}$ and, since the left and the right derivatives at $0$ are both equal to $0$, $f'(0)=0$. In particular, $f$ is differentiable at $0$ too.

  • The answer uses that if $\lim_{x\to } f'(x) $ exists, than $f$ is differentiable at $x=0$ and $f'(0) = \lim_{x\to 0} f'(x)$. This follows from Mean Value Theorem (see here). – Arctic Char Aug 20 '20 at 04:04
2

Alternatively,

  • for $x<0$, $f(x)=-x^2$, which is differentiable;

  • for $x>0$, $f(x)=x^2$, which is differentiable;

  • at $x=0$, $\dfrac{f(h)-f(0)}h=\pm h\to 0$ confirms the function being differentiable.

A differentiable function is also continuous.

1

For $x\neq 0$, $$\begin{align*} \lim_{h\to 0} \frac{f(x+h)-f(x)}{h}&= \lim_{h\to 0} \frac{(x+h)|x+h|-x|x|}{h}\\&=\lim_{h\to 0} \frac{x|x+h| + h|x+h|-x|x|}{h}\\&=\lim_{h\to 0} \frac{x(|x+h|-|x|)+h|x+h|}{h}\\&= \lim_{h\to 0}\frac{x(|x+h|-|x|)}{h} + \frac{h|x+h|}{h}\\&=\bigg[x\lim_{h\to 0}\frac{|x+h|-|x|}{h}\bigg]+|x|\\&=\frac{x^2}{|x|}+|x|\\&= 2\frac{x^2}{|x|}\\&=2\bigg|\frac{x^2}{x}\bigg|\\&=2|x|\end{align*} $$

For the left and right hand limits of $$f'(x)=\frac{x^2}{|x|}+|x|$$ as $x\to 0$, both go to $0$, so $f(x)$ is differentiable at $0$.

Note:For $g(x)=|x|$, $$\begin{align*} g'(x)&=\lim_{h\to 0} \frac{|x+h|-|x|}{h}\\&=\lim_{h\to 0}\frac{\sqrt{(x+h)^2}-\sqrt{x^2}}{h}\\&=\lim_{h\to 0} \frac{(x+h)^2-x^2}{h(\sqrt{(x+h)^2}+\sqrt{x^2})}\\&=\lim_{h\to 0}\frac{x^2+2xh+h^2-x^2}{h(\sqrt{(x+h)^2}+\sqrt{x^2})}\\&= \lim_{h\to 0} \frac{2x+h}{\sqrt{(x+h)^2}+\sqrt{x^2}}\\&= \frac{2x}{2|x|}\\&=\frac{x}{|x|}\end{align*}$$

C Squared
  • 3,648
  • 1
  • 9
  • 32