We have to find the derivative of y=(x-1)^2+2(x-1)(x+2)+(x+2)^2

Using the product rule and the chain rule:

y' = 2(x - 1)*1 + 2[(x - 1)*1 + (x + 2)*1] + 2( x + 2)*1

=> y' = 2x - 2 + 2x - 2 + 2x + 4 + 2x + 4

=> y' = 8x + 4

Else we can expand the expression:

y = (x-1)^2 + 2(x-1)(x+2) + (x+2)^2

=> (x - 1 + x + 2)^2

=> (2x + 1)^2

=> 4x^2 + 1 + 4x

y' = 8x + 4

**Therefore the derivative of y = (x-1)^2 + 2(x-1)(x+2) + (x+2)^2 is y' = 8x + 4**