Well it appears that until I finish my current coursework for a master’s degree in Mechanical Engineering, I will have little time to maintain this blog or build up video tutorials. So this will be the last post for a while. However, I am still available for online tutoring. And since it’s online, I can teach anywhere in the world (only in English unfortunately). I teach many mathematics subjects and teach from VCE level (years 11 and 12 in high school) through to university maths (bachelor degree level). If you are interested, please contact me using the Contacts page.

# Author: dolkowski

## The Only Constant is Change (and perhaps the speed of light)

As my time is getting more and more limited and because of the low usage of my webpage, I have decided to suspend the blog content of my webpage and develop video tutorials on various subjects. As it will take time to develop a reasonable amount of content, there will be very little activity on my website for a while. Thank you to all who have read (and hopefully learned from) my website.

## The Derivative, Part 8

Now let’s do some more examples using not only the chain rule, but using a combination of the rules we have covered.

Let me start with an example that illustrates the “chainyness” of the chain rule. Let \[f( x) =\text{sin}\left(\sqrt{x^{2} +2x-7}\right)\]

Notice that there are three operations at work here: the sine, the square root and the polynomial. Referring back to the previous post, which is the outermost function? It’s the sine as that would be the last operation you would perform if you were to actual calculate the function for a particular *x* value. So the derivative rule for the sine is the first differentiation rule we will use.

