Let "rabbits" be represented by the variable "x"
and "chickens" be represented by the variable "y"
then in total we have 25 animals
so x + y = 25
-> y = -x + 25
and since a rabbit has four legs and a chicken has two legs
and there are 80 legs in total
4x + 2y = 80
-> 2x + y = 40
-> y = -2x + 40
[I had solved for y for each equation]
and since we are looking for when y = y
-x + 25 = -2x + 40 [we can solve for x from here]
x + 25 = 40 [added 2x to both sides]
x = 15 [subtracted 25 from both sides]
then we can plug this back into
y = -x + 25
to get y = -15 + 25 = 10
therefore there are 15 Rabbits and 10 Chickens