The first step is to find dy/dx.
To do this you must first expand the brackets.
x2 + y2 + 2xy = xy2
Then differentiate each term with respect to x.
dy/dx of (x2) = 2x
dy/dx of (y2) = 2y(dy/dx)
(Using the product rule with u=y2 and v=1) this can be explained in more detail if necessary.
dy/dx of (2xy) = 2y + 2x(dy/dx)
(Also using the product rule with u=2x and v=y)
dy/dx of (xy2) = y2 + 2xy(dy/dx)
(Also product rule with u=x and v=y2)
Overall that gives:
2x + 2y + 2x(dy/dx) + 2y(dy/dx) = y2 + 2xy(dy/dx)
Then put all the terms containing (dy/dx) on the left and the others on the right.
This gives:
2x(dy/dx) + 2y(dy/dx) - 2xy(dy/dx) = y2 - 2x - 2y
This equals:
(dy/dx)(2x + 2y - 2xy) = y2 - 2x - 2y
Therefore:
(dy/dx) = (y2 - 2x - 2y) / (2x + 2y - 2xy)
From the original equation you now need to work at y at the point when x=1.
(1+y)2 = 1y2
y2 + 2y + 1 = y2
This is the same as:
2y + 1 = 0
2y = -1
y= -0.5
Substitute this into (dy/dx)
This gives:
[(-0.5)2 - 2(1) -2(-0.5)] / [2(1) + 2(-0.5) - 2(1 x -0.5)]
This equals
(0.25 - 2 + 1) / (2 - 1 +1)
Therefore the gradient equals -3/8