# Computing the derivative from the definition

Using the limit definition of the derivative which I know is: $$f'(x)=\lim_{h\to0}\left(\frac{f(x+h)-f(x)}{h}\right)$$ I am trying to solve this problem $$f(x)= \frac{x}{x+2}$$

How do I go about properly solving this, I seemed to get

$$\frac{x}{x+2}\$$ as my answer again? What are the steps I should follow?

I am trying to find the derivative of $f(x)= \frac{x}{x+2}$ using the definition of the derivative.

-
What do you mean? Can please state clearly what the problem is? – Mercy King Jun 22 '12 at 17:37
I am trying to find the derivate of f(x)= x/x+2 using the function of the derivative. – soniccool Jun 22 '12 at 17:38
@mystycs: Using the definition of the derivative? (Rather than the "function" of the derivative, which, frankly, doesn't parse?) – Arturo Magidin Jun 22 '12 at 17:50

I'm supposing you want to find the derivative using the limit definition.

\begin{align*}f'(x) &= \lim_{h\to 0}\frac{f(x+h)-f(x)}{h} = \lim_{h \to 0 } \frac{\frac{x+h}{x+h+2} - \frac{x}{x+2}}{h} = \lim_{h \to 0 }\frac{x^2+2x+hx+2h-x^2-xh-2x}{h(x+h+2)(x+2)} = \\ &= \lim_{h \to 0 }\frac{2h}{h(x+h+2)(x+2)} = \lim_{h \to 0 }\frac{2}{(x+2)(x+h+2)} = \frac{2}{(x+2)^2} \end{align*}

You should probably check your algebra. Subtracting the fractions may be a bit tricky.

-
I think its the algebra yea im looking over it now – soniccool Jun 22 '12 at 18:11

$f(x) = \frac{x+2 - 2}{x+2} = 1 - \frac{2}{x+2}$

$$\frac{f(x+h) - f(x)}{h} = \frac{\frac{2}{x+2} - \frac{2}{x+h+2}}{h} = \frac{2}{h} \cdot \frac{x+h+2 - (x+2)}{(x+2)(x+h+2)} = \frac{2}{(x+2)(x+h+2)} \xrightarrow{h\to 0} \frac{2}{(x+2)^2}$$

-

First note that your definition of derivative is incorrect. The derivative of a function $f(x)$ at a point $x$ is defined as $$f'(x) = \color{red}{\lim_{h \to 0}} \dfrac{f(x+h) -f(x)}h$$ Note that you need to take the $\color{red}{\displaystyle \lim_{h \to 0}}$ to get the derivative at $x$. Taking the limit as $h \to 0$ is the most important step.

Now lets get back to your problem. The function you have is $f(x) = \dfrac{x}{x+2}$. Hence, \begin{align} f'(x) & = \lim_{h \to 0} \dfrac{f(x+h) -f(x)}h = \lim_{h \to 0} \dfrac{\dfrac{x+h}{x+h+2} -\dfrac{x}{x+2}}h\\ & = \lim_{h \to 0} \dfrac{\dfrac{(x+h)(x+2) - x(x+h+2)}{(x+h+2)(x+2)}}h\\ & = \lim_{h \to 0} \dfrac{\dfrac{x^2 +2x+hx+2h - x^2-xh -2x}{(x+h+2)(x+2)}}h\\ & = \lim_{h \to 0} \dfrac{\dfrac{2h}{(x+h+2)(x+2)}}h\\ & = \lim_{h \to 0} \dfrac2{(x+h+2)(x+2)}\\ & = \dfrac2{\lim_{h \to 0} (x+h+2)(x+2)}\\ & = \dfrac2{(x+2)^2} \end{align} Hence, the derivative of $\dfrac{x}{x+2}$ is $\dfrac2{(x+2)^2}$.

-

First. The derivative function of $f(x)$ is not $\frac{f(x+h)-f(x)}{h}$. (That would be a function of two variables, $x$ and $h$). Rather, the derivative function of $f(x)$ is $$\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}.$$ The limit is important. Without the limit, it's just plain wrong.

