Electric machine (1, 200, 300) comprising - a stator (2, 201), - a rotor (4, 202), which, during operation of the electric machine (1, 200, 300), interacts magnetically with the stator (2, 201), - a first bearing device (8, 208), - a second bearing device (81, 281) and - a shaft (5, 25, 35), which, in the first bearing device (8, 208) and the second bearing device (81, 281), is mounted rotatably about an axis of rotation of the shaft (5, 25, 35), - wherein in an axial direction of the axis of rotation the shaft (5, 25, 35) has a first segment (301, 2301, 3301) with a first material and a second segment (302, 2301) with a second material which follow one another consecutively, - wherein the rotor (4, 202) is fastened to the first segment (301, 2301, 3301) of the shaft (5, 25, 35), - wherein the second material is an iron material, characterised in that - the first material is AlZn5,5MgCU, - the first segment is formed by a pipe prefabricated as an extrusion press profile, - the first segment has an axial borehole for transporting heat between the first material and a first end of the shaft, - wherein the first material and the second material are connected with a material bond and homogenously at a joint (9, 209, 309) of the first segment (301, 2301, 3301) and the second segment (302, 2302) by means of an orbital friction welding, - wherein the electric machine (1, 200, 300) has an inflow element, which extends into the axial borehole so that a coolant, in particular a cooling liquid, can flow out of the inflow element into the axial borehole, - wherein the inflow element 7 is an inlet pipe, which is fastened in a carrier, - wherein the carrier is fastened to the housing of the electric machine (1, 200, 300). - a stator (2, 201), - a rotor (4, 202), which, during operation of the electric machine (1, 200, 300), interacts magnetically with the stator (2, 201), - a first bearing device (8, 208), - a second bearing device (81, 281) and - a shaft (5, 25, 35), which, in the first bearing device (8, 208) and the second bearing device (81, 281), is mounted rotatably about an axis of rotation of the shaft (5, 25, 35), - wherein in an axial direction of the axis of rotation the shaft (5, 25, 35) has a first segment (301, 2301, 3301) with a first material and a second segment (302, 2301) with a second material which follow one another consecutively, - wherein the rotor (4, 202) is fastened to the first segment (301, 2301, 3301) of the shaft (5, 25, 35), - wherein the second material is an iron material, characterised in that - the first material is AlZn5,5MgCU, - the first segment is formed by a pipe prefabricated as an extrusion press profile, - the first segment has an axial borehole for transporting heat between the first material and a first end of the shaft, - wherein the first material and the second material are connected with a material bond and homogenously at a joint (9, 209, 309) of the first segment (301, 2301, 3301) and the second segment (302, 2302) by means of an orbital friction welding, - wherein the electric machine (1, 200, 300) has an inflow element, which extends into the axial borehole so that a coolant, in particular a cooling liquid, can flow out of the inflow element into the axial borehole, - wherein the inflow element 7 is an inlet pipe, which is fastened in a carrier, - wherein the carrier is fastened to the housing of the electric machine (1, 200, 300).