Answer:
Let, Nikki's age is 'n'.
Since, Jamie is 5 years younger than Nikki, let Jamie's age be 'n-5'
According to the question,
The product of their age is 126.
which means,
Nikki's Age × Jamie's age = 126
⇒ n × (n-5) = 126
⇒ n² - 5n = 126
⇒ n² - 5n - 126 = 0
Now you can do the middleterm,
⇒n² - 14n + 9n - 126 =0
⇒ n ( n - 14 ) + 9 (n - 14 ) = 0
⇒ ( n - 14 ) ( n + 9 ) = 0
since n's value can not negative
⇒ ( n - 14 ) = 0
∴ n = 14
Nikki's age is 14
and Jamie's age is 9 years