Answers:
17 chickens and 28 pigs
=======================================================
Step-by-step explanation:
c = number of chickens
p = number of pigs
There are 45 heads, so c+p = 45. This solves to p = 45-c.
Since chickens have 2 legs and pigs have 4, this means there are 2c legs from all the chickens and 4p legs from all the pigs. In total there are 2c+4p legs.
Set this equal to 146 to get the second equation
2c+4p = 146
Then plug in p = 45-c and solve for c
2c+4p = 146
2c+4(45-c) = 146
2c+180-4c = 146
-2c+180 = 146
-2c = 146-180
-2c = -34
c = -34/(-2)
c = 17
There are 17 chickens.
p = 45-c
p = 45-17
p = 28
And there are 28 pigs.
------------------
Check:
c+p = 17+28 = 45 heads
2c+4p = 2*17+4*28 = 34+112 = 146 legs
The answers are confirmed.