x - the number
Faye squares the number: x²
then multiplies by 2: 2x²
and adds 4: 2x²+4
Andrew multiplies the number by 21: 21x
then subtracts the result from 40: 40-21x
They both finish with the same answer, so the results are equal.

The number is negative so x=-12.
The number is
-12.