Finding all values of a and b which make this piecewise function continuous

calculuslimitspiecewise-continuity

Find all values of a and b that make this piecewise function continuous.

$$f(x)=\begin{cases}
(x – π)^2-1&\text{if }x < π\\
b &\text{if } x= π\\
2\cos(x)+a &\text{if } x > π\end{cases}$$

I tried making the first two expressions equal to one another and then finally the second expression equal to the last expression. I substituted $π$ into x for all expressions to find a and b.

Is this the right approach? If not please correct me as I don't understand the ins and outs of piecewise functions that well yet.

First pair of expressions:

$(π – π)^2-1 = b$

$b = -1$

Second pair of expressions:

$b =2\cos(π)+a $

$-1 = 2\cos(π)+a $

$-1 = -2 +a$

$a = 1 $

The values of a and b that make $f(x)$ continuous are $a = 1$ and $b=-1$.

Best Answer

It looks good, but I prefer a solution in more details:

We have $ \lim_{x \to \pi -0}f(x)=-1, f(\pi)=b$ and $ \lim_{x \to \pi +0}f(x)=-2+a.$

Hence $f$ is continuous on $ \mathbb R \iff f$ is continuous in $ \pi \iff -1=b=-2+a.$

Related Question