# Thread: derivative of a function

1. ## derivative of a function

$f(x) = \left\{ {\begin{array}{rl} {0,} & {x \in \mathbb{Q}} \\ {x^2 - x^4 ,} & {x \notin \mathbb{Q}} \\ \end{array} } \right.$

I'm trying to find $f'(x)$. I think the function f is not continuous except at points 0 and 1. So if I can show that, that means f is not differentiable except (possibly) at 0 and 1. Am I going in the right direction?

If so, then f'(0) would be 0, but I'm not sure about f'(1)...

2. $f(x)$ is also continuous at $x = -1$ too.

3. Oops. Good point. $f(x)$ is continuous at 0, -1, and 1.

Wouldn't $f'(-1)=f'(1)=0$ since $f'(x) = \left\{ {\begin{array}{rl} {0,} & {x \in \mathbb{Q}} \\ {2x - 4x^3 ,} & {x \notin \mathbb{Q}} \\ \end{array} } \right.$? Or is it more complicated than that?

4. First the code $$f(x) = \left\{ {\begin{array}{cl} {0,} & {x \in \mathbb{Q}} \\ {x^2 - x^4 ,} & {x \notin \mathbb{Q}} \\ \end{array} } \right.$$ gives $f(x) = \left\{ {\begin{array}{cl} {0,} & {x \in \mathbb{Q}} \\ {x^2 - x^4 ,} & {x \notin \mathbb{Q}} \\ \end{array} } \right.$

Now look at $\lim _{h \to 0} \frac{{f(x_0 + h) - f(x_0 )}}{h}$

5. $f'(0)=\lim_{h \to 0} \frac{f(0+h)-f(0)}{h}=\lim_{h \to 0} \frac{f(h)}{h}=\lim_{h \to 0} \frac{h^2-h^4}{h}=\lim_{h \to 0} h-h^3 = 0$

$f'(1)=\lim_{h \to 0} \frac{f(1+h)-f(1)}{h}=\lim_{h \to 0} \frac{f(1+h)}{h}=\lim_{h \to 0} \frac{(1+h)^2-(1+h)^4}{h}=0$ or $\lim_{h \to 0} \frac{0}{h} = 0$

I think $f'(-1)$ would look similar to $f'(1)$

6. Originally Posted by DPMachine
$f'(0)=\lim_{h \to 0} \frac{f(0+h)-f(0)}{h}=\lim_{h \to 0} \frac{f(h)}{h}=\lim_{h \to 0} \frac{h^2-h^4}{h}{\color{red}\star}=\lim_{h \to 0} h-h^3 = 0$

$f'(1)=\lim_{h \to 0} \frac{f(1+h)-f(1)}{h}=\lim_{h \to 0} \frac{f(1+h)}{h}=\lim_{h \to 0} \frac{(1+h)^2-(1+h)^4}{h}=0$ or $\lim_{h \to 0} \frac{0}{h} = 0$

I think $f'(-1)$ would look similar to $f'(1)$
You have a bit of a problem here. At the starred step you made a fatal error. If you would have put $\lim_{h\in\mathbb{R}-\mathbb{Q}\to0}\frac{f(h)}{h}$ you could have done that, but considering that your limit travels along a path containing both irrationals and rationals this is not permissable. Claim the limit is zero though and make and argument then that considering the limit along the path of the irrationals is enough.

7. Would it be similar to what I did for $f'(1)$?

Travelling along the irrationals, $\lim_{h\in\mathbb{R}-\mathbb{Q}\to0}\frac{f(h)}{h}=\lim_{h\in\mathbb{R}-\mathbb{Q}\to0}\frac{h^2-h^4}{h}=0$

And travelling along the rationals, $\lim_{h\in\mathbb{Q}\to0}\frac{f(h)}{h}=\lim_{h\in \mathbb{Q}\to0}\frac{0}{h}=0$

I think this should be enough because rationals and irrationals are both dense subsets of reals.

8. Originally Posted by DPMachine
Would it be similar to what I did for $f'(1)$?

Travelling along the irrationals, $\lim_{h\in\mathbb{R}-\mathbb{Q}\to0}\frac{f(h)}{h}=\lim_{h\in\mathbb{R}-\mathbb{Q}\to0}\frac{h^2-h^4}{h}=0$

And travelling along the rationals, $\lim_{h\in\mathbb{Q}\to0}\frac{f(h)}{h}=\lim_{h\in \mathbb{Q}\to0}\frac{0}{h}=0$

I think this should be enough because rationals and irrationals are both dense subsets of reals.
Maybe be a little more precise. consider $\left|\frac{f(h)}{h}-0\right|\le\left|h-h^3\right|$ and since the right hand side converges to zero we may conclude that the left does as well by the squeeze theorem.

9. $

\left| \frac{f(1+h)}{h} \right| \le \left| \frac{(1+h)^2-(1+h)^4}{h} \right|
$

Okay, then would this make sense as well? Since the right side in this case also converges to 0, I can use the squeeze theorem to conclude that the left side also converges to 0?

10. Originally Posted by DPMachine
$

\left| \frac{f(1+h)}{h} \right| \le \left| \frac{(1+h)^2-(1+h)^4}{h} \right|
$

Okay, then would this make sense as well? Since the right side in this case also converges to 0, I can use the squeeze theorem to conclude that the left side also converges to 0?
Friend, analysis is about precision of language. Stating an inequality and the result is not a proof. Take the time and care, but yes I believe you are on the right track.