I am looking at buying Mithral barding for an animal companion. It is a large, non-humanoid creature. I want to buy it full plate. Would the cost be 1500 (base cost of full plate) × 4 (large, nonhumanion surcharge) + 9000 (Mithral surcharge) = 15000 gp or (1500 + 9000) × 4 = 42000 gp?
Either, depending on how you want to purchase the item. Mithral Large Barding (it's large barding, only mithral!) is 15000 gp, while Large Mithral Barding (it's mithral barding, only large!)is 42000 gp. Their stats are otherwise identical. As a player, you should generally choose the best of a set of actions which are nonmechanically equivalent, so Mithral Large Barding is the way to go. In campaigns I run, the pointlessly more expensive versions of items are not generally available, unless I want to make a point about a region being mechanically backwards.
Thorough explanation for you confused peoples:
We start with an item, in this case Full Plate. When we consider Full Plate, there are lots of possible kinds of Full Plate to buy. We could buy spiked full plate. We could buy Large full plate. We could buy unusually shaped full plate. etc.
For the purposes of this explanation, we note that both mithral full plate and Large full plate are available for purchase, at different prices and with different stats.
Next we look mithral or Large full plate. Large full plate is still an item primarily composed of metal, and so it can benefit from being made of mithral, changing it's price and stats. Mithral full plate is still sized for a Medium creature, and so is eligible to instead be sized for a larger creature, changing its price and stats. The end result is that the stats of the two armor sets are identical, with the exception of cost.
The rules for modification of items always assume a "base item" that the augmented item is "similar to, except...". This is why the prices for such things are expressed as operators (+500, X3,-10%, etc.) rather than numbers. This presents a fundamental challenge for the application of multiple modifiers, which Pathfinder deals with by not allowing multiple modifications. All pathfinder mods of this nature apply their effects to a base item and result in a new item, which can then be further modified by using it as the input base item into another modifier. You can't apply these affects simultaneously, or both to some 'original' base item; that's not how the system works. Instead you have to calculate one modification and then use that as the base item for the other.
Although this question is frequently asked, an answer hasn't been added to the Pathfinder FAQ
This thread was started in May to compile all of the various threads on the Paizo messageboards that posed this exact same question. As of this writing, over 100 folks have marked it as a future candidate for a Frequently Asked Questions entry. Officially, it's a wait-and-see and ask-your-GM situation.
Unofficially, I (and many others) believe first armor is purchased for the unusual creature as per Table 6–8: Armor For Unusual Creatures (Pathfinder Role-playing Game Core Rulebook 153) then the flat-cost price is paid for any special materials. Reversing this process leads to armor prices that are, as you've pointed out, excessive.