A drive system for a vehicle, the drive system comprising a combustion engine with an output shaft, a gearbox with an input shaft, an electrical machine comprising a stator and a rotor, and a planetary gear, which comprises three components in the form of a sun wheel, a ring gear and a planetary wheel carrier, wherein the output shaft of the combustion engine is connected with a first of said components in the planetary gear, so that a rotation of this shaft leads to a rotation of such first of said components, wherein the input shaft of the gearbox is connected with a second of said components in the planetary gear, so that a rotation of such shaft leads to a rotation of such second of said components, and wherein the rotor electrical machine is connected with a third of said components in the planetary gear, so that a rotation of the rotor leads to a rotation of such third of said components, and wherein the drive system also comprises a first locking means, which may be moved between a locked position in which two of said components are locked together, so that the three components rotate with the same rotational speed, and a release position in which the components are allowed to rotate at different rotational speeds, wherein the drive system comprises a second locking means, which may be moved between a locked position in which the output shaft of the combustion engine is locked together with said first of said components, and a release position, in which the combustion engine's output shaft is disconnected from said first of said components and allowed to rotate independently of said first of said components, and a control device adapted to receive information about a requested torque for the operation of the vehicle, at least a first operating parameter of the combustion engine and at least one second operating parameter of the electrical machine, to control the second locking means, so that it is kept in its locked position if the first locking means is in its release position, to determine whether the available torque from the combustion engine and the electrical machine is sufficient to achieve the requested torque with the planetary gear in the release position, and to determine the vehicle's fuel consumption with the planetary gear in a release position and in the locked position, respectively, based on the first and the second operating parameters, wherein the control device is also adapted to, if the torque from the combustion engine and the electrical machine is sufficient for the operation of the vehicle with the planetary gear in the release position, and if the vehicle's fuel consumption with the planetary gear in the release position is lower than in the locked position, set or keep the planetary gear in the release position, and control the electrical machine and the combustion engine in such a way that the requested torque is provided, while the planetary gear is in the release position, and while maintaining the combustion engine's engine speed.