Derivation of a wave equation for pulse propagation beyond a slowly varying envelope approximation