Differentiability Piecewise function

244 Views Asked by At

Problem 13- Chapter 9- Spivak

Let $f(x)=x^2$ if x is rational, and $f(x)=0$ if x is irrational. Prove that at x=0 f is differentiable.

What I did: In this problem, all I was able to do was to see that f(x) is continuous at x=0 and that $f'(0)=\lim_{h\to 0}{\frac{f(h)}{h}}$. From there, that if h is rational $f'(0)=\lim_{h\to 0}{h}=0$ and if h is irrational $f'(0)=\lim_{h\to 0}{0}=0$. But I could not formalize it to be a valid solution.

Any help will be appreciated.

2

There are 2 best solutions below

8
On BEST ANSWER

To prove that $\displaystyle \lim_{h\to0} \frac{f(0+h)-f(0)}{h} = 0$, where $f(x) = \begin{cases} x^2 & x \in \Bbb Q \\ 0 & x \in \Bbb R \setminus \Bbb Q \end{cases}$:

The required proposition can be simplied to $\displaystyle \lim_{h\to0} \frac{f(h)}{h} = 0$.

Using the epsilon-delta of limit, our proposition becomes $\forall\varepsilon>0: \exists\delta>0: 0<|h|<\delta \implies \left\vert\dfrac{f(h)}h\right\vert<\varepsilon$.

Let $\varepsilon>0$ be arbitrary.

We claim that $\delta=\varepsilon$ satisfies the proposition:

Let $h$ be a real number such that $0<|h|<\delta$.

If $h$ is rational, then $\dfrac{f(h)}h = \dfrac{h^2}h=h<\delta=\varepsilon$. (Why doesn't it fail for $h=0$?)

If $h$ is irrational, then $\dfrac{f(h)}h=\dfrac0h=0<\varepsilon$.

Hence, we conclude that $\left\vert\dfrac{f(h)}h\right\vert<\varepsilon$.

1
On

Since$$\frac{f(h)}h=\begin{cases}h&\text{ if }h\in\mathbb{Q}\setminus\{0\}\\0&\text{ if }h\text{ is irrational,}\end{cases}$$then, for every $\varepsilon>0$, if you take $\delta=\varepsilon$, then$$|h|<\delta=\varepsilon\implies\left|\frac{f(h)}h\right|<\varepsilon.$$So, this proves, by the definition of limit, that$$f'(0)=\lim_{h\to0}\frac{f(h)}h=0.$$