Using boundary conditions to solve differential equations