# How do you differentiate f(x)=x/e^x-1/x using the quotient rule?

Nov 17, 2015

Apply the quotient rule to each term to find that $f ' \left(x\right) = \frac{1 - x}{e} ^ x + \frac{1}{x} ^ 2$

#### Explanation:

The quotient rule states that
$\frac{d}{\mathrm{dx}} f \frac{x}{g} \left(x\right) = \frac{f ' \left(x\right) g \left(x\right) - f \left(x\right) g ' \left(x\right)}{g \left(x\right)} ^ 2$

Now, using the following facts:
$\frac{d}{\mathrm{dx}} \left(f \left(x\right) + g \left(x\right)\right) = f ' \left(x\right) + g ' \left(x\right)$
$\frac{d}{\mathrm{dx}} {e}^{x} = {e}^{x}$
$\frac{d}{\mathrm{dx}} x = 1$
$\frac{d}{\mathrm{dx}} 1 = 0$

We have
$f ' \left(x\right) = \frac{d}{\mathrm{dx}} \left(\frac{x}{e} ^ x - \frac{1}{x}\right) = \left(\frac{d}{\mathrm{dx}} \frac{x}{e} ^ x\right) + \left(\frac{d}{\mathrm{dx}} - \frac{1}{x}\right)$

Thus, applying the chain rule twice,

$f ' \left(x\right) = \frac{{e}^{x} - x {e}^{x}}{{e}^{x}} ^ 2 + - \frac{0 - 1}{x} ^ 2 = \frac{{e}^{x} \left(1 - x\right)}{{e}^{x}} ^ 2 + \frac{1}{x} ^ 2$

So, cancelling an ${e}^{x}$ in the first term, we have

$f ' \left(x\right) = \frac{1 - x}{e} ^ x + \frac{1}{x} ^ 2$