# Find a real number such that the piecewise function is continuous

I am reasoning about this problem. The text asks to find a real number $a$ such that the piecewise function $$f(x) = \begin{cases} 3x+2 \;\;\;\; x < 2 \\ x^2+a \;\;\;\; x\geq 2 \end{cases}$$ is continuous. It gives the hint to compute the left hand and right hand limits.

May I solve this exercise simply by applying a limit property, namely: in order for the total function to be continuous the limit of the sum of the functions has to equal the limits of the individual functions? Thus, $$\lim_{x \rightarrow 2 } 3x +2 = \lim_{ x \rightarrow 2} x^2 + a = f(2) = 8$$ Thus, $a = 4$ ?

• That's it, except you should precise left and right limit : $\lim_{x \rightarrow 2^-} 3x+2 = \lim_{x \rightarrow 2^+} x^2 + a$ – sapristi Nov 13 '15 at 8:06
• you are right, but let me write this formally $$\lim_{x \rightarrow 2^-} f(x)= \lim_{x \rightarrow 2^+} f(x)$$ and so $$8=4+a$$ so that $a=4$. – Nizar Nov 13 '15 at 8:06
• Could one of you two post an answer to upvote/accept. please, so that this question is removed from the unanswered list? – A.P. Nov 13 '15 at 8:57

You are right, but let me write it formmaly. To ensure the continuity of $f$, you should have $$\lim_{x \rightarrow 2^-} f(x)= \lim_{x \rightarrow 2^+} f(x)$$ i.e. $$\lim_{x \rightarrow 2^-} 3x+2= \lim_{x \rightarrow 2^+} x^2+a$$ and so $$8=4+a$$ Thus $a=4$.