Explanation:
x = age of brother 1 today
y = she of brother 2 today
x + y = 22
(x - 6)(y - 6) = 21
as 6 years ago, both were 6 years younger. than today.
from the first equation we get e.g.
x = 22 - y
using that in the second equation we get
(22 - y - 6)(y - 6) = 21
(16 - y)(y - 6) = 21
16y - 96 - y² + 6y = 21
-y² + 22y - 117 = 0
the general solution to a quadratic equation is
x = (-b ± sqrt(b² - 4ac))/(2a)
in our case
x = y
a = -1
b = 22
c = -117
y = (-22 ± sqrt(22² - 4×-1×-117))/(2×-1) =
= (-22 ± sqrt(16))/-2 = (-22 ± 4)/-2
y1 = (-22 + 4)/-2 = 9
y2 = (-22 - 4)/-2 = 13
as we can see, when we try it in our equations, x and y are interchangable : one has to be 9 and the other 13.
so, the older brother is 13 now.