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
I just kind of sat here playing with numbers i dont really know a shortcut but the answer is 10 chickens and 15 rabbits 10*2= 20 each chicken has two legs so thats 10 heads 20 legs 15*4=60 each rabbit has four legs so thats 15 heads 60 legs 15+10=25 heads 20+60=60 legs