By remainder theorem
let p(x) be x2 + px+q
let f(x) be x2+mx+n
to find the value of x:
x+a=0
x=-a
substituting
p(-a)=(-a)2+p(-a)+q
=a2-pa+q
f(-a)=(-a)2+m(-a)+n
=a2-ma+n
According to question, x+a is a factor of p(x) and f(x). ( by factor theorem)
therefore, p(-a)=f(-a)=0
evaluating
a2-pa+q = a2-ma+n
-pa+q = -ma+n (a2 gets cancelled, resulting in 0)
-(pa-q) = -(ma-n) ('-' is common)
pa-q = ma-n
n-q = ma-pa (transposing values)
n-q/a = ma-pa/a (dividing both the sides by a)
n-q/a = m-p
a/n-q = 1/m-p (inverting both the sides)
a = n-q/m-p (bringing 'n-q' to the R.H.S)
Hence, proven