# Existence of the derivative: a quick doubt

1. Jan 7, 2013

### Felafel

1. The problem statement, all variables and given/known data

Determine for which real values of a,b,c,d this function is differentiable $\forall x \in \mathbb{R}$:
$f(x):=$

$ax+b$ $for x\leq1$

$ax^2+c$ $for 1\leq x \leq2$

$\frac{dx^2 +1}{x}$ $for x>2.$

3. The attempt at a solution

I know a function is differentiable when the right and left derivatives exist and are equal.
So,

$\displaystyle \lim_{x \to 1^-} \frac{(ax+b)-(a+b)}{x-1}=\displaystyle \lim_{x \to 1^+} \frac{(ax^2+c)-(a+c)}{x-1}$

$\displaystyle \lim_{x \to 1^-} \frac{a(x-1)}{x-1}=\displaystyle \lim_{x \to 1^+}\frac{a(x^2-1)}{x-1}$

$a=2a\Rightarrow$ a=0

$\displaystyle \lim_{x \to 2^-} \frac{ax^2+c-(4a+c)}{x-2}=\displaystyle \lim_{x \to 2^+} \frac{\frac{dx^2+1}{x}-\frac{4d+1}{2}}{x-2}$

$\displaystyle \lim_{x \to 2^-} \frac{a(x^2-4)}{x-2}=a(x+2)=4a=0$

$\displaystyle \lim_{x \to 2^+} \frac{\frac{dx^2+1}{x}-\frac{4d+1}{2}}{x-2}=0$

$\frac{2dx^2+2-4dx-x}{2x}=0$ = $2dx^2-x(4d+1)+2=0$

$x_{1,2}=\frac{4d+1 \pm \sqrt{16d^2+1-8d}}{4d}$

And so, I'd say $d=\frac{1}{4}$. Is it correct? Because I have an indeterminate form and I don't think I can use de l'Hospital, as I should know in advance that the limit exists in order to do that. But otherwise the function wouldn't be differentiable.
Also, is it correct to say that b and c can have any finite value, because they "disappear"?

2. Jan 7, 2013

### Staff: Mentor

This is not necessarily true. For example, f(x) = 0, -∞ < x < 0; f(x) = 1, 0 ≤ x < ∞. The left and right derivatives are equal at x = 0, but the function's derivative doesn't exist there.

You're skipping over an important consideration - the function has to be continuous. In particular, your function needs to be continuous at x = 1 and x = 2.

3. Jan 7, 2013

### SammyS

Staff Emeritus
That's needlessly complicated.

1) The function must be continuous.

2) The derivative from the left = the derivative from the right.

For the function to be continuous at x=1:
1) $\displaystyle \ \ \lim_{x\to1^-\ }(ax+b)=\lim_{x\to1^+\ }(ax^2+c)$
i.e. $\displaystyle \ \ a(1)+b = a(1)^2+c$​

2) For x < 1, f '(x) = a .

For 1 < x < 2, f '(x) = 2ax .
So you need a = 2a(1) .​

Do similar on either side of x = 2 .

4. Jan 8, 2013

### Felafel

oh, i thought that being the differentiability a stronger condition than the continuity proving the first one was enough!
thank you!

5. Jan 8, 2013

### gopher_p

It's an issue of language, but in this case it's important. In my experience the terms left derivative and right derivative are used to indicate $f'_-(a)=\lim_{x\rightarrow a^-}\frac{f(x)-f(a)}{x-a}$ and $f'_+(a)=\lim_{x\rightarrow a^+}\frac{f(x)-f(a)}{x-a}$ respectively. So the left derivative, $f'_-(0)$ does not exist in your example.

Note that it is not necessarily the case that $\lim_{x\rightarrow a^-}f'(x)=f'_-(a)$ (and similarly for the right-hand limits). In fact, it is not even necessary for $\lim_{x\rightarrow a^-}f'(x)$ and $\lim_{x\rightarrow a^+}f'(x)$ to exist for $f$ do be differentiable at $a$ (look at $f(x)=x^2\sin\frac{1}{x}$ for $x\neq 0$ with $f(0)=0$); i.e. derivatives are not necessarily continuous. However if all of the above limits exist and the function is differentiable, then they all must be equal; so derivatives are limited in the types of discontinuities that they can have.

You are correct. If you can show that your function is differentiable, then it must automatically be continuous. The point he was trying to make is that, while some of your parameters are determined by restrictions on the left and right derivatives, you need to use continuity to determine the others, and it may be a good idea to do the continuity business first. Also, it is possible to do this problem without computing any limits directly (that's the part where you made it more complicated than it need to be).

6. Jan 8, 2013

### Felafel

great! :) thanks for being so exhaustive

7. Jan 8, 2013

### SammyS

Staff Emeritus

... or did I overlook that in some post ?

8. Jan 8, 2013

### Felafel

In 1:
$\displaystyle \lim_{x \to 1^-} ax+b=a+b$
$\displaystyle \lim_{x \to 1^+}ax^2+c=a+c$
So b=c
$f_-'(1)=a$ $f_+'(1)=2a$
So a=0

In 2:

$\displaystyle \lim_{x \to 2^-} ax^2+c=c$
$\displaystyle \lim_{x \to 2^+}\frac{dx^2+1}{x}=\frac{4d+1}{2}$
So:
$b=c=\frac{4d+1}{2}$
$f_-'(2)=4a=0$; $f_+'(2)=\frac{8d-4d-1}{4}$
So $d=\frac{1}{4}$ $\Rightarrow$ $b=c=1$

9. Jan 8, 2013

### SammyS

Staff Emeritus
Yes.

I wasn't sure that you found b & c .