we have
First rectangle perimeter
2x+2y=86
Second rectangle perimeter
2(2x)+2(y+22)=166
4x+2y+44=166
4x+2y=166-44
4x+2y=122
the equations of the system are
2x+2y=86 ... (1)
4x+2y=122 ... (2)
we have can clear x of the first equation
x=(86-2y)/2
x=43-y