[tex]\dfrac{\mathrm d}{\mathrm dx}\left[3x^2\right]=\dfrac{\mathrm d}{\mathrm dx}\left[xy^2+1\right][/tex]
[tex]\implies 6x=y^2+2xy\dfrac{\mathrm dy}{\mathrm dx}[/tex]
[tex]\implies\dfrac{\mathrm dy}{\mathrm dx}=\dfrac{6x-y^2}{2xy}[/tex]
The tangent line to the curve at [tex](1,2)[/tex] has slope [tex]\dfrac{6\times1-2^2}{2\times1\times2}=\dfrac12[/tex]. In point-slope form, the line's equation is
[tex]y-2=\dfrac12(x-1)\implies y=\dfrac12x+\dfrac32[/tex]