# Simple Differentiability and Continuity Question

## Homework Statement

If f(x) = 3 for x < 0 and f(x) = 2x for x ≥ 0, is f(x) differentiable at x = 0? State and justify why/why not.

## The Attempt at a Solution

Obviously, since f(x) is not continuous and the limit doesn't exist as x$\rightarrow$0, the function shouldn't be differentiable at that point. But I can't justify this because I don't really understand why not. Simply put, I get that the limit doesn't exist at 0 and, hence, the function is discontinuous there, but I don't see why that invalidates the idea that the gradient of the line f(x) = 2x at x = 0 is 2. Further, as far as I can tell (and I have a strong feeling I'm going wrong here somewhere), f'(x) = 0 for x < 0 and f'(x) = 2 for x ≥ 0, which seems to suggest that the derivative of f(x) for all values of x ≥ 0 is 2. What am I missing here?

As always, any help would be much appreciated, thanks.

## Answers and Replies

HallsofIvy
Science Advisor
Homework Helper
You say, twice, that the limit does not exist at 0. What limit? I think you mean just $lim_{x\to 0} f(x)$ but the derivative, at x= 0, is defined as
$$\lim_{h\to 0}\frac{f(h)- f(0)}{h}= \lim{h\to 0} \frac{f(h)}{h}$$
if the numerator does not go to 0, then that limit cannot exist.

You say, twice, that the limit does not exist at 0. What limit? I think you mean just $lim_{x\to 0} f(x)$ but the derivative, at x= 0, is defined as
$$\lim_{h\to 0}\frac{f(h)- f(0)}{h}= \lim{h\to 0} \frac{f(h)}{h}$$
if the numerator does not go to 0, then that limit cannot exist.

You're right; I was considering the problem in too narrow a scope and only considering the limit as x$\rightarrow$0. So let's see: the limit as x$\rightarrow$0 of f(x) does not exist, therefore, the limit as h$\rightarrow$0 of f(0 + h) - f(0) does not exist either. The limit as h$\rightarrow$0 of h is obviously just 0, and, since in $$\lim_{h\to 0}\frac{f(0 + h) - f(0)}{h}$$ the denominator approaches 0 as expected, but the numerator does not exist, then the limit of the quotient and hence the derivative does not exist. Is that right?

HallsofIvy
Science Advisor
Homework Helper
For this particular function, yes, the limit of the numerator does not exist. But the reason why a function has to be continuous to be differentiable is more general. Consider another example: f(x)= 2x for x not equal to 0, f(0)= 1. Now $\lim_{h\to 0}f(h)= 0$ but $\lim_{h\to 0} f(h)- f(0)= -1$. The limit of the numerator does exist but is not 0 so $\lim_{h\to 0} (f(h)- f(0))/h$ does not exist.