Given polynomials are,
[tex]\rm{f(x)=x^2+px+q}[/tex]
[tex]\rm{g(x)=x^2+mx+n}[/tex]
According to Remainder Theorem, if (x + a) is a factor of f(x), then,
[tex]\longrightarrow\rm{0=f(-a)}[/tex]
[tex]\longrightarrow\rm{0=(-a)^2+p(-a)+q}[/tex]
[tex]\longrightarrow\rm{0=a^2-pa+q\quad\dots(1)}[/tex]
Similarly, if (x + a) is a factor of g(x), then,
[tex]\longrightarrow\rm{0=g(-a)}[/tex]
[tex]\longrightarrow\rm{0=(-a)^2+m(-a)+n}[/tex]
[tex]\longrightarrow\rm{0=a^2-ma+n\quad\dots(2)}[/tex]
Subtracting (2) from (1),
[tex]\longrightarrow\rm{0=(a^2-pa+q)-(a^2-ma+n)}[/tex]
[tex]\longrightarrow\rm{0=a^2-pa+q-a^2+ma-n}[/tex]
[tex]\longrightarrow\rm{0=(m-p)a+q-n}[/tex]
[tex]\longrightarrow\rm{0=(m-p)a-(n-q)}[/tex]
[tex]\longrightarrow\rm{(m-p)a=n-q}[/tex]
[tex]\longrightarrow\rm{\underline{\underline{a=\dfrac{n-q}{m-p}}}}[/tex]
Hence Proved!