This question was inspired by the solution to this problem: Piecewise linear function and absolute value.
Question: Suppose you have the real-valued piecewise function:
\begin{equation*} f(x) = \begin{cases} f_1(x), & \text{if } x < a \\ f_2(x), & \text{if } x \geq a \end{cases}, \end{equation*} where $f_1$ is continuous and differentiable on the left side of $a$ and $f_2$ is continuous and differentiable on the right side of $a$. Is there a systematic way to write $f(x)$ without making it piecewise? I suspect the answer will have something like the form:
$f(x)=f_1(x) \space + \space $(something involving $f_1'$ and $f_2'$) $ \space \cdot \space$ (some mix of $f_1$ and $f_2$ along with $a$ involving absolute values),
but the only reason I suspect this is because of the special case where the $f_i$s are linear.
Note: The case where $f$ is continuous and piecewise-linear is straightforward:
\begin{equation*} f(x) = \begin{cases} \alpha_1 x+\beta_1, & \text{if } x < a \\ \alpha_2 x+\beta_2, & \text{if } x \geq a \end{cases}, \end{equation*}
\begin{equation} = (\alpha_1 x+\beta_1)+\frac{\alpha_2-\alpha_1}{2}\cdot(|x-a|+x-a) \end{equation}
which can be reasoned to graphically and algebraically through examples, but I don't see how to generalize it from there.