solving a cubic equation by completing the cube