Solve the equation three times: one in each of the regions singled out by the definition of $Q(x)$. There will be six constants of integration (three second-order differential equations) and you will want to enforce continuity of $u(x)$ and $u'(x)$, as well as the given boundary conditions.