Finding the values of A and B in a continuous function Consider the piecewise-define function $f(x)=2x^2+5$ if $x < -1$, $f(x)$=$Ax+B$ if $-1\le x\le 2$ 
and $f(x)=8x$ if $x\ge 2$.  Given that $f$ is continuous everywhere, determine the values of $A$ and $B$. Then find $f(1)$.
I'm a little confuse on continuity. If anyone can help me out I would be very grateful.
 A: $$
\lim_{x\rightarrow -1^+}f(x)=\lim_{x\rightarrow -1^+} Ax+B=B-A
$$
$$
\lim_{x\rightarrow -1^-}f(x)=\lim_{x\rightarrow -1^-} 2x^2+5=7
$$
Since $f$ is continuous, above limits are equals. So $B-A=7$.
Doing the same in $x=2$ you will obtain another equation for $A$ and $B$.
A: We know each piece of the function is individually continuous, so $f$ is continuous on $\mathbb{R} \setminus \{-1,2\}$.  Thus, to ensure that $f$ is continuous everywhere, we need to choose $A$ and $B$ such that the function $f$ is also continuous at the points $-1$ and $2$.
Formally, we require $$\lim_{x \rightarrow -1} f(x)=f(-1)$$ and $$\lim_{x \rightarrow 2} f(x)=f(2).$$
These are satisfied when $$\lim_{x \rightarrow -1; x \geq -1} Ax+B=\lim_{x \rightarrow -1;x<-1} 2x^2+5=7$$ and $$\lim_{x \rightarrow 2; x \leq 2} Ax+B=\lim_{x \rightarrow 2; x>2} 8x=16.$$
These are satisfied if $Ax+B=2x^2+5$ when $x=-1$ and $Ax+B=8x$ when $x=2$.
A: This function does something to the left of $x=-1$, and something else to the right of $x=2$, but these "somethings" aren't important (for this particular question).
What's important is that, since the function is continuous, $$\lim_{x\rightarrow -1^-}f(x) = f(-1)$$
And this equals $7$, by calculation of $2(-1)^2 + 5$.
So you have a line going through $(-1, 7)$ and ... 
