Answer
For $g(x)$ to be continuous at every $x$, $a$ and $b$ must have these values: $a=b=-1.5$
Work Step by Step
- For $x\lt0$: $\lim_{x\to c}g(x)=\lim_{x\to c}(ax+2b)=ac+2b=g(c)$
- For $0\lt x\lt2$: $\lim_{x\to c}g(x)=\lim_{x\to c}(x^2+3a-b)=c^2+3a-b=g(c)$
- For $x\gt2$: $\lim_{x\to c}g(x)=\lim_{x\to c}3x-5=3c-5=g(c)$
So $g(x)$ is already continuous on $(-\infty,0)\cup(0,2)\cup(2,\infty)$. We only need to examine continuities at $x=0$ and $x=2$.
1) $x=0$
Here $g(x)=ax+2b$, so $g(0)=a\times0+2b=2b$
For $g(x)$ to be continuous at $x=0$, $$\lim_{x\to0}g(x)=g(0)$$ $$\lim_{x\to0^-}g(x)=\lim_{x\to0^+}g(x)=g(0)$$ $$\lim_{x\to0^-}(ax+2b)=\lim_{x\to0^+}(x^2+3a-b)=2b$$ $$a\times0+2b=0^2+3a-b=2b$$ $$2b=3a-b=2b$$ $$3a-b=2b$$ $$3a=3b$$ $$a=b\hspace{1cm}(1)$$
2) $x=2$
Here $g(x)=x^2+3a-b$, so $g(2)=2^2+3a-b=3a-b+4$
For $g(x)$ to be continuous at $x=2$, $$\lim_{x\to2}g(x)=g(2)$$ $$\lim_{x\to2^-}g(x)=\lim_{x\to2^+}g(x)=g(2)$$ $$\lim_{x\to2^-}(x^2+3a-b)=\lim_{x\to2^+}(3x-5)=3a-b+4$$ $$2^2+3a-b=3\times2-5=3a-b+4$$ $$3a-b+4=6-5=3a-b+4$$ $$3a-b+4=1$$ $$3a-b=-3\hspace{1cm}(2)$$
Combining $(1)$ and $(2)$, we have 2 equations with 2 variables. Solving them, we come up with the following result: $a=b=-1.5$
In conclusion, for $g(x)$ to be continuous at every $x$, $a$ and $b$ must have these values: $a=b=-1.5$