solve BVP