two equations to determine the speed of a wave