Given: f(x)={ax, x<1ax2+bx+2, x≥1
The function f(x) is differentiable, then it is continuous and differentiable at x=1.
Applying condition of continuity
L.H.L.=R.H.L.⇒a=a+b+2⇒b=−2
Now using differentiability condition at x=1
f′(x)={a , x<12ax+b , x>1L.H.D.=R.H.D.⇒a=2a+b⇒a=−b=2∴a−b=4