The Chinese did this with crossbowmen. It was highly effective against heavy cavalry. However, the crossbow/polearm combination was dropped in favor of the musket and bayonet.
Well, against cavalry, I don't think there'd be much difference between the two: a musket and bayonet can keep them from charging you just as well as a pike can, and that's what's really important. In hand-to-hand combat against infantry, OTOH, having a weapon four times as long as that of your unarmoured, unshielded enemy would be a definite advantage.
Also, the reason why China and India never adopted the pike is because missiles played an extensive role in warfare in those two places. You can't hold a shield if you're holding a pike. Pikemen are rather vulnerable to massed foot and horse archery due to their lack of a shield. They could wear heavier armor, but that would further reduce their already poor mobility.
OTOH, Alexander's pikemen performed well against the missile-heavy infantry formations of Achaemenid Persia.
Secondly, musketeers can still fight effectively even if their formation is broken up by rough terrain, whereas pikemen need to maintain a cohesive formation at all times.
True, although generals of the period normally preferred to fight on open ground, so this wouldn't make much difference in practice.
Lastly, a line of musketeers is 3 deep, while pikemen are usually 10-16 men deep. In a world with artillery, a cannonball will plow through 3 men in a line of muskets or a dozen in a pike block. If you were a commander, which would you choose?
Actually that depends on who/what period you're talking about. Some commanders preferred to draw up their infantry in deeper formations to increase their staying power in hand-to-hand combat (Maurice de Saxe in his "Reveries" says that five is the minimum depth, IIRC), and of course Napoleonic commanders often moved their men around in deep columns.