\(y'=\frac{\left(sinx-x.cosx\right)'\left(cosx-x.sinx\right)-\left(sinx-x.cosx\right).\left(cosx-x.sinx\right)'}{\left(cosx-x.sinx\right)^2}\)
\(=\frac{\left(cosx-cosx+x.sinx\right)\left(cosx-x.sinx\right)-\left(sinx-x.cosx\right)\left(-sinx-sinx-x.cosx\right)}{\left(cosx-x.sinx\right)^2}\)
\(=\frac{x.sinx.cosx-x^2sin^2x+sin^2x-x.cosx.sinx+sin^2x-x^2cos^2x}{\left(cosx-x.sinx\right)^2}\)
\(=\frac{2sin^2x-x^2\left(sin^2x+cos^2x\right)}{\left(cosx-x.sinx\right)^2}=\frac{2sin^2x-x^2}{\left(cosx-x.sinx\right)^2}\)