The best formation in fact is the upside down and wider U, an upside down widened V even. The formation would look something like this...
---------------------U-------------------------------------- ------------------U U----------------------------------------------------U U------------------------------------------------U U----------------------------------------------------------- --------------.......See how the flanks of the units in decreasing order are being defended by eachother. If the first unit is flanks the two units on the rite and left of it can move up to defend it and kill the attacking units with much ease. If they are unable the next two units down can do the job. Now within the formation your general can sit increasing the morale of your troops and having his flanks defended. Archers can also be placed near the general inside the defensive ring to pepper on coming enemies tho I would suggest spear throwers instead of archers as they can inflict more damage. When the enemy breaks on your defense their backs will be exposed to a cavalry flanking maneurver and allow them the ability to rout instead of having them fight to the death. Your cavalry can move up their lines in succession having you be on the offensive rather then the defensive. Cavalry aren't necessarily needed tho, any extra units, can come around them to attack the rear a much more exposed flank. This formation is the same one used at Cannae by Hannibal to defeat the massive roman armies. He was outnumbered like 5 to 1 and managed to halt the roman charge while they slowly made their way through, but before they could get to the general himself, their cavalry as well as their reserve infantry made their way around the backs of the roman infantry to kill all of them. This formation has proved itself in many of my games as well as historically, I dont think this V has ever been used in real life, much less my games because of its said flaws. This upside down U, has some minor defects, one: it relies on a cavalry fight to determine who will win the day, but on a lesser extent of what the V formation must rely on the cavalry for. It's only, undefended, exposed flank is its rear, but that is the same for any army, and this flank is better defended then the normal line. In one such battle I fought, my cavalry had charged into 2 elephant units and were mauled, but killed the elephants, I was left with just my general as my only cavalry and though I dont normally do this, I relied on my general to flank each unit successively, and successfully to win the day. Like Hannibal I too was outnumbered, but more like it being 3 to 1.