What about [latex]\frac{d}{dx} \left( \frac{x}{e^x} \right)[/latex]? Can we just take the derivative of the top and bottom separately, and put them together? Nope, we need a quotient rule.
[latex]\boxed{\cfrac{d}{dx} \left( \cfrac{f}{g} \right) = \frac{g f' - f g'}{g^2}}[/latex]
Where did this strange formula come from? Some fancy algebra will get you there as the next example shows.
Note that I’m using [latex]a[/latex] and [latex]b[/latex] instead of [latex]f[/latex] and [latex]g[/latex] right now because we will need [latex]f[/latex] and [latex]g[/latex] to mean something else in just a second.
So what can we do? One way it to use the product rule in a strange manner. We are going to apply it to [latex]\frac{d}{dx} \left( b \cdot \frac{a}{b}\right)[/latex]. We set [latex]f = b[/latex], and [latex]g = \frac{a}{b}[/latex]. We see
\begin{align*}
\frac{d}{dx} \left( b \cdot \frac{a}{b} \right ) & = f g’ + g’ f \\
& = b \left( \frac{d}{dx} \frac{a}{b} \right) + \left(\frac{a}{b} \right) \left( \frac{d}{dx} b \right) \\
& = b \left( \frac{d}{dx} \frac{a}{b} \right) + \frac{a b’}{b}
\end{align*}
But notice that [latex]\frac{d}{dx} \left(b \cdot \frac{a}{b}\right) = \frac{d}{dx} a = a'[/latex]. Hence, we have
[latex]a' = b \left( \frac{d}{dx} \frac{a}{b}\right) + \frac{a b'}{b}[/latex]
Now we just have to solve for [latex]\frac{d}{dx} \frac{a}{b}[/latex], and we have a formula for derivatives of quotients!
\begin{align*}
a’ & = b \left( \frac{d}{dx} \frac{a}{b} \right) + \frac{a b’}{b} \\
a’ – \frac{a b’}{b} & = b\left( \frac{d}{dx} \frac{a}{b} \right) \\
\frac{1}{b} \left( a’ – \frac{a b’}{b} \right) & = \frac{d}{dx} \frac{a}{b} \\
\frac{a’}{b} – \frac{a b’}{b^2} & = \frac{d}{dx} \frac{a}{b} \\
\frac{b a’}{b^2} – \frac{a b’}{b^2} & = \frac{d}{dx} \frac{a}{b} \\
\frac{b a’ – a b’}{b^2} & = \frac{d}{dx} \frac{a}{b} \\
\end{align*}
If we turn this equation around, it gives the same quotient rule I mentioned earlier:
[latex]\boxed{\cfrac{d}{dx} \left( \cfrac{a}{b} \right) = \frac{b a' - ab'}{b^2}}[/latex]
This has a cute rhyme to it: “low dee high minus high dee low, over the square of what’s below”. The “low dee high” means [latex]b a'[/latex], since [latex]b[/latex] is the “low” and [latex]a'[/latex] is the “dee high”. Then “minus high dee low” is [latex]- a b'[/latex]. Finally, “over the square of what’s below” is [latex]b^2[/latex].
Let’s see how it looks applying the quotient rule.
We set [latex]a = x[/latex] and [latex]b = e^x[/latex]. We see [latex]a' = 1[/latex], [latex]b' = e^x[/latex]. Using the formula [latex]\cfrac{d}{dx} \left( \cfrac{a}{b} \right) = \frac{b a' - ab'}{b^2}[/latex], we have
\begin{align*}
\frac{d}{dx} \left ( \frac{x}{e^x} \right) & = \frac{b a’ – ab’}{b^2} \\
& = \frac{(e^x)(1) – (x)(e^x)}{(e^x)^2} \\
& = \frac{e^x (1 – x)}{(e^x)^2} \\
& = \boxed{\frac{1 – x}{e^{x}}}
\end{align*}
If we simplify and turn [latex]\frac{x^2}{x}[/latex] into just [latex]x[/latex], then we have [latex]\frac{d}{dx} \left( \frac{x^2}{x} \right) = \frac{d}{dx} x = \boxed{1}[/latex]. Easy enough.
Using the quotient rule, we set [latex]a = x^2[/latex] and [latex]b = x[/latex], with [latex]a' = 2x[/latex] and [latex]b = 1[/latex]. We have
\begin{align*}
\frac{d}{dx} \left( \frac{x^2}{x} \right) & = \frac{b a’ – a b’}{b^2} \\
& = \frac{(x)(2x) – x^2(1)}{(x)^2} \\
& = \frac{2x^2 – x^2}{x^2} \\
& = \frac{x^2}{x^2} \\
& = \boxed{1}
\end{align*}
Same thing we got before!
In this case, [latex]a = x^2 + 2x[/latex] and [latex]b = \ln(x)[/latex]. We have [latex]a' = 2x + 2[/latex], [latex]b' = \frac{1}{x}[/latex]. Hence we have
\begin{align*}
\frac{d}{dx} \frac{(x^2 + 2x)}{\ln(x)} & = \frac{b a’ – a b’}{b^2} \\
& = \frac{(\ln(x)) (2x + 2) – (x^2 + 2x) \left( \frac{1}{x} \right)}{(\ln x)^2} \\
& = \boxed{\frac{\ln(x)(2x + 2) – (x + 2)}{(\ln x)^2}}
\end{align*}
This doesn’t really simplify farther, so that’s our answer.
In this case [latex]a = \sin(x)[/latex] and [latex]b = x[/latex], so [latex]a' = \cos(x)[/latex] and [latex]b' = 1[/latex]. Hence
\begin{align*}
\frac{d}{dx} \frac{\sin(x)}{x} & = \frac{b a’ – a b’}{b^2} \\
& = \boxed{\frac{x \cos(x) – \sin(x)}{x^2}}.
\end{align*}