@muwaha: Yes, the diameter of new one will be much larger than your old one as it is probably aluminum and much lighter. If the distance from the u-joint at the front to the u-joint a back is within a smidgeon of the same total length as your 2 existing pieces, you're golden. (It should be just a little shorter as it will go directly from transmission to axle, no detour to the bearing in middle). I am 99% sure it will work, but a tape measure is your friend.
The boring engineering - you have to be careful that you don't get "whirling" as it was known in my design text book which is an uncontrolled vibration when spinning.*
Whirling is caused by gravity and imbalance and the rotation speed. Every shaft will "whirl" at some speed, the idea is to make the speed MUCH higher than normal drivings
The longer a shaft is, the more it sags, the more "flexible" (lower modulus of elasticity) and the greater the imbalance, the more prone it is to whirling.
To combat sag; you can do 5 things:
1. make the drive shaft shorter, (initially Ford only made regular cabs, then they came out with SuperCab, but they weren't sure how many SuperCabs they would sell, to they added short extension ahead of the regular rear, so they wouldn't have volumes of unused SuperCab driveshafts if it turned out, no one wanted the bigger cab. It turned out the SuperCab sold very well, so, they cost reduced by making 1 piece drive shaft <1 less u-joint, 2 fewer driveshaft ends, no carrier bearing and no bolt hole in the frame cross member, but it comes with drawback it needed to be stiffer ).
2. make it out of stronger, lighter material (e.g carbon fiber, not steel. Aluminium is going wrong direction for strength, but it is lighter, so they kinda balance)
3. make the drive shaft out of thicker material (use 0.125" material, not 0.090", helps but makes driveshaft heavier - more material costs more)
4. make the diameter of the driveshaft larger, (use 5" tube not 2-1/2 and makes it 4X stronger for only 2X material, which is good value for the dollar)
3. balance the driveshaft better, (Ford was making 100s/day, spending time to get perfect balance would cost too much, so they are balanced close and shipped.)
So, as it is longer and made of thinner aluminum, it needs to be larger in diameter.
Hopefully, that helps with both answer your question and allow you to understanding of why.
*In our CNC machining class, we attempted to make a brass cannon. When we turn on the lathe, the brass rod bent like it was play dough and we barely got it emergency stopped before damage was done. The 3 cm diameter x 25cm long brass rod was bent 90* to the lathe chuck.