pg. 282 of TM give the "base trooper cost" for conv infantry as 2000 * sqrt(Weapon Cost). There is a great deal of ambiguity in what should be done with this because no example is given for the costs of an infantry unit in that section. I am assuming that you multiply that base trooper cost * number of troopers * motive type multiplier to get the final cost. (plus the anti-mech multiplier if they have anti-mech training).
An issue comes up, however, about how to calculate weapon cost in the case when a secondary weapon is involved. I would assume that you take the average here, but the problem is the order of the operation because the average of the square root is not the same as the square root of the average. Let me explain with an example.
Lets take a foot squad of seven soldiers, of which five have auto rifles (cost 80) and two have Semi-Portable Particle Cannons (cost 7000). Here are two different ways that I could calculate the infantry cost:
1) 2000 * sqrt((5*80+2*7000)/7) * 7 = 634,980.3
2) 2000 * (5 * sqrt(80) + 2 * sqrt(7000)) = 424,106.7
Method (1) first averages weapon cost across all soldiers and then square roots that. Method (2) just takes separate square roots for the two weapon types and multiplies each by the number of troopers. They give different numbers and the greater the difference in cost between the primary and secondary, the larger the discrepancy becomes.