Differentiate both sides of the equality with respect to x:
sec^2(x-y) (1-dy/dx) = 1/(1+x^2)dy/dx - (2xy)/(1+x^2)^2
solve for dy/dx:
dy/dx (sec^2(x-y) +1/(1+x^2)) = sec^2(x-y) + (2xy)/(1+x^2)^2
dy/dx = (sec^2(x-y) + (2xy)/(1+x^2)^2)/(sec^2(x-y) +1/(1+x^2))
Note now that:
sec^2(x-y) = 1+ tan^2(x-y) = 1+ y^2/(1+x^2)^2
so:
dy/dx = (1+ y^2/(1+x^2)^2 + (2xy)/(1+x^2)^2)/(1+ y^2/(1+x^2)^2 +1/(1+x^2))
and multiplying numerator and denominator by (1+x^2)^2:
dy/dx = ((1+x^2)^2 + y^2 + 2xy)/((1+x^2)^2 + y^2 +1+x^2)
dy/dx = (x^4+2x^2 + y^2 + 2xy+1)/(x^4+3x^2 + y^2 +2)