# How do you differentiate (3+sin(x))/(3x+cos(x))?

Jul 28, 2015

You use the quotient rule.

#### Explanation:

The quotient rule allows you to differentiate functions that can be written as the quotient of two other functions, $f \left(x\right)$ and $g \left(x\right)$, by using the formula

color(blue)(d/dx(y) = (f^'(x) * g(x) - f(x) * g^'(x))/[(g(x)]^2), where $g \left(x\right) \ne 0$

Your function can be written as

$y = f \frac{x}{g} \left(x\right) = \frac{3 + \sin x}{3 x + \cos x}$

You also need to remember that

$\frac{d}{\mathrm{dx}} \left(\sin x\right) = \cos x$

and

$\frac{d}{\mathrm{dx}} \left(\cos x\right) = - \sin x$

So, the derivative of $f \left(x\right)$ will be

$\frac{d}{\mathrm{dx}} \left(f \left(x\right)\right) = \frac{d}{\mathrm{dx}} \left(3 + \sin x\right)$

$\frac{d}{\mathrm{dx}} \left(f \left(x\right)\right) = \frac{d}{\mathrm{dx}} \left(3\right) + \frac{d}{\mathrm{dx}} \left(\sin x\right)$

$\frac{d}{\mathrm{dx}} \left(f \left(x\right)\right) = 0 + \cos x = \cos x$

The derivative of $g \left(x\right)$ will be

$\frac{d}{\mathrm{dx}} \left(g \left(x\right)\right) = \frac{d}{\mathrm{dx}} \left(3 x + \cos x\right)$

$\frac{d}{\mathrm{dx}} \left(g \left(x\right)\right) = \frac{d}{\mathrm{dx}} \left(3 x\right) + \frac{d}{\mathrm{dx}} \left(\cos x\right) = 3 - \sin x$

Plug these values into the formula for the quotient product to get

${y}^{'} = \frac{\cos x \cdot \left(3 x + \cos x\right) - \left(3 + \sin x\right) \cdot \left(3 - \sin x\right)}{3 x + \cos x} ^ 2$

Use the formula for the difference of two perfect squares to write

color(blue)(a^2 - b^2 = (a-b)(a+b)

${y}^{'} = \frac{3 x \cdot \cos x + {\cos}^{2} x - \left({3}^{2} - {\sin}^{2} x\right)}{3 x + \cos x} ^ 2$

${y}^{'} = \frac{3 x \cdot \cos x + {\cos}^{2} x - 9 + {\sin}^{2} x}{3 x + \cos x} ^ 2$

You can further simplify this expression by using the fact that

$\textcolor{b l u e}{{\cos}^{2} x + {\sin}^{2} x = 1}$

so that you get

${y}^{'} = \frac{3 x \cdot \cos x - 9 + {\overbrace{{\sin}^{2} x + {\cos}^{2} x}}^{\textcolor{b l u e}{= 1}}}{3 x + \cos x} ^ 2$

${y}^{'} = \frac{3 x \cdot \cos x - 9 + 1}{3 x + \cos x} ^ 2 = \textcolor{g r e e n}{\frac{3 x \cdot \cos x - 8}{3 x + \cos x} ^ 2}$