So we have the sine of “something” so we start with the derivative of that something: \[f'( x) =\text{cos}\left(\sqrt{x^{2} +2x-7} \right)\ ( …)\] Now from the last post, you know you have to multiply this by the derivative of that “something”. It will be helpful to rewrite that “something” as \[\sqrt{x^{2} +2x-7} =\left( x^{2} +2x-7\right)^{1/2}\] Looks like we need to apply the chain rule again as we have an inner (polynomial) and an outer (power) functions.

The derivative of the “something” to the 1/2 power is \[\frac{1}{2}\left( x^{2} +2x-7\right)^{-1/2}( …)\]

We are now left with the innermost function *x*² + 2*x* – 7. The chain rule says to multiply the previous results with the derivative of this innermost function which is 2*x* +2. So putting this in the last (…) and then putting that result in the first (…) gives \[f'( x) =\frac{1}{2}\left( x^{2} +2x-7\right)^{-1/2}( 2x+2)\text{cos}\left(\sqrt{x^{2} +2x-7}\right)\] Do you see how the successive differentiations of the functions from the outermost to the innermost works with the chain rule?

Let’s do another example. Let’s differentiate \[f( x) =\sqrt{\text{sin}( x)\text{cos}( x)}\]

As we did before, it’s easier to see the applicable differentiation rule if you convert the square root to its equivalent exponent form:\[f( x) =\left[{\text{sin}( x)\text{cos}( x)}\right]^{1/2}\]

Hopefully you can now identify the outermost operation as raising “something” to the 1/2 power. So the power rule is the one to use at first:\[f'( x) =\frac{1}{2}[\text{sin}( x)\text{cos}( x)]^{-1/2}( …)\]

So we now need to multiply this by the derivative of the “something” which is sin(*x*)cos(*x*). But this is the multiplication of two functions so we need to use the multiplication rule. Letting *u* = sin(*x*) and *v* = cos(*x*), then *u*‘*v* + *uv*‘ becomes cos²(*x*) – sin²(*x*). So now replacing the (…) with this results in \[f'( x) =\frac{1}{2}[\text{sin}( x)\text{cos}( x)]^{-1/2}\left[\text{cos}^{2}( x) -\text{sin}^{2}( x)\right]\]

This last example highlights the point that to find the derivative of complex functions frequently requires the use of several differentiation rules. You need to be aware of where you are in a particular problem and which rule you are currently working on.

Next time, I will show some examples where the derivatives are used. In the meantime, you can use the results of derivatives found in this post to find the derivative of\[f( x) =\sqrt{\text{sin}( x)\text{cos}( x)}\text{sin}\left(\sqrt{x^{2} +2x-7}\right)\]

## The Derivative, Part 7

So let’s recap: we have a rule to find derivatives of basic functions using a table, a rule to handle a function that is multiplied by a constant, a rule to handle the addition or subtraction of two (or more) functions, a rule to handle the multiplication of two (or more) functions, and a rule to handle the division of two functions. I also did an example where several of these rules can be used finding the derivative of a single function. You would think that this would exhaust all the possibilities and that you can now differentiate any function in the known universe. But alas, there is one more, perhaps the most powerful, rule yet to be presented.

This new rule is called the *chain rule*, so called because it allows you to find the derivative of a function, of a function, of a function, and so on.

Now there is a textbook way to present this rule and an intuitive way which I like to use. I find that the textbook approach can be confusing because there are several variables variables to keep track of. I will present both ways so that you may see the connection between the two and have a better understanding of the chain rule.

The textbook approach to the chain rule is a bit easier to see if we forego functional notation and go back to using *y*. However, whenever you have a function of a function *f*[*g*(*x*)], the chain rule is to be used. Functions like this are called *composite functions*. For example,

Here, *g*(*x*) = *x*² and *f*(*x*) = sin(*x*). So *f*(*x*²) = sin(*x*²).

In the textbook approach you let *u* be the inner function (that is the function you are using as the argument for the outer function) and you let *y* be the function after you replace the inner function with *u*. I will give an explanation later on how to identify the inner and outer functions if that is not clear.

So in this case, *u* = *x*², so *y* = sin(*u*). The textbook chain rule is

This may look scary but let me repeat this rule in English: the derivative of a composite function is the derivative of *y* with respect to *u* times the derivative of *u* with respect to *x*. So in our example, *dy/du* = cos(*u*) (using the table) and *du/dx* = 2*x*. Multiplying these together and replacing *u* with its definition, we get

So to further explain what inner and outer functions are, suppose you wanted to take our example function and calculate its value for a certain number for *x*. The first thing you would do is take that number and square it. The squaring function is the inner function since it is the first thing you would do. Then you would take the sine of that squared number. The sine function then is the outer function as that is the last operation you would do.

So I explain the chain rule as follows: Take the derivative of the outer function of ‘something’ keeping the ‘something’ intact, but since the ‘something’ is not just ‘*x*‘ you need to multiply the result by the derivative of that ‘something’.

In this example, the ‘something’ is *x*². So the derivative of the sine of that ‘something’ is cos(*x*²), but I then need to multiply this by the derivative of the ‘something’. The derivative of *x*² is 2*x*, so the result is 2*x* cos(*x*²).

So now let’s reverse the roles of the the inner and outer functions. Consider the derivative of [sin(*x*)]². A very common shortcut notation for the square of a trig function like this is [sin(*x*)]² = sin²(x). Again, imagine actually calculating this for a particular value of *x*. You would first take the sine of that number (the inner function) then square the result (the outer function). We know that the derivative of the square of ‘something’ is 2 times that ‘something’ to the first power which in this case is 2 sin(*x*). But to compensate for this simplification, we need to multiply the result by the derivative of that ‘something’. In this case, the derivative of sin(*x*) is cos(*x*), so the final answer is 2 sin(*x*)cos(*x*).

Now to get comfortable with this, we need to do some more examples. I will do that in my next post.

## The Derivative, Part 6

Last time I presented the multiplication rule of differentiation to be used when given a function that is the multiplication of two or more other functions. As you would guess, there is also a rule that handles the division of two functions.

Let’s say you have the function

\[ f( x) =\frac{x^{2}}{\text{sin}( x)}\]This one can be solved with the multiplication rule if you remember that 1/sin(*x*) = csc(*x*). But as I haven’t told you what the derivative of csc(*x*) is, we are stuck using the following division rule. But this highlights the point that as we get deeper into maths, there are often several ways to solve a problem. The maths “arteest” is one that solves a problem elegantly.

So the following rule is the division rule. Again, I will use *u*(*x*) and *v*(*x*) to split the function up into its parts. If you have a function of the form

then the derivative of *f*(*x*) is

As you can see, this rule is a bit more complex which is why you would use a simpler rule if possible. But it is still relatively easy to use if you keep track of which part is *u* and which part is *v*.

Using the example function above,

\[\begin{array}{{>{\displaystyle}l}} u( x) =x^{2} ,\ \ \ \ \ v( x) =\text{sin}( x)\\ u'( x) =2x,\ \ \ \ v'( x) =\text{cos}( x) \end{array}\]So according to the division rule,

\[f'( x) =\frac{x^{2}\text{cos}( x) -2x\text{sin}( x)}{\text{sin}^{2}( x)}\]Now you can use many rules in a single differentiation problem consider

\[f( x) =\frac{x^{2} e^{x}}{\text{sin}( x)}\]Here, the numerator is a multiplication of two functions. So when using the division rule, you need to apply the multiplication rule for the *u*‘ part:

u( x) \ =\ x^{2} e^{x} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ v( x) =\text{sin}( x)\\

u'( x) =x^{2} e^{x} +2xe^{x} \ \ \ \ \ v'( x) =\text{cos}( x)

\end{array}\]

I’ll leave it as an exercise for you to see if I correctly found *u*‘(*x*) using the multiplication rule. I used the fact that (as seen from the table I provided a couple of posts before) *eˣ* is its own derivative. Anyway, using the division rule,

So you might be thinking that you can differentiate any function as long as you know the derivatives of the individual parts. So how would you differentiate

\[ f( x) =\text{sin}\left( x^{2}\right) ?\]This is not a multiplication of functions, but rather a function of a function. I will introduce the very powerful *chain rule* as it applies to differentiation in my next post.

## The Derivative, Part 5

So last time, I provided a table of derivatives given a function that is of a particular form. Because of rules 3 and 4 (you will need to see my last post to see what these are), along with the other entries in the table, you can now differentiate many functions not specifically in the table. But there are still many functions that you cannot differentiate without other rules. For example, if

\[f( x) =x^{2}\text{sin}( x)\]there is no table entry to help you. Even though you can differentiate *x*² and sin(*x*) separately, there is no rule in the table that allows you to differentiate their multiplication together since they are both functions of *x*, that is, neither one is just a constant. You can’t use rule 4 here.

There is a differentiation rule that handles this. It is the multiplication rule and it states that if you have a function of the form

\[f( x) =u( x) v( x)\]then the derivative is

\[f'( x) =u( x) v'( x) +u'( x) v( x)\]This can be proven using the basic definition of a derivative, but you can just take my word for it.

So in the example at the beginning of this post,

\[\begin{array}{{>{\displaystyle}l}}u( x) =x^{2} ,\ \ \ \ \ v( x) =\text{sin}( x)\\

u'( x) =2x,\ \ \ \ v'( x) =\text{cos}( x)

\end{array}\]

where I used the table in my last post to find the individual derivatives. So according to the rule,

\[f'( x) =x^{2}\text{cos}( x) +2x\text{sin}( x)\]Now this rule can be extended to handle more than two functions multiplied together. If

\[f( x) =u( x) v( x) w( x)\]then you can use the original rule twice, or

\[ f'( x) =u( x) v( x) w'( x) +u( x) v'( x) w( x) +u'( x) v( x) w( x)\]I think you can see the pattern here. So if

\[\begin{array}{{>{\displaystyle}l}}f( x) =x^{2}\text{sin}( x)\text{cos}( x)\\

u( x) =x^{2} ,\ \ v( x) =\text{sin}( x) ,\ \ \ w( x) =\text{cos}( x)\\

u'( x) =2x,\ \ v'( x) =\text{cos}( x) ,\ \ w'( x) =-\text{sin}( x)

\end{array}\]

So the derivative is

\[f'( x) =-x^{2}\text{sin}^{2}( x) +x^{2}\text{cos}^{2}( x) +2x\text{sin}( x)\text{cos}( x)\]Now this can be simplified using trig identities but I will leave it here.

What about a function that’s a division of two functions? Yes there is rule for that as well, but I’ll cover that in my next post.

## The Derivative, Part 4

Last time I provided some general rules for finding the derivatives for functions of different forms. Let me summarise these and provide some new ones as well. The new ones can be developed using the basic definition of the derivative. Letters *a*, and *n* are constants and are not a function variable:

f(x) | f‘(x) | |

1 | \[a\] | \[0\] |

2 | \[x^{n}\] | \[nx^{n-1}\] |

3 | \[g(x)±h(x)\] | \[g'(x)±h'(x)\] |

4 | \[ag(x)\] | \[ag'(x)\] |

5 | \[e^{ax}\] | \[ae^{x}\] |

6 | \[\text{sin}(nx)\] | \[n\text{cos}(nx)\] |

7 | \[\text{cos}(nx)\] | \[-n\text{sin}(nx)\] |

8 | \[\text{tan}(nx)\] | \[n\text{sec}^{2}(nx)\] |

These rules can be used for more than the explicit function forms included, especially using rules 3 and 4. For example if

\[f( x) =3x^{3} -2x^{2} +5x-7\]then by using rules 2, 3, and 4 you can find the derivative as

\[f'( x) =9x^{2} -4x +5\]Now let’s look at a more complex function:

\[f( x) =3\text{sin}( 2x) -2\text{cos}( 3x) -0.25x^{2}\]where *x* is in radians. We can use rules 2, 3, 4, 6, and 7 and take the derivative of each term to get

Now let’s look at a common use for derivatives. It is often needed to find the maximum and minimum of a function. Let’s look at the function *f*(*x*) = 3*x*³-10*x*²+9*x*:

We would like to know where (the *x* value) the peak (local maximum) and the local minimum occur and what the values of the function are at those points. As you have seen before, the gradient of the tangent lines at these points are zero. Since the derivative of a function gives us the gradient, we can find the derivative and find the values of *x* that make it zero. Using our rules for derivatives, *f*‘(*x*) = 9*x*²-20*x*+9. So we want to find the solutions to

*f*‘(*x*) = 9*x*²-20*x*+9 = 0

Using the quadratic formula, the two solutions are *x* = 0.627 and 1.595. We can evaluate the original function at these values of *x* to get the two points (0.627, 2.451) as the local maximum and (1.595, 1.088) as the local minimum.

A practical use of this is to find the maximum height a ball achieves that is thrown up into the air. Using physics to come up with the equations of motion of the ball, one can find the answer.

Even though I have shown that we can now differentiate a plethora of functions, there are still some functional forms that we cannot differentiate using the rules presented so far. I will cover some new rules in my next post.

## The Derivative, Part 3

Now that we have some confidence that the derivative definition gives correct results of functions that we know the answer to, let’s look at a functional form where the answer is not known.

Consider *f*(*x*) = *x*². As you know, this function plots as the standard parabola. The slope of a tangent line on this curve (its rate of change) is not constant, unlike the cases we have looked at before, but it depends on where we are on the curve:

So we again start with the basic definition of the derivative:

\[f'( x) =\lim _{h\rightarrow 0}\frac{f( x+h) -f( x)}{h} = \lim _{h\rightarrow 0}\frac{( x+h)^{2} -x^{2}}{h} =\] \[ \lim _{h\rightarrow 0}\frac{x^{2} +2xh+h^{2} -x^{2}}{h} =\lim _{h\rightarrow 0}\frac{h( 2x+h)}{h} =\lim _{h\rightarrow 0}( 2x+h) =2x\]So again, we do some algebraic manipulation that gets rid of the *h* in the denominator. Remember, as we are taking the limit as *h* approaches 0, the *x* is essentially treated as a constant. So the final answer is *f*‘(*x*) = 2*x*. Refering back to the graph, this satisfies the tangent line slopes at -1 and 1: *f*‘(*-1*) = -2, *f*‘(*1*) = 2. At any other point on the graph, just evaluate *f*‘(*x*) = 2*x* to find the rate of change of *f*(*x*) = *x*² at a particular *x*.

Now do you have to evaluate the definition for every different function you come across? Thankfully, the answer is no. Mathematicians have long ago done the hard work for you but because of the properties of limits, many general rules can be made. For example, if you know the derivative of a function, but what you have is the same function but multiplied by a constant, the derivative of this new function is just the same constant times the derivative of the old function. For example, we now know that for *f*(*x*) = *x*², *f*‘(*x*) = 2*x*. But what about *g*(*x*) = 3*x*²? Well, *g*‘(*x*) will just be 3 times the derivative of *x*², so *g*‘(*x*) = 6*x*.

So the rule is, if *g*(*x*) = *af*(*x*) where *a* is a constant number, then *g*‘(*x*) = *af*‘(*x*). Another generic rule is that the derivative of a sum of functions is the sum of the individual derivatives: If *h*(*x*) = *f*(*x*) + *g*(*x*), then *h*‘(*x*) = *f*‘(*x*) + *g*‘(*x*).

It turns out that if

\[f( x) =ax^{n}\]where *n* is any real number except -1, then

So to find the derivative in this case, you just multiply the function by *n* and reduce the value of the exponent by 1.

Next time, I will present a table of common derivatives and do some sample problems.

## The Derivative, Part 2

I ended my last post with the rather daunting definition of the derivative:

\[f'( x) \ =\lim _{h\rightarrow 0} \ \frac{f( x+h) -f( x)}{h}\]I will now show how this definition can be used to find much simpler ways to calculate a derivative.

Let’s start with an example that we already know the answer to and is the simplest function we can think of, *f*(*x*) = *c* where *c* is some constant. You know that if the function does not change anywhere over the values of *x*, its rate of change (derivative) is zero. You see this if you plotted the function – it’s a horizontal line and a horizontal line has a gradient of zero. So *f*‘(*x*) = 0. Let’s see if the derivative definition gives us the same answer.

Well that didn’t help much – we just got an indeterminate form 0/0. But as I said in my last post, there will always be some algebraic manipulation required to remove the problem.

One common method is to multiply the numerator and denominator by the same fraction. This does not change the value of the expression but if you use the right fraction, it removes the issue. In this case, multiply top and bottom by 1/*h*.

Notice that by doing that, we got rid of *h* and we are left with 0/1 which is definitely 0. So the first rule of finding a derivative: if *f*(*x*) = *c*, then *f*‘(*x*) = 0.

Now let’s look at a more complex function, but again, one you know the answer to. The generic equation of a line is *f*(*x*) = *mx* + *c* where *m* and *c* are specific numbers: *f*(*x*) = 3*x* + 7 is an example. Again, from your studies of linear equations, you know this kind of function will plot as a straight line with a gradient of *m*. So we know that if *f*(*x*) = *mx* + *c*, then *f*‘(*x*) = *m*. Does our definition give the same result?

So when we enter in the particular function into the definition, then expand it, get rid of the terms that cancel, then cancel the common factor *h*, we again get rid of the dependency on *h*. We are left with the limit of a constant *m* as *h* approaches 0. But as *m *does not care what *h* does, the answer is just *m* – just what we expected. So we now know if *f*(*x*) = *mx* + *c*, then *f*‘(*x*) = *m*.

Next time, I will do the same thing but use functions for which we don’t know the answer.

## The Derivative, Part 1

In my last post, I showed that the rate of change of any function that plots as a straight line (a linear function) has a constant rate of change and that value is the gradient of the line. However, for a nonlinear function, its rate of change depends on the value of *x*, that is, where you are on its graph. I also said that a function’s rate of change is called the derivative of the function and that is what I will call it from now on.

Graphically, the derivative at a particular *x* value is the gradient of the tangent line at that point:

We would like to find an easy way to mathematically find this value as opposed to graphing the function and estimating the tangent line’s gradient at the desired points. Clearly, as seen above, the derivative is another function of *x* as its value changes depending on what *x* is. There are several ways to denote the derivative, but we will start with *f’*(*x*) (read as “f prime of x”). We would like to find what *f’*(*x*) is given a function *f*(*x*).

I know that the following derivation of the derivative may look complex and begs the question about how easy it will be to find the derivative, but following this will help solidify your understanding of what a derivative is and the final result will be used many times to find the easy results for various function forms.

We begin by taking the graph of a function and drawing a secant line (a line that connects two points on the graph) and calculate the gradient of that line:

We want to know the gradient of the estimated tangent line which we are using to approximate the tangent line at *x*. From your study of linear equations, you know that the gradient of a line can be found from any two points on the line. The two points on our estimated tangent line are (*x*, *f*(*x*)) and (*x*+*h*, *f*(*x*+*h*)) where *h* is a small distance away from *x*. Using these two points, we find the gradient by calculating the rise from the first point to the second point divided by the run between the two points. The rise is the difference between the *y* coordinates and the run is the difference between the *x* coordinates (*h*):

Now what happens as *h* gets smaller? The estimate should get closer to the actual value we are seeking. The below graphic from IkamusumeFan [CC BY-SA (https://creativecommons.org/licenses/by-sa/3.0)] illustrates this:

So it appears that we are interested in what our estimated gradient approaches as *h* approaches zero. This is, in fact, the formal definition of a function’s derivative. Remember my post on limits? Using limit notation then, the definition of the derivative is

Notice that if we just substitute zero for *h* to evaluate the limit, we get the indeterminate form 0/0 as explained in my prior post. So again you may be saying “this doesn’t make finding a derivative easy at all”. At this point, you are correct. But in my next post, I will show how this definition is used to simplify derivatives.