Solves the wave equation (homework)