Manufacturers of processed foods have several choices. They can take samples from 12 different batches and have them analyzed for their chemical components. There are one or more officially-approved methods of analysis for each constituent. They can also have the nutrients calculated from the recipe. Since that method depends on someone performing laboratory analyses to provide the information for the recipe's ingredients, the following section will address the problems of getting that analytical information in the first place.
Protein is estimated based upon the amount of bound nitrogen in the sample.
Total fat is estimated from the weight of all individual fatty acids plus the imputed weight of one unit of glycerol for each three fatty acids. Total carbohydrate is calculated by subtracting the weight of protein, total fat, moisture, and ash from the total weight of the sample of food. Chemically they are. However, the label regulations require calculating total carbohydrates by difference rather than by measuring them directly. It is both cheaper and serves as a catch-all for certain nutrients that are not well characterized.