A control apparatus for a rotary electric machine extracts, based on a rotational speed of a rotating member, a vibration component included in the rotational speed of the rotating member, the vibration component being based on vibrations of a drivetrain. The control apparatus calculates, according to the extracted vibration component, compensation torque for compensating the vibrations of the drivetrain. The control apparatus performs drive control of the rotary electric machine according to the compensation torque. The control apparatus performs suppression to suppress the rotational speed of the rotating member from changing due to change of a speed change ratio.