Because we know (x+m)^2 expanded will provide x^2+2mx+m^2 and we have the extra addition of a value named n we can strictly focus on ensuring the expansion yields x^2+4x and deal with the -6 value by using n. Thus, by putting m as 2 we get x^2+4x+4, and following through to achieve -6 instead of 4, we put n as -10, and so we get the desired answer.