If the function $f(x)=\left\{\begin{array}{cc}a x^{2}-b, & 0 \leq x<1 \\ 2, & x=1 \\ x+1, & 1<x \leq 2\end{array}\right.$ is continuous at $x=1$, then $a-b=$________________
The function $f(x)=\left\{\begin{array}{cc}a x^{2}-b, & 0 \leq x<1 \\ 2, & x=1 \\ x+1, & 1<x \leq 2\end{array}\right.$ is continuous at $x=1$.
$\therefore f(1)=\lim _{x \rightarrow 1} f(x)$
$\Rightarrow f(1)=\lim _{x \rightarrow 1^{-}} f(x)=\lim _{x \rightarrow 1^{+}} f(x)$ …..(1)
Now,
$f(1)=2$ ….(2)
$\lim _{x \rightarrow 1^{-}} f(x)=\lim _{x \rightarrow 1}\left(a x^{2}-b\right)=a \times(1)^{2}-b=a-b$ ….(3)
$\lim _{x \rightarrow 1^{+}} f(x)=\lim _{x \rightarrow 1}(x+1)=1+1=2$ …..(4)
From (1), (2), (3) and (4), we have
$2=a-b=2$
$\therefore a-b=2$
Thus, the value of $a-b$ is 2 .
If the function $f(x)=\left\{\begin{array}{cc}a x^{2}-b, & 0 \leq x<1 \\ 2, & x=1 \\ x+1, & 1<x \leq 2\end{array}\right.$ is continuous at $x=1$, then $a-b=$ ____2____.