Method for shifting from a first gear to a second gear in a dual clutch transmission during vehicle acceleration or retardation, the dual clutch transmission comprising: a first gear which is engaged and active such that torque is transmitted between an engine and driven wheels there through, the first gear being disconnectable from the engine by a first friction clutch, the first friction clutch being closed, a second gear to be engaged, which is disengaged and inactive such that no torque is transmitted between the engine and the driven wheels there through, the second gear being disconnectable from the engine by a second friction clutch, the second friction clutch being open, an electric motor drivingly connected to a shaft of the one of the first gear or the second gear which is inactive, the method being characterized in that it comprises the steps of: - engaging the second gear to become an engaged inactive gear, - essentially simultaneously opening the first friction clutch and closing the second friction clutch such that engine torque is transmitted to the driven wheels through the second gear, thereby the first gear becomes engaged and inactive and the second gear becomes engaged and active, - controlling the electric motor to provide a compensational torque for temporarily decreasing or substantially eliminating torque transferred by a tooth clutch of the inactive gear, - disengaging the first gear by disengaging the tooth clutch such that the first gear thereby becomes disengaged and inactive. a first gear which is engaged and active such that torque is transmitted between an engine and driven wheels there through, the first gear being disconnectable from the engine by a first friction clutch, the first friction clutch being closed, a second gear to be engaged, which is disengaged and inactive such that no torque is transmitted between the engine and the driven wheels there through, the second gear being disconnectable from the engine by a second friction clutch, the second friction clutch being open, an electric motor drivingly connected to a shaft of the one of the first gear or the second gear which is inactive, the method being characterized in that it comprises the steps of: - engaging the second gear to become an engaged inactive gear, - essentially simultaneously opening the first friction clutch and closing the second friction clutch such that engine torque is transmitted to the driven wheels through the second gear, thereby the first gear becomes engaged and inactive and the second gear becomes engaged and active, - controlling the electric motor to provide a compensational torque for temporarily decreasing or substantially eliminating torque transferred by a tooth clutch of the inactive gear, - disengaging the first gear by disengaging the tooth clutch such that the first gear thereby becomes disengaged and inactive. - engaging the second gear to become an engaged inactive gear, - essentially simultaneously opening the first friction clutch and closing the second friction clutch such that engine torque is transmitted to the driven wheels through the second gear, thereby the first gear becomes engaged and inactive and the second gear becomes engaged and active, - controlling the electric motor to provide a compensational torque for temporarily decreasing or substantially eliminating torque transferred by a tooth clutch of the inactive gear, - disengaging the first gear by disengaging the tooth clutch such that the first gear thereby becomes disengaged and inactive.