Hi we were asked to solve the following integral by substitution

I first took a factor of 1/2 out, to give

I then let

so

substituting for u and du/dx gives

Anything wrong there?

Because if I integrate WITHOUT taking the first 1/2 factor out, leaving u as 2x^2 + 4x, i get the same answer but with 2x^2 + 4x inside the ln. These answers are surely different, yet both make sense so what's gone wrong?

I've run this past my classmate and teacher and none of use can find the mistake, so any help is greatly appreciated.