Let $u: I \to \mathbb{R}, v: J \to \mathbb{R}$ be differentiable functions on the intervals $I$ resp. $J$. Suppose that $\operatorname{int}(I \cap J) \neq \emptyset$ and that $u$ and $v$ are equal on $I \cap J$. Define the function $$w: I \cup J \to \mathbb{R}: x \mapsto \begin{cases} u(x) , x \in I \\v(x), x \in J\end{cases}$$
Show that $w$ is differentiable on $I \cup J$
My attempt:
I figured out it is sufficient to show that $u_-'(x) = v_+'(x)$ for $x \in I \cap J$. However, I have trouble formally proving this. I will definitely need thatthe inerior of the intersection is non empty, otherwise I can find counterexamples where the intersection is a singelton.
As interior of intersection $=$ intersection of interiors, you can suppose $I,J$ both open. Differentiability is a local property, so is enough that $w$ will be $=$ to a differentiable function in a nhood of any point of the domain.