ODE system of 2nd order We have $$x''+bx=-a \quad \text{if} \: x'>0$$ and $$x''+bx=a \quad \text{if} \: x'<0.$$ 
With $b>0$ and $x(0)=0$ , Does this system have a solution?
 A: Physics helps here: these are equations of motion of harmonic oscillator with the constant force of dry (sliding) friction applied to it. Such oscillator moves "somehow" so there is a solution for sure. It's just not easy to come up with it.
WLOG, suppose that $\dot x_0$ is positive (the reasoning is similar for the opposite sign).
For positive $b$ the solution of the first differential equation is:
$$x(t)=C_1\cos \sqrt{b}t+C_2\sin \sqrt{b}t-\frac{a}{b}$$
$$\dot x_0=\dot x_1(0)=C_2\sqrt{b}\implies C_2=\frac{\dot x_0}{\sqrt{b}}$$
$$x_0=0=C_1-\frac{a}{b}\implies C_1=\frac{a}{b}$$
So the solution for $x(t)$ is:
$$x(t)=\frac{a}{b}\cos \sqrt{b}t+\frac{\dot x_0}{\sqrt{b}}\sin \sqrt{b}t-\frac{a}{b}$$
$$\dot x(t)=-\frac{a}{\sqrt b} \sin \sqrt{b}t+\dot x_0\cos \sqrt{b}t$$
However the solution is valid as long as $\dot x$ is positive. At some point of time $\dot x(t_1)=0:$
$$\dot x(t_1)=-\frac{a}{\sqrt{b}} \sin \sqrt{b}t_1+\dot x_0\cos \sqrt{b}t_1=0$$
So the motion stops when:
$$\tan \sqrt{b}t_1=\frac{\dot x_0 \sqrt {b}}{a} $$
The point is: you can calculate $t_1$ and therefore you can calculate the position at that point of time $x_1=x(t_1)$. You already know that $\dot x_1=\dot x(t_1)=0$.
Note that $x_1$ must be positive (initial conditions were $x_0=0$ and $\dot x_0>0)$. You have reached the right-most value of $x$. But what happens after $t_1$? Intuition says that you should apply the second differential equation but why? At that point of time velocity is zero and $x$ will change only if there is some acceleration $\ddot x$. 
Calculate the acceleration that would apply if $\dot x$ is supposed to be negative:
$$\ddot x_1=a-bx_1$$
Suppose that the calculated value is positive. With $\dot x_1=0$ it would mean that the value of $x$ would start to increase which leads to $\dot x>0$ which contradicts the assumption that $\dot x$ is supposed to be negative. In this case, the motion stops, the value of $x$ remains constant after $t_1$.
If the calculated value of $\ddot x_1$ is negative, all is well and you should now proceed with the second differential equation:
$$\ddot x + b x = a$$
...which has the solution:
$$x(t)=C_3\cos \sqrt{b}t+C_4\sin \sqrt{b}t+\frac{a}{b}$$
...and the following initial conditions:
$$x(t_1)=x_1, \quad \dot x(t_1)=0$$
So you are clearly able to determine constants $C_3$ and $C_4$. Now you have to find the point in time $t_2$ where the motion to the left stops, i.e. $\dot x(t_2)=\dot x_2=0$. With $t_2$ calculated you also get $x(t_2)=x_2$.
Now you have to apply the tricky reasoning once again. Will the motion stop at $t_2$ or the $x$ coordinate will start to increase again? Look into the first differential equation and check if $\ddot x(t_2)$ is positive. If yes, it's time to solve the first differential equation again...
...until the motion stops :) And it will stop at some point $x(t_n)=x_n\ne0$
