Guess you have a function $f(x) : \mathbb{R} \rightarrow \mathbb{R}$ (or a subset of $\mathbb{R}$) with $f (x) := \begin{cases} x^3 & \text{if } x \geq 0 \\ x^2 & \text{otherwise} \end{cases} $.
The derivative $f': \mathbb{R} \rightarrow \mathbb{R}$ of $f(x)$ is $f' (x) := \begin{cases} 3 \cdot x^2 & \text{if } x \geq 0 \\ 2 \cdot x & \text{otherwise} \end{cases}$.
To get this derivative I could simply differentiate the first part and the second part.
Can you calculate the derivative of every piecewise defined function this way?
I recently saw Thomae's function:
$f(x)=\begin{cases} \frac{1}{q} &\text{ if } x=\frac{p}{q}\mbox{ is a rational number}\\ 0 &\text{ if } x \mbox{ is irrational}. \end{cases}$
I thought there might be a differentiable function which is defined like that and which can't be derived simply by deriving it piece by piece.