\[\frac{\sin x - x \cos x}{x \sin x + \cos x}\]

#### Solution

\[\text{ Let } u = \sin x - x \cos x; v = x \sin x + \cos x\]

\[\text{ Then }, u' = \cos x + x \sin x - \cos x; v' = x \cos x + \sin x - \sin x\]

\[ = x \sin x = x \cos x\]

\[\text{ Using the quotient rule }:\]

\[\frac{d}{dx}\left( \frac{u}{v} \right) = \frac{vu' - uv'}{v^2}\]

\[\frac{d}{dx}\left( \frac{\sin x - x \cos x}{x \sin x + \cos x} \right) = \frac{\left( x \sin x + \cos x \right)x \sin x - \left( \sin x - x \cos x \right)x \cos x}{\left( x \sin x + \cos x \right)^2}\]

\[ = \frac{x^2 \sin^2 x + x \cos x \sin x - x \cos x \sin x + x^2 \cos^2 x}{\left( x \sin x + \cos x \right)^2}\]

\[ = \frac{x^2 \left( \sin^2 x + \cos^2 x \right)}{\left( x \sin x + \cos x \right)^2}\]

\[ = \frac{x^2}{\left( x \sin x + \cos x \right)^2}\]