# Derivative of a function defined by conditionals

The question is:

Which values $a$ and $b$ can assume to be possible to derive the function $f$ at $x = 1$

$f(x) = \left\{ \begin{array}{rl} x^2 &\mbox{$x < 1$} \\ ax + b &\mbox{$x \geq 1$} \end{array} \right.$

Here is my progress

The one way i can wonder to solve this is using the definition of derivatives. So i started by verifying the following limit

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

And then i verify the limit by the left side

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

From this point i can't go ahead.

-
You're almost there! If $a+b=1$, then your left limit is... If $a+b\neq 1$, then... –  1015 Jan 25 '13 at 19:24

Very roughly: you want $f$ continuous and differentiable at $x=1$. Continuity means setting the two expressions equal to each other (why?):

$$1^2 = a(1) + b$$

differentiability means matching the value of the derivative of each expression at $x=1$; that is

$$2 (1) = a$$

-

I guess i found the answer

If the function is differentiable, then it's continuous. So, let's verify if it's continuos

To be continuos it must satisfy the following conditions
- the limit must exists when $x$ tends to $a$
- $f(a)$ must be equal to the limit when $x$ tends to $a$

So, lets begin

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

So, we need the equality $\lim_{x \to 1^{-}} f(x) = \lim_{x \to 1^{+}} f(x) = f(1)$ to be true. We get $a + b = 1$

Verifying if the function is differentiable

$$\lim_{x \to 1^{-}} \frac{f(x) - f(1)}{x - 1}$$ We have $f(1) = a + b = 1$ , so

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

Now the limit by the right side

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

As we need this limits to be equal, so $a = 2$

We had the condition $a + b = 1$, and $a = 2$, so we can substitute $2$ in $a$, then $2 + b = 1 \leftrightarrow b = 1 - 2 \leftrightarrow b = -1$

Finally we have that if $a = 2$ and $b = -1$ the function $f$ is differentiable at $x = 1$

-