Extract the obvious constant factor of 22
color(white)("XXX")color(green)(2)color(orange)((x^2+4x+2))XXX2(x2+4x+2)
Factor the second term using the quadratic formula for roots
color(white)("XXX")r=(-b+-sqrt(b^2-4ac))/(2a)XXXr=−b±√b2−4ac2a
In this case:
color(white)("XXX")r=(-4+-sqrt(4^2-4(1)(2)))/(2(1))XXXr=−4±√42−4(1)(2)2(1)
color(white)("XXX")= (-4+-sqrt(8))/2XXX=−4±√82
color(white)("XXX")=-2+-sqrt(2)XXX=−2±√2
If rr is a root then (x-r)(x−r) is a factor
So
color(white)("XXX")color(orange)((x^2+4x+2))XXX(x2+4x+2)
factors as
color(white)("XXX")=color(red)((x+2+sqrt(2)))color(blue)((x+2-sqrt(2)))XXX=(x+2+√2)(x+2−√2)
Giving the final factoring:
color(white)("XXX")2x^2+8x+4XXX2x2+8x+4
color(white)("XXX")=color(green)(2)color(red)((x+2+sqrt(2)))color(blue)((x+2-sqrt(2)))XXX=2(x+2+√2)(x+2−√2)