.
The given instructions in the post only make the solution harder.
Let me to present you my solution in much more simple way.
Let x be the John age.
Then the Joan age is (x+4) years, according the condition.
We are given
x + (x+4) = 126.
Hence,
2x + 4 = 126,
2x = 126 - 4 = 122,
x = 122/2 = 61.
37 years ago, when they were married, John was 61 - 37 = 24 years old.
Joan was 24+4 = 28 years old at that time. ANSWER
-----------------
It is a bad teacher who instructs to solve a problem in a hard way, without any reason.