A gearbox having an input shaft (8) and an output shaft (20); a first epicyclic gear (10) connected to the input shaft (8); a second epicyclic gear (12) connected to the first epicyclic gear (10); a first electrical
machine (14) connected to the first epicyclic gear (10); a second electrical
machine (16) connected to the second epicyclic gear (12); a first main shaft (34) connected to the first epicyclic gear (10); a second main shaft (36) connected to the second epicyclic gear (12). A first
coupling unit (56) disengagingly connects two rotatable components (22, 26, 50) at the first epicyclic gear (10), and a second
coupling unit (58) disengagingly connects two rotatable components (28, 32, 51) at the second epicyclic gear (12), such that at least one of the rate of revolution and the torque at the first and the second main shafts (34, 36) can be influenced by controlling at least one of the first and the second
coupling units (56, 58) to a condition of the rotatable components (22, 26, 50; 28, 32, 51) that is engaged or disengaged. Also a vehicle (1) having such a gearbox (2), a method to control such a gearbox (2), a
computer program (P) to control a gearbox, and a
computer program product comprising
program code for an
electronic control unit (48) or another computer (53) in order to implement the method.