Question: Finding a and b such that f'(1) is defined

Today, I was working on a problem in the class which said:

if f(x)=ax^2+b, x<=1 and 1/x, x>1; then find the values of "a" and "b" such that f'(1) be defined. I checked it to be continuous at x=1 first and so I got a+b=1. Secondly, I wanted to get another equation, so I checked the differentiability of the function by the definition of derivation at x=1, so:

[> f := x-> piecewise(x <= 1, a*x^2+b, 1 < x, 1/x);
> limit((f(x)-f(1))/(x-1), x = 1, right);

                  -signum(-1 + a + b) infinity

> limit((f(x)-f(1))/(x-1), x = 1, left);


As you see, the second code does not give me a suitable result to get the second equation. Am I missing something here? Thanks for your help.



Please Wait...