Exact solutions for conservative systems and applications to Quadratic–Cubic–Quartic–Quintic nonlinear oscillators