According to the meaning of the question, the cubic equation has only two real roots, so the image of the cubic function at the extreme point must be tangent to the X axis, so the derivative function is 0, as shown in the figure below.
The relationship between the real root and the extreme value of cubic function in other cases can also be obtained.
(1) extreme one positive and one negative, three real roots.
② One extreme value is 0, the other is not 0, and there are two real roots.
③ The machine values are all positive or negative, and there are 1 real roots.
④ Infinite point, 1 real root.