we have that
x²+2xy+4y²=12
we know that
A better way to do this problem is using what is called “Implicit Differentiation
so
step 1
Differentiate both sides of the equation using the Chain Rule
x²+2xy+4y²=12-------> 2x+2y+2xy1+8yy1=0
2xy1+8yy1=-2x-2y--------> y1*[2x+8y]=-2x-2y
y1=(-2x-2y)/(2x+8y)
for the point (2,1)
y1=(-2*2-2*1)/(2*2+8*1)-------> y1=-6/12------> y1=-1/2
step 2
find the equation of the tangent line with m=-1/2 and the point (2,1)
y-y0=m*(x-x0)------> y-1=(-1/2)*(x-2)-----> y-1=(-1/2)x+1
y=(-1/2)x+2
the answer is
y=(-1/2)x+2
using a graph tool
see the attached figure