The only hard part is the second part
f(x) = x - 3
g(x) + f(x) = ( 2x^2 + 5x - 1) + ( x - 3) = 2x^2 + 6x - 4
So [ g(x) + f(x) ]^2 =
[ 2x^2 + 6x - 4]^2 =
[ 2 (x^2 + 3x - 2] ^2 =
4 [ x^2 + 3x - 2 ] [x^2 + 3x - 2 ] =
4 [ (x^4 + 3x^3 - 2x^2) + ( 3x^3 + 9x^2 - 6x ) -2x^2 - 6x + 4 ] =
4 [ x^4 + 6x^3 + 5x^2 - 12x + 4 ] =
4x^4 + 24x^3 + 20x^2 - 48x + 16
So
f(x) - [ g(x) + f(x) } ^ 2 =
(x - 3) - [ 4x^4 + 24x^3 + 20x^2 - 48x + 16 ] =
-4x^4 - 24x^3 - 20x^2 + 49x - 19