The Basics of Differentiation [OLD VER]

Differentiation is one of two major concepts in calculus, besides integration. Differentiation is the process of finding a derivative of a function. The term derivative itself refers to an expression that describes the instantaneous rate of change of a function with respect to a variable.

Confused? Don't worry. I'll not be angry at you just because you're confused. Being confused is normal in the process of learning, especially when it's the first time you hear a term new to you. We'll take a gradual approach to understand it.

Now, before we dig deeper, we should understand other concepts involved in differentiation. 

Pre-understanding

Change

When you hear the term change, what's in your mind? What does change mean?

Change, as the word suggests, refers to the change of the value of something. The change, logically speaking, can be calculated by measuring the "gap" between the new value and the old value. Let's take a look at the following picture

Mathematically, it will be expressed as

$$ \Delta x = x'-x_0 $$

where \( \Delta x \) denotes the change in variable \( x \), \( x' \) denotes the new value of variable \( x \), and \( x_0 \) denotes the old value of  variable \( x \).

(Tips: remember that uppercase Greek letter Delta, Δ, usually means "the change in (something)")

Rate of Change

Think of a function as a machine that takes a variable as an input, let's say \( x \), and produces an output, let's say \( f(x) \). If we change the input, the output should change too, right? Rate of change is, basically, about how fast the change in the output when we change the input. You can therefore think the rate of change as the ratio of the change in the output to the change in the input.

Mathematically, it will be expressed as

Rate of Change = \( \frac{\Delta f(x)}{\Delta x} \) = \( \frac{f(x')-f(x_0)}{x'-x_0} \)

where \( \Delta f(x) \) denotes the change in the output of function \( f(x) \)

Previously, we have learned that

$$ \Delta x = x'-x_0 $$

So, we can say,

$$ x_0 + \Delta x = x' $$

Thus, we can also say,

Rate of Change = \( \frac{f(x_0+\Delta x)-f(x_0)}{(x_0+\Delta x)-x_0} \) = \( \frac{f(x_0+\Delta x)-f(x_0)}{\Delta x} \)

But wait! There's a problem. If the function is a linear function, for example \( f(x)=2x+2 \), it does work fine. For example, let's assume some different conditions when we

(1) increase the value of \( x \) by 3, and

(2) increase the value of \( x \) by 5, and

(3) decrease the value of \( x \) by 4.

For the 1st condition, the rate of change will be

$$ \begin{aligned} \frac{f(x+3)-f(x)}{3} &= \frac{(2(x+3)+2)-(2x+2)}{3} \\ &= \frac{2x+6+2-2x-2}{3} \\ &= \frac{6}{3} \\ &= 2  \end{aligned} $$

For the 2nd condition,

$$ \begin{aligned} \frac{f(x+5)-f(x)}{5} &= \frac{(2(x+5)+2)-(2x+2)}{5} \\ &= \frac{2x+10+2-2x-2}{5} \\ &= \frac{10}{5} \\ &= 2 \end{aligned} $$

And for the 3rd condition,

$$ \begin{aligned} \frac{f(x-4)-f(x)}{-4} &= \frac{(2(x-4)+2)-(2x-2)}{-4} \\ &= \frac{2x-8+2-2x-2}{-4} \\ &= \frac{-8}{-4} \\ &= 2  \end{aligned} $$

We can see that for a linear function, the rate of change will stay the same regardless the initial value of x and how big the change is. 

However, if the function is a non-linear function, for example \( f(x) = x^2 \), when we apply the 1st condition, the rate of change will be

$$ \begin{aligned} \frac{f(x+3)-f(x)}{3} &= \frac{(x+3)^2-x^2}{3} \\ &= \frac{x^2+6x+9-x^2}{3} \\ &= \frac{6x+9}{3} \\ &= 2x+3 \end{aligned} $$

Whoops, by just applying the first condition, we can immediately see that the rate of change doesn't stay the same! If we take a different initial value for \( x \), we can deduce right away that the rate of change will be different too.

Therefore, it wouldn't be perfectly right to call it the rate of change. It's actually the average rate of change. So, our previous formula should be corrected to

Average Rate of Change = \( \frac{f(x_0+\Delta x)-f(x_0)}{\Delta x} \)

If we draw a straight line that crosses between two distinct points in the curve, the line we draw is called the secant line. The gradient of the secant line is

$$ \begin{aligned} m&=\frac{\Delta f(x)}{\Delta x} \\ m&=\frac{f(x+\Delta x)-f(x)}{\Delta x} \end{aligned}$$

where \( m \) is the gradient of the secant line crossing between the points \( (x,f(x)) \) and \( (x+\Delta x, f(x+\Delta x)) \).

It can be concluded that the gradient of the secant line is equal to the average rate of change between those points.

Understanding the Concept of Differentiation

At the beginning, I mentioned that "The term derivative itself refers to an expression that describes the instantaneous rate of change of a function with respect to a variable."

What's in your mind when you hear the word instantaneous? Something that was done in an instant moment? Something that was happening in an instant moment that you didn't see or feel the event at all?

So, instantaneous rate of change can be interpreted as the rate of change, when the input changes so instantaneously that it seems like it doesn't change at all. So, it means, the change in the input is so small. So small that it's infinitely close to zero.

Hol' up! Zero? But... but... if we substitute zero to the formula, wouldn't it just result the infinity or undefined number?

Nah, I don't say that the it's really zero, but instead, it's infinitely close to zero, or in other words, approaching zero. So, the derivative of a function should be equal to the limit of the rate of change of the function, as the change in the input approaches zero.

Mathematically, it will be expressed as

$$ \frac{df(x)}{dx}=\lim_{\Delta x \to 0} \frac{f(x+\Delta x)-f(x)}{\Delta x} $$

in Leibniz's notation. Or you can also use the Newton's notation

$$ f'(x)=\lim_{\Delta x \to 0} \frac{f(x+\Delta x)-f(x)}{\Delta x} $$

Oh, and by the way, the notation \( \frac{df(x)}{dx} \) is read as "the derivative of \( f(x) \) with respect to \( x \)".

Example

1.) Consider a function \( f(x)=2x^2 \). The derivative of the function is

$$ \begin{aligned} \frac{df(x)}{dx}&=\lim_{\Delta x \to 0} \frac{f(x+\Delta x)-f(x)}{\Delta x} \\&=\lim_{\Delta x \to 0} \frac{2(x+\Delta x)^2-2x^2}{\Delta x} \\&=\lim_{\Delta x \to 0} \frac{2(x^2+2x\Delta x+\Delta x^2)-2x^2}{\Delta x} \\&=\lim_{\Delta x \to 0} \frac{2x^2+4x\Delta x+2\Delta x^2-2x^2}{\Delta x} \\&=\lim_{\Delta x \to 0} \frac{4x\Delta x+2\Delta x^2}{\Delta x} \\&=\lim_{\Delta x \to 0} \frac{\Delta x(4x+2\Delta x)}{\Delta x} \\&=\lim_{\Delta x \to 0} 4x+2\Delta x \\&=4x+2(0) \\&=4x \end{aligned} $$

2.) Consider a function \( f(x)=\frac{1}{x} \). The derivative of the function is

