Differentiating piecewise functions.
Solution 1
You see how the function jumps at $x=4$? It isn't even continuous, so it makes no sense to talk about it being differentiable there. $f'(4)$ is simply indeterminate, though $f'(x)$ is perfectly easy to define on $\{x:x\in \mathbb{R}\setminus \{4\}x>0\}$.
Solution 2
Note that $\displaystyle \lim_{x\to 4^}(f(x))=\lim_{x\to 4^}(x^2)=16$ while $\displaystyle\lim_{x\to 4^+}(f(x))=f(4)=5.$ Therefore $f$ isn't continuous on $x=4$ and so it can't be differentiable there. Hence the domain of the derivative doesn't include $4$.
Around $0$ the left lateral derivative isn't even defined, therefore $f$ can't be differentiable there.
Since $f$ is clearly differentiable on the interior of its domain, it follows that the domain of $f'$ is the interior of $f$'s domain, that is $\textbf{]}0,4[\cup \textbf{]}4+\infty[=\textbf{]}0,+\infty[\setminus \{4\}$.
Related videos on Youtube
Mack
Updated on August 01, 2022Comments

Mack 7 months
Say we have the piecewise function $f(x) = x^2$ on the interval $0 \le x < 4$; and it equals $x+1$ on the interval $ x \ge 4$. Why is it that, when I take the derivative, the intervals loose their equality and become strictly greater or strictly less than?

Git Gud almost 10 yearsYou mean the domain of the derivative?

Mack almost 10 yearsWell, the domain is expressed using intervals, so yes.

JavaMan almost 10 yearsDraw the function $f(x)$. What would it mean for the function to have a derivative at $x = 0$ or $x = 4$? Do you see why it can't be differentiabe there?

JavaMan almost 10 yearsThe answers below point out that the function is not continuous at $x = 4$, and so $f(x)$ can't be differentiable there. So let's let $g(x) = x^2$ for $0 \leq x < 4$ and $12 + x$ for $x \geq 4$. The function $g(x)$ is now continuous at $x = 4$, but it is still not differentiable there. Do you see why?


Git Gud almost 10 yearsWe have conflicting answers regarding the differentiability at $x=0$.

Alexander Gruber almost 10 years@GitGud Right  yes, I misread the question and assumed $f(x)=x^2$ for $x<4$.

Git Gud almost 10 yearsI got you over $10$k rep ^ ^. Congrats.

Alexander Gruber almost 10 years@GitGud Thanks! Historical.