OSH/Example/2
From UBCMATH WIKI
Example problem statement
For what value of $a$ is the function $f(x)$ continuous at all points, where $f(x)$ is the following piecewise function $$ f(x) = \left\{ \begin{array}{ll} x^2+ax & \quad x < 1 \\ 4-x & \quad x \geq 1 \end{array} \right. $$
Solution
As the component parts of $f$ are continuous on their own, the only potential discontinuity is at $x=1$. Calculating the limit from the left, $$\lim_{x\to 1^-}f(x) = \lim_{x\to 1^-}x^2+ax = 1+a.$$ And from the right, $$\lim_{x\to 1^+}f(x) = \lim_{x\to 1^+}4-x = 3.$$ For $f$ to be continuous, we require that $1+a=3$ or that $a=2.$