Final answer:
To represent the total number of legs of goats and hens that add up to 40, the equation is 4g + 2h = 40, where g and h are the numbers of goats and hens respectively.
Step-by-step explanation:
To represent the total number of legs in a herd of goats (g) and hens (h) as a linear equation in two variables, given that the total number of legs is 40, we need to consider the number of legs each animal has. A goat has 4 legs, and a hen has 2 legs. Therefore, if we have g goats and h hens, the total number of legs can be represented as 4g + 2h = 40. This equation accounts for the legs of both the goats and the hens to add up to the total of 40 legs.