[tex]\begin{gathered} \text{Lets use x for pigs and y for Chickens} \\ \text{Heads} \\ Pigs\text{ and Chickens have one head, hence} \\ x+y=95\text{ (1)} \\ \text{Legs} \\ Pigs\text{ have four legs and Chickens have two legs, therefore} \\ 4x+2y=310\text{ (2)} \end{gathered}[/tex]