This tutorial is going to show you the *easy* side of differentiating. In the examples from the article before we had to do quite a bit of work. Believe it or not those examples are pretty trivial. We are going to use that very general method of differentiating to develop some rules that we can use without thinking twice about it. We will start off easy with something that is actually common sense: the derivative of a constant function. An example of a constant function: f (x) = 4 . The graph of f is only a horizontal line that intersects the y-axis at four. So, the derivative of this function at any point is going to be zero. We have just developed our first rule: If f(x) = a , where a is any constant then, f'(x) = 0
// The derivative of a constant function is always zero
Since we have learned that a derivative is merely a limit many of the same rules apply. One of the best rules we had for limits was that when you are trying to compute the limit of the sum of two functions you could simply evaluate each function separately and then add the two limits. You can do the same with derivatives: d d d
-- [ f(x) + g(x) ] = -- f(x) + -- g(x)
dx dx dx
// and of course, if you can do it with addition you can do it with subtraction
d d d
-- [ f(x) - g(x) ] = -- f(x) - -- g(x)
dx dx dx
Next, if you have function which is multiplied by a constant you can simply differentiate the function and then multiply the derivative by the constant. For example, in the previous article we found the derivative of (x2) to be (2x). But what if we had to differentiate (4x2). This new rule tells us that you only need to differentiate (x2) and then multiply the derivative by four. So the derivative of (4x2) would be (8x) because (2x * 4 = 8x). In math terms the rule states: d d
-- [ a*f(x) ] = a * -- f(x) , where a is any constant
dx dx
This is about where the limit rules no longer apply. Say we were give: f(x) = xn , where n is a constant. The limit rules told us that we could just evaluate the limit of x and then take it to the nth power. For differentiating we have a different rule called the power rule. It states: d
-- xn = n*x(n-1) , where n is a constant
dx
So, to evaluate the derivative of a variable which has been taken to a constant power simply multiply the term by that power and subtract one from the power. A few examples: 1.) f(x) = x3 --so-- f'(x) = 3x2
2.) f(x) = x5 --so-- f'(x) = 5x4
3.) f(x) = x100 --so-- f'(x) = 100x99
4.) f(x) = 3x6 --so-- f'(x) = 3 * (6x5) = 18x5
Note that in example number four I used two rules: the power rule and
the rule that told us we could take out the constant, three, evaluate the
derivative of (x6), and then multiply the derivative by the
constant. See how easy things are becoming already? That last example
would have taken (most likely) a good twenty minutes or so to
evaluate our old way. I'm probably over estimating there but I would not
want to be the person who had to do it. And for those who cannot stand
being given information without know why it works here is the derivation
of the power rule: Differentiate: f(x) = xn , where n is a constant
// I am going to use the non-limit method for differentiating this...mainly
because it is easier (and shorter) to write out
y + dy = (x + dx)n
// use Binomial Theorem to expand the above
n*(n-1)
= xn + nx(n-1)*dx + -------*x(n-2)*dx2 + .... + nx*dx(n-1) + dxn
2
// subtract our original equation from the above:
/ n*(n-1) \
| y + dy = xn + nx(n-1)*dx + -------*x(n-2)*dx2 + .... + nx*dx(n-1) + dxn |
\ 2 /
- [ y = xn ]
-----------------------------------------------------------------------------------
n*(n-1)
dy = nx(n-1)*dx + -------*x(n-2)*dx2 + .... + nx*dx(n-1) + dxn
2
// all terms with dx to a power greater than one will cancel out and
we are left with:
dy = nx(n-1) * dx
// divide both sides by dx
dy
-- = nx(n-1) // power rule
dxBefore we go on to some of the harder rules let us look at
an example incorporating everything we have learned so far: Differentiate: f(x) = 3x4 - 2x3 + x2 - 8x + 2
// from the second rule we know that we can evaluate all the terms
separately and then add (or subtract) them all together:
d d d d d d
-- = -- (3x4) - -- (2x3) + -- (x2) - -- (8x) + -- (2)
dx dx dx dx dx dx
// from the third rule we know that we can take out the coefficients
of each term and multiply them by the derivative of x-part of the term. Also
the first rule we learned tells us that the derivative of the last term in the
How amazingly easy! These new rules helped us evaluate something which would have been a pain to do with our old way. But, in general, the above examples are very easy. Polynomials are the easiest functions to deal with in calculus. The next set of rules will help us tackle complex functions. What if we were to encounter two functions which were being multiplied together. We could not simply differentiate each function and the multiply the derivatives because we would be leaving out some middle terms. Therefore, let us deal with a general case and try to come up with some rule to use. Something like this: Differentiate: y = u * w , where u and w are both functions of x. For example,
y = (2x2 + 3x)(4x3-x+1) , thus [u = 2x2+3x] and [w = 4x3-x+1]
// Since we are dealing with a general case here it does not matter what u
and w are because it should work with anything you substitute for them. To
come up with a new rule I am going to be using the non-limit way of
differentiating.
// All our x's and y's becomes (x+dx)'s and (y+dy)'s thus our u's and w's become
(u+du)'s and (w+dw)'s :
y + dy = (u + du)(w + dw)
// Expand the binomial (u+du)(w+dw)
y + dy = u*w + u*dw + w*du + du*dw
// Since du and dw are already indefinitely small when you multiply them
together they become even small therefore you do not need to worry about
that term:
y + dy = u*w + u*dw + w*du
// Now subtract our original equation (y=u*v) from the one above and you are
left with:
dy = u*dw + w*du
// finally divide everything by dx
dy dw du
-- = u*-- + w*--
dx dx dx
The above rule is called the power rule. In English: to differentiate the product of two functions multiply the derivative of one function by the other function plus the derivative of the other function multiplied by the first function. This rule can be a lot to take in at once so an example is probably best right now: Differentiate: y = (x3 - x2 + 1)(x2 + 2x)
// From the above equation we know that:
u = x3-x2+1 and w = x2+2x
// And from the product rule we know that:
dy dw du
-- = u*-- + w*--
dx dx dx
// So our strategy is to first differentiate functions u and w, then multiply
the derivatives by the function of the other term, and finally sum the two
together...like this:
dy d d
-- = (x3-x2+1) * -- (x2+2x) + (x2+2x) * -- (x3-x2+1)
dx dx dx
// The derivatives of u and w are pretty trivial so I will not go much into that:
dy
-- = (x3-x2+1)*(2x+2) + (x2+2x)*(3x2-2x)
dx
// Multiply all terms out:
dy
-- = (2x4+2x3-2x3-2x2+2x+2) + (3x4-2x3+6x3-4x2)
dx
// simplify
dy
-- = 5x4 + 4x3 - 6x2 + 2x + 2
dx
And that is our final answer. But, instead of doing all of that above
work, what if we had just started out by expanding the [(x3-x2+1)(x2+2x)]
term into on big polynomial and then proceeding with all the trivial
differentiating tricks? Yes, it would have been much easier to do
that first. However, soon we will not be able to do that. I cannot show
you any examples of when you will not be able to do that just yet because
we still have more to learn. Differentiate: x4 - 3x2 + 8x + 1
y = -------------------
2x3 - x2 + 2x - 5
We cannot simply differentiate the top and bottom separately and then divide the two because we would be leaving out a lot of middle terms. We need to develop a general rule for solving this problem. First we will use a function, u, for the numerator and a function, w, for the denominator. Therefore we have: u
y = ---
w
I am going to use the non-limit way to differentiate this so when the y's and x's become (y+dy)'s and (x+dx)'s the u's and w's will become (u+du)'s and (w+dw)'s and we have: u + du
y + dy = ------
w + dw
Now a few things to say here. Dividing two polynomials is a pretty difficult task...actually more tedious than anything. It is probably one of the hardest things a person can do in a high school Algebra class. That is what I am about to do here. I'm not going to be able to comment my steps because the way the work is going to be laid out but just try your best to follow along. It is not necessary to get this so do not worry if you are having trouble: u du u*dw
--- + --- - ----
w w w2
|----------------
w + dw | u + du
/ u*dw \
-|u + ---- |
\ w /
-------------
u*dw
du - ----
w
/ du*dw \
-|du + ----- |
\ w /
--------------
-u*dw du*dw
----- - -----
w w
/-u*dw u*dw2 \
-|----- - ----- |
\ w w2 /
--------------------
-du*dw u*dw2 // note: we are now dealing with really small
------ + ----- numbers so we can quit
w w2
Our remainders started getting really small so we could just stop there. But, we are still not done. Take the quotient from above and combine the second and third term. We want to leave the first term as is so that when we subtract our original equation from the above everything will work out nicely. Here is the rest of the work: Start with this:
u du u*dw
y + dy = --- + --- - ----
w w w2
// get the second term to have the same base as the third (so you can combine
the two) by multiplying it by (w/w)
u du*w u*dw u du*w - u*dw
y + dy = --- + ----- - ---- = --- + -----------
w w2 w2 w w2
// Subtract the original equation [y=u/w] from the above:
w*du - u*dw
dy = -----------
w2
// divide everything by dx
du dw
w*-- - u*--
dy dx dx <-- The quotient rule
-- = ------------
dx w2
That right there is the derivation of the quotient rule. You use this when trying to differentiate two functions that are divided by each other. In English: the derivative of the quotient is the denominator times the derivative of the numerator minus the numerator times the derivative of the denominator, all over the denominator squared. This is probably the hardest rule there is to learn so let's look at an example: Differentiate: x2
f(x) = ------
x2 + 1
// Let [u=x2] and [w=x2+1] therefore the quotient rules tells us that:
du dw
w*-- - u*--
dy dx dx
-- = ------------
dx w2
// Plugging the functions we have in the above gives us:
d d
(x2+1)*--(x2) - (x2)*--(x2+1)
dy dx dx
-- = -----------------------------
dx (x2 + 1)2
// The derivatives of [x2] and [x2+1] are pretty easy to evaluate so I'll do
that first:
dy (x2+1)(2x) - (x2)(2x)
-- = ---------------------
dx (x2 + 1)2
// Next I'm going to simplify the numerator by solving the parentheses:
dy 2x3 + 2x - 2x3
-- = --------------
dx (x2 + 1)2
// Simplify the numerator more by canceling out the positive and negative
[2x3] term:
dy 2x
-- = --------- <-- Final answer
dx (x2+1)2
And you can stop right about there. You could have expanded the
binomial in the denominator but there really is no point since you cannot
simplify it anymore. That was probably more difficult than our other
examples but still pretty easy. Differentiate: f(x) = (x3 - 1)3/4 That is: x to the third minus x all to the three-fourths power. None of the rules we have learned so far would help us. Even using the general rule we learned in the last tutorial would be extremely difficult (if not impossible). The new rule which will help us evaluate the above is called the chain rule. The chain rule is used for finding the derivatives of composite functions. If you did not see it then the above is a composite function. You could think of it like this: f(x) = g(h(x)) , where [g(x) = x3/4] and [h(x) = x3-1] Do you see? You should if you read my tutorial on functions. If you did not, do so now. In a general form, the chain rules says: f(x) = g(h(x)) --> f'(x) = g'(h(x)) * g'(x)
// here is an easier notation to read:
y = f(u) , where [u = g(x)], then:
dy dy du
-- = -- * --
dx du dx
This rule is probably not making too much sense right now. An example will most likely help you out though: y = (x3 - 1)3/4
// From the above we are going to make two other equations:
u = x3 - 1
y = u3/4
// Do you agree that the above is saying pretty much the same as the first
equation? The chain rule says all we have to do is differentiate these
two equations separately and then multiply their derivatives
together...how easy!...
// First differentiate u with respect to x
du
-- = 3x2
dx
// Next differentiate y with respect to u
dy
-- = (3/4)*u-1/4
du
// Then multiply the two derivatives together for differentiation of y with
respect to x
dy dy du
-- = -- * -- = (3/4)*u-1/4 * 3x2
dx du dx
// Simplify the above a little:
dy 9x2
-- = --- * u-1/4
dx 4
// Now that would be the final answer but remember that there was no u in the
original equation so all we do is put [x3-1] back in for u
dy 9x2
-- = ---*(x3-1)-1/4
dx 4
The above equation is a pretty nasty looking one but it is correct (I
think...I double checked my work but I could have gone wrong somewhere).
|