# How do you differentiate f(x)=sinx-1/(xcosx) using the sum rule?

${D}_{x} f \left(x\right) = \cos x + \frac{\cos x + x \sin x}{{x}^{2} {\cos}^{2} x}$
${D}_{x} f = \cos x - {D}_{x} \frac{1}{u}$ where $u = x \cos x$
${D}_{x} f = \cos x + \frac{1}{u} ^ 2 {D}_{x} \left(x \cos x\right)$
${D}_{x} f = \cos x + \frac{1}{u} ^ 2 \left(1 \cos x + x \sin x\right)$