A fourth-order solution of the ideal resonance problem