Second. I don't know how you "got back" $f(x)$. The computations aren't that bad, just lots of algebra; perhaps you substituted incorrectly?

\begin{align*} f(x) &= \frac{x}{x+2}\\ f(x+h) &= \frac{(x+h)}{(x+h)+2} = \frac{x+h}{x+h+2}\\ f(x+h) - f(x) &= \frac{x+h}{x+h+2} - \frac{x}{x+2}\\ &= \frac{(x+h)(x+2)}{(x+h+2)(x+2)} - \frac{x(x+h+2)}{(x+2)(x+h+2)}\qquad\text{(common denominator)}\\ &= \frac{(x+h)(x+2) - x(x+h+2)}{(x+2)(x+h+2)}\\ &= \frac{x(x+2) + h(x+2) - x(x+2) - xh}{(x+2)(x+h+2)}\\ &= \frac{h(x+2-x)}{(x+2)(x+h+2)}\\ &= \frac{2h}{(x+2)(x+h+2)}. \end{align*} Therefore, \begin{align*} f'(x) &= \lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\\ &= \lim_{h\to 0}\frac{\quad\frac{2h}{(x+2)(x+h+2)}\quad}{h}\\ &= \lim_{h\to 0}\frac{2h}{h(x+2)(x+h+2)}\\ &= \lim_{h\to 0}\frac{2}{(x+2)(x+h+2)} \qquad\text{(since }h\neq 0\text{, so we can cancel)}\\ &= \frac{2}{(x+2)(x+0+2)} \qquad\text{(since the function is defined at }h=0\text{)}\\ &= \frac{2}{(x+2)^2}. \end{align*}

-

I think that you mean that you want to use the definition of the derivative to find the derivative of the function $$f(x)=\frac{x}{x+2}\;.$$ The definition is that $$f\,'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}h\;.$$ Note the limit: it’s essential.

\begin{align*} \lim_{h\to 0}\frac{\frac{x+h}{(x+h)+2}-\frac{x}{x+2}}h&=\lim_{x\to 0}\left(\frac1h\left(\frac{x+h}{(x+h)+2}-\frac{x}{x+2}\right)\right)\\ &=\lim_{h\to 0}\left(\frac1h\cdot\frac{(x+2)(x+h)-x(x+2+h)}{(x+2)(x+2+h)}\right)\\ &=\lim_{h\to 0}\frac{x^2+2x+hx+2h-x^2-2x-hx}{h(x+2)(x+2+h)}\\ &=\lim_{h\to 0}\frac{2h}{h(x+2)(x+2+h)}\\ &=\lim_{h\to 0}\frac2{(x+2)(x+2+h)}\;, \end{align*}

where I’ve simply put the original numerator $f(x+h)-f(x)$ over a common denominator and simplified. At this point we’ve managed to get rid of the factor of $h$ in the denominator, so we can take the limit: as $h\to 0$, the numerator just sits there at $2$, and the denominator approaches $(x+2)(x+2)$, or $(x+2)^2$. Thus,

$$f\,'(x)=\lim_{x\to 0}\frac2{(x+2)(x+2+h)}=\frac2{(x+2)^2}\;.$$

Added: By the way, if your algebra is good enough, you can notice that $$\frac{x}{x+2}=\frac{(x+2)-2}{x+2}=1-\frac2{x+2}\;.$$ Then

\begin{align*} f(x+h)-f(x)&=\left(1-\frac2{(x+h)+2}\right)-\left(1-\frac2{x+2}\right)\\ &=\frac2{x+2}-\frac2{x+2+h}\\ &=\frac{2\big(x+2+h-(x+2)\big)}{(x+2)(x+2+h)}\\ &=\frac{2h}{(x+2)(x+2+h)}\;, \end{align*}

and you reach the point of being able to take the limit a bit more easily.

-