let #g(x) = sin(x) - xcos(x)#
then #g'(x) = cos(x) - cos(x) + xsin(x) = xsin(x)#
let #h(x) = xsin(x) + cos(x)#
then #h'(x) = sin(x) + xcos(x) - sin(x) = xcos(x)#
and #h^2(x) = x^2sin^2(x) + 2xsin(x)cos(x) + cos^2(x)#
The quotient rule is:
#f'(x) = (g'(x)h(x) - g(x)h'(x))/(h^2(x))#
#f'(x) = ((xsin(x))(xsin(x) + cos(x)) - (sin(x) - xcos(x))(xcos(x)))/(x^2sin^2(x) + 2xsin(x)cos(x) + cos^2(x))#
#f'(x) = (x^2sin^2(x) + xsin(x)cos(x) - xsin(x)cos(x) + x^2cos^2(x))/(x^2sin^2(x) + 2xsin(x)cos(x) + cos^2(x))#
#f'(x) = (x^2(sin^2(x) + cos^2(x)))/(x^2sin^2(x) + 2xsin(x)cos(x) + cos^2(x))#
#f'(x) = (x^2)/(x^2sin^2(x) + 2xsin(x)cos(x) + cos^2(x))#