using foil method

x^2 + (x+1)+(x+3)^2 =38 then combine

(x+3)^2 = x^2 + 6x + 9

Now substitute that into your equation and combine terms.

You not require parentheses around x+1 since you are not raising it to a power