Continuity

The function $f\left(x\right)$ is defined as

$f\left(x\right)= \begin{cases} x^2 + ax + b, & 0 \leq x < 2 \\ & \\ 3 x + 2, & 2 \leq x \leq 4 \\ & \\ 2 a x + 5 b, & 4 < x \leq 8 \end{cases}$

is continuous in $\left[0,8\right]$. Find the values of a and b.


Since $f\left(x\right)$ is continuous in $\left[0,8\right]$, therefore $f\left(x\right)$ must be continuous at 2 and 4.

$\therefore$ $f\left(2\right)= \lim\limits_{x \to 2^-} f\left(x\right) = \lim\limits_{x \to 2^+} f\left(x\right)$ $\cdots$ (1)

and $f\left(4\right) = \lim\limits_{x \to 4^-}f\left(x\right)= \lim\limits_{x \to 4^+}f\left(x\right)$ $\cdots$ (2)

$\therefore$ From equation (1) we have

$\left(3\times2\right)+2 = \lim\limits_{x \to 2^-} \; x^2+ax+b = \lim\limits_{x \to 2^+} \; 3x+2$

i.e. $8=4+2a+b=8$

i.e. $2a+b=4$ $\cdots$ (3)

From equation (2) we have

$\left(3 \times 4\right)+2 = \lim\limits_{x \to 4^-} \; 3x+2 = \lim\limits_{x \to 4^+} \; 2ax+5b$

i.e. $14=14=8a+5b$

i.e. $8a+5b=14$ $\cdots$ (4)

Multiplying equation (3) with 5 and subtracting from equation (4) gives

$2a=6$ $\implies$ $a=3$

$\therefore$ From equation (3), $b=4-\left(2\times 3\right)=-2$