Draw a FBD around end B.
Assume positive internal torques T1 and T2 in shafts (1) and (2).
The equilibrium equation obtained from this FBD is:
∑MX=-T1-T2+T=0 ∴T1+T2=T