Step-by-step explanation:
Let the number of hens be

Let the number of goats be

The number of animals on the farm is

This can be represented in an equation below as

The number of legs given in the question is

Hens have 2 legs
Goats have 4 legs
So the number of legs can be represented in the equation below as

Step 1:
We will solve equations (1) and (2) simultaneously

From equation (1), we will make x the subject of the formula

Step 2:
Substitute equation (3) in equation (2)

Hence,
The number of goats on the farm is