$$ \begin{aligned} \frac{df(x)}{dx}&=\lim_{\Delta x \to 0} \frac{f(x+\Delta x)-f(x)}{\Delta x} \\&=\lim_{\Delta x \to 0} \frac{\frac{1}{x+\Delta x}-\frac{1}{x}}{\Delta x} \\&=\lim_{\Delta x \to 0} \frac{\frac{x-(x+\Delta x)}{(x+\Delta x)x}}{\Delta x} \\&=\lim_{\Delta x \to 0} \frac{x-x-\Delta x}{(x+\Delta x)x\Delta x}\\&=\lim_{\Delta x \to 0} \frac{-\Delta x}{(x+\Delta x)x\Delta x} \\&=\lim_{\Delta x \to 0} \frac{-1}{(x+\Delta x)x} \\&=\frac{-1}{(x+0)x} \\&=\frac{-1}{x^2} \end{aligned} $$

Do you notice something? Evaluating the limit is slightly different from simply evaluating a function where we just substitute the input, calculate it, and we're done. When we calculate the limit, we "simplify" the algebra first, only then we evaluate the limit. In this case, we need to manipulate the algebra so it wouldn't involve a division by zero when we substitute the value of \( \Delta x \), because division by zero will produce an infinity or undefined. 

There might be some cases when it can't be avoided, so the limit will be undefined.

What Does the Derivative Tell Us?

Let's see the following graph.

The orange-yellowish curve represents the function \( f(x)=2x^2 \) and the green-bluish straight line represents its derivative, \( f'(x)=4x \). 

Now, scan the curve while also keeping eyes on the straight line, which is the value of the derivative. What have we found? As the curve goes from left to right, the curve is slowly "flattening" while the value of the derivative keeps increasing from negative. Right at the moment the curve turns from going down to going up, the derivative touches zero. Then, when the curve is going up again, the value of the derivative now touches the positive area and keeps increasing.

So, what's all of this about? What does the derivative tell us? To put it simply, the derivative tells us about the gradient at a single point in the function.

We should break down the explanation, shouldn't we? Gradient (or some people call it slope), as we all might have known, describes about the steepness of a line. A positive gradient means that the line is going up, and a negative gradient means the line is going down. And the bigger the absolute value of the gradient is, the steeper the line will go.

But, wait! Why does it have to be "the absolute value of the gradient"? Why not simply "the gradient"? 

Let's think for a moment. Let's imagine two lines, one line with gradient 2, and the other with gradient -2. If we plot those lines to a graph, we should be able to see, while the direction of each line is different, one is going up and the other is going down, the steepness level of each line is the same.

Then, if we increase a negative number, its absolute value will decrease, Again, WHY? It's actually easy when you remember that \( -2 > -3 \) while \( 2 < 3 \). So, when we change the gradient from \( -3 \) to \( -2 \), the gradient is indeed increased by \( 1 \) since \( -3+1=(-2) \), but the steepness decreases.

Ultimately, because the gradient is constantly changing, it won't produce a straight line and instead will produce a curve when being plotted to a graph.

Now, remember again that the derivative is the instantaneous rate of change. The change in the input is is infinitely close to zero. That causes the gap between \( f(x) \) and \( f(x+\Delta x) \) is also infinitely close to zero. If we try to draw a line that supposedly crosses those points, we will instead get a line that only touches them. Thus, the said line can't be called the secant line anymore, but it's now called the tangent line.

Just like how the gradient of the secant line is equal to the average rate of change, the gradient of the tangent line is equal to the instantaneous rate of change, or in other words, equal to the derivative.

And that concludes for the explanation of the basics of differentiation. I don't talk about the rules of differentiation because I only talk about the basic concepts first for now.

I'm just an amateur. But, I hope this post can benefit anyone who reads this.

~~~

(Extra info #1: you can also interpret gradient as how fast the output will change when we change the input. The faster the output changes, the steeper the plotted line will be. So, to put it easy, the gradient is the same as the [average] rate of change)

(Extra info #2: the result of differentiation, the derivative, is a new function. Thus, we can also differentiate it even further)

Comments

Popular posts from this blog

Making Sense of Algebra: The Basic Concepts [OLD VER]

Introduction to Physics