Determine whether piecewise function is continuous, differentiable, has removable discontinuity or non-removable

continuityfunctions

Here is the question I have attempted to answer.

Consider the function $f:[0,5] \mapsto \mathbb{R}, where$}
$$ f(x) = \begin{cases}
x & \text{for } 0\leq x \leq 1 \\
x^2 & \text{for }1<x \leq 2 \\
-12 + 12x – 2x^2 &\text{for } 2< x \leq 3 \\
30 – x & \text{for }3<x<4\\
27&\text{for }x=4\\
26cos(\pi x ) & \text{for }4< x \leq 5
\end{cases}
$$


My answer is below. I am confident that there is much more concise way of answering the question than what I did, but I am not sure how to do it.
•At $[0,1], f(x)$ is function such that for any value, call $c_1$, on the interval $[0,1]$
$$ f'(x) = 1 $$

Function is differentiable on $[0,1]\implies$ the function is continuous on $[0,1]$.
•At $(1,2], f(x)$ is differentiable as for any value, call $c_2$, on the interval $(1,2]$
$$ f'(x) = 2c_2 $$
Function is differentiable on (1,2]$\implies$ the function is continuous on $(1,2]$.
•At $(2,3], f(x)$ is differentiable as for any value, call $c_3$, on the interval $(2,3]$
$$ f'(x) = 12 – 4c_3 $$
Function is differentiable on $(2,3]\implies$ the function is continuous on $(2,3]$.
•At $(3,4) f(x)$ is differentiable as for any value, call $c_4$, on the interval $(3,4)$
$$ f'(x) = -1 $$
Function is differentiable on $(3,4)\implies$ the function is continuous on $(3,4)]$.
•At $x=4 f(x)$ is differentiable as at $x=4$
$$f'(x)=0$$
Function is differentiable at $x=4 \implies$ the function is continuos at a point $x=4$
•At $(4,5], f(x)$ is differentiable as for any value, call $c_5$, on the interval $(4,5]$
$$f'(x)= -26\pi sin(\pi c_5)$$
Function is differentiable on $(4,5]\implies$ the function is continuous on $(4,5]$.

  • For f(x) to be continuous at [0,2], f(x) defined at [0,1], call $f_1(x)$, must be equal to f(x) defined at (1,2],call $f_2(x)$, at x =1
    $$f_1(x)=x \implies f_1(1) = 1$$
    $$f_2(x)=x^2 \implies f_2(1) = 1$$
    $$\implies f_1(1) = f_2(1)\implies f(x) \text{ is continuous at }[0,2]$$
    •For f(x) to be differentiable at [0,2], f'(x) defined at [0,1], call $f_1'(x)$, must be equal to f'(x) defined at (1,2],call $f_2'(x)$, at x =1
    $$f_1'(x)=1 \implies f_1'(1) = 1$$
    $$f_2'(x)=2x \implies f_2'(1) = 2$$
    $$\implies f_1'(1) \ne f_2'(1)\implies f(x)\text{ is not-differentiable at }[0,2]$$
    •For f(x) to be continuous at (1,3], f(x) defined at (1,2], call $f_1(x)$, must be equal to f(x) defined at (2,3],call $f_2(x)$, at x =2
    $$f_1(x)=x^2 \implies f_1(2) = 4$$
    $$f_2(x)=-12 + 12x – 2x^2 \implies f_2(2) = 4$$
    $$\implies f_1(2) = f_2(2)\implies f(x) \text{ is continuous at }(1,3]$$
    •For f(x) to be differentiable at (1,3], f'(x) defined at (1,2], call $f_1'(x)$, must be equal to f'(x) defined at (2,3],call $f_2'(x)$, at x =2
    $$f_1'(x)=2x \implies f_1'(2) = 4$$
    $$f_2'(x)=12-4x \implies f_2'(2) = 4$$
    $$\implies f_1'(1) = f_2'(1)\implies f(x)\text{ is differentiable at }(1,3]$$
    •For f(x) to be continuous at (2,4), f(x) defined at (2,3], call $f_1(x)$, must be equal to f(x) defined at (3,4),call $f_2(x)$, at x =3
    $$f_1(x)=-12 + 12x – 2x^2 \implies f_1(3) = 6$$
    $$f_2(x)=30-x \implies f_2(3) = 27$$
    $$\implies f_1(2) \ne f_2(2)\implies f(x) \text{ is not continuous at }(2,4)$$
    • As $f(x) \text{ is continuous }\implies f(x) \text{ is differentiable } $. f(x) is not differentiable at (2,4)
    $$\text{Is the discontinuity removable?}$$
    $$\lim_{x\to3^-} f(x) = \lim_{x\to3^+} f(x) \iff \text{ removable discontinuity}$$
    $$\lim_{x\to3^-} f(x) = 6$$
    $$\lim_{x\to3^+} f(x) = 27$$
    $$\lim_{x\to3^-} f(x) \ne \lim_{x\to3^+} f(x) \implies \text{f(x) has non-removable discontinuity at (2, 4)}$$
    •For f(x) to be continuous at (3,4], f(x) defined at (3,4), call $f_1(x)$, must be equal to f(x) defined at x=4,call $f_2(x)$, at x =4
    $$f_1(x)=30-x \implies f_1(4) = 26$$
    $$f_2(x)=27\implies f_2(4) = 27$$
    $$\implies f_1(4) \ne f_2(4)\implies f(x) \text{ is not continuous at }(1,3]$$
    • As $f(x) \text{ is continuous }\iff f(x) \text{ is differentiable } $. f(x) is not differentiable at (3,4]
    $$\text{Is the discontinuity removable?}$$
    Since the function is discontinuous at a point, the discontinuity is removable by redefining a function. If f(x) is redefined to f(x)=26 at x=4, then continuity would be removed, as then
    $$f_1(4) = f_2(4) = 26$$
    •For f(x) to be continuous at (3,5], f(x) defined at (3,4], call $f_1(x)$, must be equal to f(x) defined at (4,5],call $f_2(x)$, at x = 4
    $$f_1(x)=30-x \implies f_1(4) = 26 \text{ (here I assume that we have redefined the f(x) in the step above)}$$
    $$f_2(x)= 26cos(\pi x) \implies f_2(4) = 26$$
    $$\implies f_1(4) = f_2(4)\implies f(x) \text{ is continuous at }[4,5]$$
    •For f(x) to be differentiable at (3,5], f'(x) defined at (3,4], call $f_1'(x)$, must be equal to f'(x) defined at (4,5],call $f_2'(x)$, at x =4
    $$f_1'(x)=-1 \implies f_1'(4) = -1$$
    $$f_2'(x)=-26\pi sin(\pi x) \implies f_2'(4) = 0 $$
    $$\implies f_1'(4) \ne f_2'(4)\implies f(x)\text{ is not-differentiable at }(3,5]$$

Best Answer

Each of the 6 function "pieces" is continuous and differentiable on $\mathbb{R}$ (all polynomials or cos). You have one function piece for each one of the open intervals $[0,1), (1,2),(2,3),(3,4),(4,5]$, so $f$ is continuous and differentiable on all these intervals. (Note that $[0,1)$ and $(4,5]$ are open intervals when considered as subsets of the domain $[0,5]$ of $f$). So you only need to check for continuity and differentiability at the endpoints $x=1,2,3,4$. At each of these endpoints, the left and right-hand limits for $f$ exist, so just check if both coincide with the value of $f$ at the point for $f$ to be continuous. At the endpoints, the left and right-hand derivatives of $f$ also exist, so you only need to check if left and right-hand values coincide. For example, at $x=1$, the limiting values of $x$ and $x^2$ are both 1 and $f(1)=1$, so $f$ is continuous. The left and right hand derivatives are $1$ and $2$, respectively, so $f'$ does not exist at $x=1$.

Related Question