you are differntiating wrt x

d(x)/dx= d[cot(y)]/dx

1= -csc^2(y) dy/dx

dy/dx= -1/csc^2(y) = -sin^2(y)

Alternatively y = arcot(x)

dy/dx = -1/ (1+x^2)

Since y= arcot(x) draw a right triangle with an acute angle t whose adjacent side is x and whose opposite side is 1 making the hypoteneuese sqrt(1+x^2) so sin^2(y) = 1 /(1+x^2)

so our previous result dy/dx = -sin^2(y) = -1/ (1+x^2) is consistent with our alternative approach