> 
> How to solve the following ODE? $$y' = | y-t |$$
> 
> 
> 

To eliminate the absolute value, I divided the domain into two parts $\{ y(t) > t \}$ and $\{ y(t) < t \}$.

* In $\{y(t)>t\}$, the ODE becomes $y'=y-t$. I found $y\_+(t)=Ce^t+t+1$.
* In $\{y(t)<t\}$, the ODE becomes $y'=-y+t$, so the solution is $y\_-(t)=Ce^{-t}+t-1$.

How to write the general solution?