Solution: Set the pig X head.
40 chickens
4x+2(40-x)= 134
4x+80-2x= 134
2x= 134-80
2x=54
x=27
40-27= 13.
A: There are 27 pigs.
13 chickens
If in doubt, please ask.