Home » Blog » Find a constant such that a given piecewise function is continuous everywhere

Find a constant such that a given piecewise function is continuous everywhere

Given constants a,b,c \in \mathbb{R} define:

    \[ f(x) =  \begin{cases}  2 \cos x & \text{if } x \leq c, \\  ax^2 + b & \text{if } x > c. \end{cases} \]

If b,c are fixed find all values of a such that f is continuous at x = c.


By the definition of continuity, we know that f continuous at x = c means that f(c) is defined and \lim_{x \to c} f(x) = f(c). Since 2 \cos x and ax^2 + b are defined for all x \in \mathbb{R}, we know that f is defined for every c \in \mathbb{R}. Then, to show that it is continuous we must show

    \[ \lim_{x \to c} f(x) = f(c). \]

From the definition of f we know

    \[ f(c) = 2 \cos c. \]

Then, taking the limit as x approaches c from the right (since \lim_{x \to c^-} f(x) = f(c) since 2 \cos x is continuous and f(x) = 2 \cos x as x approaches c from the left),

    \[ \lim_{x \to c^+} f(x) = \lim_{x \to c^+} ax^2 + b = ac^2 + b. \]

So, we must have

    \[ ac^2 + b = 2 \cos c \quad \implies \quad a = \frac{2 \cos c - b}{c^2} \quad \text{if } c \neq 0. \]

If c = 0 then,

    \[ ac^2 + b = 2 \cos c \quad \implies \quad b= 2 \quad \text{and } a \text{ is arbitrary}. \]

Point out an error, ask a question, offer an alternative solution (to use Latex type [latexpage] at the top of your comment):