Continuous function of class $C^2$ that consists of cases $0$ if $x\geq 0$, positive if $x<0$

74 Views Asked by At

question

I am trying to understand the concept of continuity better and for that I wonder, if the following function

$$ f(x) = \begin{cases} 0 &\text{if } x \geq 0\\ x^2 &\text{if } x < 0 \end{cases} $$

continuous and its derivatives continuous in two levels or more such that it is a function of class $C^2$?

context

Someone reasoned that $f(x^2)=0 \Rightarrow f(t)=0$ to eliminate a term in an expression, but it seems to me that it isn't necessarily true if $t < 0$ because of cases like the function I am asking about. The function has to be of class $C^2$, however, so the function $f$ might not be contradicting the reasoning if $f$ isn't of class $C^2$.

1

There are 1 best solutions below

0
On BEST ANSWER

It's certainly continuously differentiable (i.e. $C^1$), but it isn't $C^2$. To see this first compute the derivative. For $x_0 > 0$, the function is constant around $x_0$, and hence has a derivative of $0$. For $x_0 < 0$, the function is equal to $x^2$ around $x_0$, so the derivative is $2x_0$. The only case left to check is $x = 0$.

We have \begin{align*} f'(0) &= \lim_{h \to 0} \frac{f(h) - f(0)}{h} = \lim_{h \to 0} \frac{f(h)}{h} \\ &= \lim_{h\to 0} \begin{cases} 0 & \text{if } h \ge 0 \\ h & \text{if } h < 0 \end{cases}. \end{align*} Thus clearly we have $\lim_{h\to 0^+} \frac{f(h)}{h} = \lim_{h\to 0^-} \frac{f(h)}{h} = 0$, so $f'(0) = 0$. Hence, $$f'(x) = \begin{cases} 0 & \text{if } x \ge 0 \\ 2x & \text{if } x < 0 \end{cases}.$$ Such a function could only be discontinuous at $0$, but the left and right limits both agree with the function value, so it's continuous.

It is not, however, differentiable at $0$. Note that \begin{align*} f''(0) &= \lim_{h \to 0} \frac{f'(h) - f'(0)}{h} = \lim_{h \to 0} \frac{f'(h)}{h} \\ &= \lim_{h\to 0} \begin{cases} 0 & \text{if } h \ge 0 \\ 2 & \text{if } h < 0 \end{cases}. \end{align*} Clearly, in this case, the left and right limits are $2$ and $0$ respectively. Hence the limit (and the second derivative at $0$) doesn't exist.