This post is meant for readers familiar with algebra and derivatives, but want to deepen their understanding and/or need a refresh.
Linear functions
Let’s start with a family of very basic functions: the linear functions, expressed as f(x)=ax+b. You might remember its derivative is f′(x)=a, because x is multiplied by a and the constant b “disappears” when taking the derivative. This is correct, but let’s actually calculate the derivative. Since f(x) is a linear function, f′(x) is the same for all x. That is, a linear function “goes up” with the same “speed” everywhere, as can be seen in the following graph for g(x)=2x+5:
For example, between x=0 and x=1, f(x) increases with 2, just like it does between e.g.x=2 and x=3. Therefore, determining the average slope between x and x+d will do. The average slope between x and x+d is how much f(x) increases between x and x+d, divided by the difference between x and x+d (which is d). Let d=1, in which case we don’t have to do the division, as f′(x)=f(x+1)−f(x)1=f(x+1)−f(x). Filling in ax+b for f(x) and a(x+1)+b for f(x+1), we get:
f′(x)=f(x+1)−f(x)=(a(x+1)+b)−(ax+b)=ax+a+b−ax−b=a
There it is! f′(x)=a. So for g(x)=2x+5, where a=2, this means g′(x)=2.
Polynomials (and more)
Polynomials are functions with the following form:
f(x)=a0xn+a1xn−1+...+an−1x+an
Determining their derivative is a bit more tricky than determining the derivative of a linear function, because now, the derivative isn’t necessarily the same everywhere. After all, take g(x)=x2:
We can see this is a curved line, and so the derivative is constantly changing. We can sill do something like the “trick” we did with linear functions, but we can’t determine f′(x)by looking how f(x) changes between x and x+1: that would assume f′(x) is the same between x and x+1, which isn’t true. For x and x+0.001, we would have a better estimate of f′(x), but we’d still assume f′(x) to be constant between these values. We need to determine how f(x) changes between x and some x+d, where d needs to approach zero: the smaller d gets, the more accurate our calculation for f′(x) becomes. We can do this using limits:
f′(x)=limd→0f(x+d)−f(x)d
(Since d isn’t 1 now, we need to do the division.) We can read this as follows: what value does f(x+d)+f(x)d approach when d approaches 0?
So for g(x)=x2, g′(x)=2x. You might have learned the general rule:
For f(x)=axb, f′(x)=abxb−1
This is known as the power rule, and indeed works for g(x)=x2, where a=1 and b=2and 1∗2∗x2−1=2x1=2x. It also works for the linear function h(x)=2x, where a=2 and b=1: h′(x)=1∗2x1−1=1∗2x0=1∗2∗1=2. But does it work in general? Yes, and we can proof it. Let’s first proof it works for all natural numbers (0,1,2,3,...) b: b∈N. We need the product rule and mathematical induction for this proof though, so let’s discuss those first.
Product rule
The product rule states that when f(x)=g(x)∗h(x), f′(x)=g′(x)∗h(x)+g(x)∗h′(x). So when e.g.g(x)=2x and h(x)=3x2, f(x)=2x∗3x2 and
f′(x)=g′(x)∗h(x)+g(x)∗h′(x)=2∗3x2+2x∗6x=6x2+12x2=18x2. We can show the product rule is correct by determining what f′(x) should be using the original definition of the derivative:
f′(x)=limd→0f(x+d)−f(x)d=g(x+d)∗h(x+d)−g(x)∗h(x)d
Since we want to write f′(x) as g′(x)∗h(x)+g(x)∗h′(x), let’s rewrite the divisor to include the terms g(x+d)−g(x) and h(x+d)−h(x):
When d approaches 0, limd→0g(x+d) becomes g(x). Furthermore, by definition,
limd→0g(x+d)−g(x)d=g′(x) and limd→0h(x+d)−h(x)d=h′(x),
so we now have f′(x)=h(x)∗g′(x)+g(x)∗h′(x)=g′(x)∗h(x)+g(x)∗h′(x),
which is the product rule!
Mathematical induction
Mathematical induction is a method for proving something is true for all natural numbers N. For example, say we want to proof that for every natural number n∈N, S(n)=n(n+1)2, where S(n) is simply 0+1+2+...+n. We can do this by first showing the condition holds for n=0. That’s Step 1, and yes, it does: 0(0+1)2=0=S(0). Then, we show that if the condition holds for some n, it also holds for n+1. That’s Step 2. So for this step we assume S(n)=n(n+1)2, and need to show that S(n+1)=(n+1)((n+1)+1)2. That holds as well: if S(n)=n(n+1)2, then S(n+1)=0+1+2+...+n+(n+1)=S(n)+n+1. Since for this step we assumed S(n)=n(n+1)2, we have S(n+1)=n(n+1)2+n+1=n(n+1)2+2(n+1)2. So S(n+1)=n(n+1)+2(n+1)2=(n+1)(n+2)2=(n+1)((n+1)+1)2.
So we now know that our condition holds for n=0 and that if it holds for some n, it must also hold for n+1. But then it holds for all natural numbers! Does our condition hold for n=3? Yes! It holds for n=0 by Step 1, so it holds for n=1 by Step 2; but then, since it holds for n=1, it also holds for n=2, again by Step 2. Applying Step 2 one more time gives that the condition S(n)=n(n+1)2 holds for n=3 as well. And we can apply this process to every natural number!
Proof of the power rule for natural numbers
Using the product rule and mathematical induction, we can show that the power rule (for f(x)=axb, f′(x)=abxb−1) works for all b∈N.
Step 1 is to show this is true for b=0. Yes: then f(x)=axb=ax0=a, and abxb−1=a∗0x0−1=0=f′(x). (Since f(x) is constant (a), its derivative f′(x) is indeed 0.
Step 2 is to show that if f′(x)=abxb−1 for some b∈N and f(x)=axb, then for b+1 and g(x)=axb+1, g′(x)=a(b+1)xb.
We can write g(x)=axb+1 as g(x)=x∗axb. Then, define h(x)=x. Then g(x)=h(x)∗f(x), and then the product rule says g′(x)=h′(x)∗f(x)+h(x)∗f′(x). But by the assumption of Step 2, f′(x)=abxb−1. Furthermore, h′(x)=1. So g′(x)=1∗axb+x∗abxb−1=axb+abxxb−1=axb+abxb=a(b+1)xb, which is what we wanted to proof!
So we have shown the power rule works for b∈N. We could extend this proof to e.g. cover negative integers for b as well. But I’d like to use a different method of proof, that proofs the power rule works for b∈R. For this, we first need to know the chain rule, the constant multiple rule, Euler’s number and how to take the derivative of the natural logarithm.
Chain rule
Define f(x)=(3x)2. (Note this is distinct from 3x2.) We want to determine its derivative. We could say f(x)=(3x)2=9x2, which would make f′(x)=18x. This is true, but let’s take the opportunity to study the chain rule. Define g(x)=3x and h(x)=x2. We can then write f(x) as h(g(x)). Then:
f′(x)=limd→0f(x+d)−f(x)d=limd→0h(g(x+d))−h(g(x))d
Multiplying by g(x+d)−g(x)g(x+d)−g(x), which equals 1 and is allowed if g(x+d)≠g(x) (otherwise we are dividing by 0), gives:
or f′(x)=limd→0h(g(x+d))−h(g(x))g(x+d)−g(x)∗limd→0g(x+d)−g(x)d
Note that limd→0h(g(x+d))−h(g(x))g(x+d)−g(x)=h′(g(x)), and limd→0g(x+d)−g(x)d=g′(x). So we now have f′(x)=h′(g(x))∗g′(x). That’s the chain rule, and it holds whenever we can write a function f(x) as f(x)=h(g(x)). Originally, we said f(x)=(3x)2, with g(x)=3x and h(x)=x2. Then h′(g(x))=2g(x)=2∗3x=6x and g′(x)=3. According to the chain rule, then, f′(x)=6x∗3=18x, which is also what we got by applying the power rule to f(x)=(3x)2=9x2.
Before, we temporarily assumed g(x+d)≠g(x). What if g(x+d)=g(x)? Well, then h(g(x+d))=h(g(x)), and h(g(x+d))−h(g(x))=0. Then f′(x)=limd→00d=0, and g′(x)=limd→0g(x+d)−g(x)d=limd→00d=0. So the chain rule would still apply, as h′(g(x))∗g′(x)=h′(g(x))∗0=0=f′(x).
Constant multiple rule
If f(x)=a∗g(x), f′(x)=a∗g′(x). This might make intuitive sense, but it also follows from the chain rule: define h(x)=ax and f(x)=h(g(x)). Then f′(x)=h′(g(x))∗g′(x)=a∗g′(x), which is the constant multiple rule. Indeed, this same rule also follows from the product rule: if f(x)=a∗g(x), define h(x)=a. Then f(x)=h(x)∗g(x) and f′(x)=h′(x)∗g(x)+h(x)∗g′(x)=0∗g(x)+a∗g′(x)=a∗g′(x).
Euler’s number and the natural logarithm
You might know that Euler’s number e, which is chosen so that if f(x)=ex, f′(x)=ex. You may also remember the natural logarithm ln, where elnx=x. What’s the derivative of f(x)=lnx? We can find it with the chain rule! Define g(x)=ef(x)=elnx and h(x)=ex. Then g(x)=h(f(x)), and applying the chain rule gives g′(x)=h′(f(x))∗f′(x)=elnx∗f′(x). But also, g(x)=elnx=x, so g′(x)=1. So we learn g′(x)=elnx∗f′(x)=1, or x∗f′(x)=1, and so f′(x)=1x. So for f(x)=lnx, f′(x)=1x.
General proof of the power rule
Now we’re ready to proof the power rule (for f(x)=axb, f′(x)=abxb−1) works for b∈R. Let’s rewrite x as elnx. Then f(x)=a(elnx)b=aeblnx. Define g(x)=aex and h(x)=blnx. Then f(x)=g(h(x)), and via the chain rule (and the constant multiple rule) f′(x)=g′(h(x))∗h′(x)=aeblnx∗b∗1x=aeblnx∗bx. Remember aeblnx=a(elnx)b=axb, so f′(x)=axb∗bx=abxbx=abxb−1, which is what we need to proof the power rule for b∈R.
Local maxima, local minima and second derivatives
As you might know, polynomials like f(x)=−x2 can have local maxima (or peaks, where the graph first goes up and then goes down) and local minima (or minima, where the graph first goes down and then goes up). When a graph goes up, the derivative is positive; when it goes down, the derivative is negative. In the peak, the derivative must be 0! It’s similar for valleys—the derivative is 0there, too. That means we can find local maxima and local minima by setting the derivative to 0! For f(x)=−x2, f′(x)=−2x. f′(x)=0 gives −2x=0 and thus x=0. Therefore, there must be a local maximum or minimum at f(0). Which is it? Well, note that in a local maximum, the derivative must be decreasing (through 0): otherwise, the graph wouldn’t first go up and then go down. But if the derivative is decreasing, the derivative of the derivative, called the second derivative (written f′′(x)), must be negative! Conversely, in a local minimum, the second derivative must be positive. For f(x)=−x2, f′(x)=−2x and f′′(x)=−2<0. So f(x)=0 is a local maximum!
Now consider g(x)=x3+x2. We have g′(x)=3x2+2x, and g′(x)=0 gives 3x2+2x=0 or x(3x+2)=0. Then x=0∨3x+2=0 and so x=0∨x=−23. We have a local maximum or minimum in x=0 and a local maximum or minimum in x=−23. g′′(x)=6x+2, g′′(0)=6∗0+2=2>0 and g′′(−23)=6∗−23+2=−2<0. Therefore, we have a local minimum in x=0 and a local maximum in x=−23.
Multivariable functions
Multivariable functions are functions with, well, more than one variable. Take for example f(x,y)=2x+3y. For x=4 and y=5, we have f(4,5)=2∗4+3∗5=23. Or we can take g(x,y,z)=x+5y+2z, with g(1,1,1)=1+5+2=8.
Partial derivatives
A partial derivative of a multivariable function is determined by treating all but one variable like constants and taking the derivative with respect to the one variable left. For example, for f(x,y)=2x+3y, we can derive with respect to x: f′x(x,y)=2 and with respect to y: f′y=3. More generally, for any 2-variable function f(x,y), f′x(x,y)=limd→0f(x+d,y)−f(x,y)d and f′y(x,y)=limd→0f(x,y+d)−f(x,y)d. For f(x,y)=2x+3y, this means f′x(x,y)=limd→0f(x+d,y)−f(x,y)d=limd→0(2(x+d)+3y)−(2x+3y)d=limd→0(2x+2d+3y)−2x−3y)d, which indeed simplifies to f′x(x,y)=limd→02dd=limd→02=2.
A Very Mathematical Explanation of Derivatives
This post is meant for readers familiar with algebra and derivatives, but want to deepen their understanding and/or need a refresh.
Linear functions
Let’s start with a family of very basic functions: the linear functions, expressed as f(x)=ax+b. You might remember its derivative is f′(x)=a, because x is multiplied by a and the constant b “disappears” when taking the derivative. This is correct, but let’s actually calculate the derivative. Since f(x) is a linear function, f′(x) is the same for all x. That is, a linear function “goes up” with the same “speed” everywhere, as can be seen in the following graph for g(x)=2x+5:
For example, between x=0 and x=1, f(x) increases with 2, just like it does between e.g.x=2 and x=3. Therefore, determining the average slope between x and x+d will do. The average slope between x and x+d is how much f(x) increases between x and x+d, divided by the difference between x and x+d (which is d). Let d=1, in which case we don’t have to do the division, as f′(x)=f(x+1)−f(x)1=f(x+1)−f(x). Filling in ax+b for f(x) and a(x+1)+b for f(x+1), we get:
f′(x)=f(x+1)−f(x)=(a(x+1)+b)−(ax+b)=ax+a+b−ax−b=a
There it is! f′(x)=a. So for g(x)=2x+5, where a=2, this means g′(x)=2.
Polynomials (and more)
Polynomials are functions with the following form:
f(x)=a0xn+a1xn−1+...+an−1x+an
Determining their derivative is a bit more tricky than determining the derivative of a linear function, because now, the derivative isn’t necessarily the same everywhere. After all, take g(x)=x2:
We can see this is a curved line, and so the derivative is constantly changing. We can sill do something like the “trick” we did with linear functions, but we can’t determine f′(x)by looking how f(x) changes between x and x+1: that would assume f′(x) is the same between x and x+1, which isn’t true. For x and x+0.001, we would have a better estimate of f′(x), but we’d still assume f′(x) to be constant between these values. We need to determine how f(x) changes between x and some x+d, where d needs to approach zero: the smaller d gets, the more accurate our calculation for f′(x) becomes. We can do this using limits:
f′(x)=limd→0f(x+d)−f(x)d
(Since d isn’t 1 now, we need to do the division.) We can read this as follows: what value does f(x+d)+f(x)d approach when d approaches 0?
Let’s do this for the simple polynomial g(x)=x2:
g′(x)=limd→0g(x+d)−g(x)d=limd→0(x+d)2−x2d=limd→0x2+2dx+d2−x2d=limd→02dx+d2d
g′(x)=limd→0(2dxd+d2d)=limd→0(2x+d)
When d approaches 0, 2x+d becomes 2x:
g′(x)=limd→0(2x+d)=2x.
So for g(x)=x2, g′(x)=2x. You might have learned the general rule:
For f(x)=axb, f′(x)=abxb−1
This is known as the power rule, and indeed works for g(x)=x2, where a=1 and b=2and 1∗2∗x2−1=2x1=2x. It also works for the linear function h(x)=2x, where a=2 and b=1: h′(x)=1∗2x1−1=1∗2x0=1∗2∗1=2. But does it work in general? Yes, and we can proof it. Let’s first proof it works for all natural numbers (0,1,2,3,...) b: b∈N. We need the product rule and mathematical induction for this proof though, so let’s discuss those first.
Product rule
The product rule states that when f(x)=g(x)∗h(x), f′(x)=g′(x)∗h(x)+g(x)∗h′(x). So when e.g.g(x)=2x and h(x)=3x2, f(x)=2x∗3x2 and
f′(x)=g′(x)∗h(x)+g(x)∗h′(x)=2∗3x2+2x∗6x=6x2+12x2=18x2. We can show the product rule is correct by determining what f′(x) should be using the original definition of the derivative:
f′(x)=limd→0f(x+d)−f(x)d=g(x+d)∗h(x+d)−g(x)∗h(x)d
Since we want to write f′(x) as g′(x)∗h(x)+g(x)∗h′(x), let’s rewrite the divisor to include the terms g(x+d)−g(x) and h(x+d)−h(x):
f′(x)=limd→0h(x)(g(x+d)−g(x))+g(x+d)(h(x+d)−h(x))d
and note that indeed, h(x)(g(x+d)−g(x))+g(x+d)(h(x+d)−h(x))=
h(x)g(x+d)−g(x)h(x)+g(x+d)h(x+d)−h(x)g(x+d)=
g(x+d)h(x+d)−g(x)h(x), which was our original divisor.
Simplifying f′(x)=limd→0h(x)(g(x+d)−g(x))+g(x+d)(h(x+d)−h(x))d, we get
f′(x)=limd→0h(x)(g(x+d)−g(x))d+limd→0g(x+d)(h(x+d)−h(x))d
Since h(x) doesn’t contain d, we can take it outside the first limit term. We can also rewrite the second term:
f′(x)=h(x)∗limd→0g(x+d)−g(x)d+limd→0g(x+d)∗limd→0h(x+d)−h(x)d
When d approaches 0, limd→0g(x+d) becomes g(x). Furthermore, by definition,
limd→0g(x+d)−g(x)d=g′(x) and limd→0h(x+d)−h(x)d=h′(x),
so we now have f′(x)=h(x)∗g′(x)+g(x)∗h′(x)=g′(x)∗h(x)+g(x)∗h′(x),
which is the product rule!
Mathematical induction
Mathematical induction is a method for proving something is true for all natural numbers N. For example, say we want to proof that for every natural number n∈N, S(n)=n(n+1)2, where S(n) is simply 0+1+2+...+n. We can do this by first showing the condition holds for n=0. That’s Step 1, and yes, it does: 0(0+1)2=0=S(0). Then, we show that if the condition holds for some n, it also holds for n+1. That’s Step 2. So for this step we assume S(n)=n(n+1)2, and need to show that S(n+1)=(n+1)((n+1)+1)2. That holds as well: if S(n)=n(n+1)2, then S(n+1)=0+1+2+...+n+(n+1)=S(n)+n+1. Since for this step we assumed S(n)=n(n+1)2, we have S(n+1)=n(n+1)2+n+1=n(n+1)2+2(n+1)2. So S(n+1)=n(n+1)+2(n+1)2=(n+1)(n+2)2=(n+1)((n+1)+1)2.
So we now know that our condition holds for n=0 and that if it holds for some n, it must also hold for n+1. But then it holds for all natural numbers! Does our condition hold for n=3? Yes! It holds for n=0 by Step 1, so it holds for n=1 by Step 2; but then, since it holds for n=1, it also holds for n=2, again by Step 2. Applying Step 2 one more time gives that the condition S(n)=n(n+1)2 holds for n=3 as well. And we can apply this process to every natural number!
Proof of the power rule for natural numbers
Using the product rule and mathematical induction, we can show that the power rule (for f(x)=axb, f′(x)=abxb−1) works for all b∈N.
Step 1 is to show this is true for b=0. Yes: then f(x)=axb=ax0=a, and abxb−1=a∗0x0−1=0=f′(x). (Since f(x) is constant (a), its derivative f′(x) is indeed 0.
Step 2 is to show that if f′(x)=abxb−1 for some b∈N and f(x)=axb, then for b+1 and g(x)=axb+1, g′(x)=a(b+1)xb.
We can write g(x)=axb+1 as g(x)=x∗axb. Then, define h(x)=x. Then g(x)=h(x)∗f(x), and then the product rule says g′(x)=h′(x)∗f(x)+h(x)∗f′(x). But by the assumption of Step 2, f′(x)=abxb−1. Furthermore, h′(x)=1. So g′(x)=1∗axb+x∗abxb−1=axb+abxxb−1=axb+abxb=a(b+1)xb, which is what we wanted to proof!
So we have shown the power rule works for b∈N. We could extend this proof to e.g. cover negative integers for b as well. But I’d like to use a different method of proof, that proofs the power rule works for b∈R. For this, we first need to know the chain rule, the constant multiple rule, Euler’s number and how to take the derivative of the natural logarithm.
Chain rule
Define f(x)=(3x)2. (Note this is distinct from 3x2.) We want to determine its derivative. We could say f(x)=(3x)2=9x2, which would make f′(x)=18x. This is true, but let’s take the opportunity to study the chain rule. Define g(x)=3x and h(x)=x2. We can then write f(x) as h(g(x)). Then:
f′(x)=limd→0f(x+d)−f(x)d=limd→0h(g(x+d))−h(g(x))d
Multiplying by g(x+d)−g(x)g(x+d)−g(x), which equals 1 and is allowed if g(x+d)≠g(x) (otherwise we are dividing by 0), gives:
f′(x)=limd→0(h(g(x+d))−h(g(x)))∗(g(x+d)−g(x))(g(x+d)−g(x))∗d
or f′(x)=limd→0h(g(x+d))−h(g(x))g(x+d)−g(x)∗limd→0g(x+d)−g(x)d
Note that limd→0h(g(x+d))−h(g(x))g(x+d)−g(x)=h′(g(x)), and limd→0g(x+d)−g(x)d=g′(x). So we now have f′(x)=h′(g(x))∗g′(x). That’s the chain rule, and it holds whenever we can write a function f(x) as f(x)=h(g(x)). Originally, we said f(x)=(3x)2, with g(x)=3x and h(x)=x2. Then h′(g(x))=2g(x)=2∗3x=6x and g′(x)=3. According to the chain rule, then, f′(x)=6x∗3=18x, which is also what we got by applying the power rule to f(x)=(3x)2=9x2.
Before, we temporarily assumed g(x+d)≠g(x). What if g(x+d)=g(x)? Well, then h(g(x+d))=h(g(x)), and h(g(x+d))−h(g(x))=0. Then f′(x)=limd→00d=0, and g′(x)=limd→0g(x+d)−g(x)d=limd→00d=0. So the chain rule would still apply, as h′(g(x))∗g′(x)=h′(g(x))∗0=0=f′(x).
Constant multiple rule
If f(x)=a∗g(x), f′(x)=a∗g′(x). This might make intuitive sense, but it also follows from the chain rule: define h(x)=ax and f(x)=h(g(x)). Then f′(x)=h′(g(x))∗g′(x)=a∗g′(x), which is the constant multiple rule. Indeed, this same rule also follows from the product rule: if f(x)=a∗g(x), define h(x)=a. Then f(x)=h(x)∗g(x) and f′(x)=h′(x)∗g(x)+h(x)∗g′(x)=0∗g(x)+a∗g′(x)=a∗g′(x).
Euler’s number and the natural logarithm
You might know that Euler’s number e, which is chosen so that if f(x)=ex, f′(x)=ex. You may also remember the natural logarithm ln, where elnx=x. What’s the derivative of f(x)=lnx? We can find it with the chain rule! Define g(x)=ef(x)=elnx and h(x)=ex. Then g(x)=h(f(x)), and applying the chain rule gives g′(x)=h′(f(x))∗f′(x)=elnx∗f′(x). But also, g(x)=elnx=x, so g′(x)=1. So we learn g′(x)=elnx∗f′(x)=1, or x∗f′(x)=1, and so f′(x)=1x. So for f(x)=lnx, f′(x)=1x.
General proof of the power rule
Now we’re ready to proof the power rule (for f(x)=axb, f′(x)=abxb−1) works for b∈R. Let’s rewrite x as elnx. Then f(x)=a(elnx)b=aeblnx. Define g(x)=aex and h(x)=blnx. Then f(x)=g(h(x)), and via the chain rule (and the constant multiple rule) f′(x)=g′(h(x))∗h′(x)=aeblnx∗b∗1x=aeblnx∗bx. Remember aeblnx=a(elnx)b=axb, so f′(x)=axb∗bx=abxbx=abxb−1, which is what we need to proof the power rule for b∈R.
Local maxima, local minima and second derivatives
As you might know, polynomials like f(x)=−x2 can have local maxima (or peaks, where the graph first goes up and then goes down) and local minima (or minima, where the graph first goes down and then goes up). When a graph goes up, the derivative is positive; when it goes down, the derivative is negative. In the peak, the derivative must be 0! It’s similar for valleys—the derivative is 0there, too. That means we can find local maxima and local minima by setting the derivative to 0! For f(x)=−x2, f′(x)=−2x. f′(x)=0 gives −2x=0 and thus x=0. Therefore, there must be a local maximum or minimum at f(0). Which is it? Well, note that in a local maximum, the derivative must be decreasing (through 0): otherwise, the graph wouldn’t first go up and then go down. But if the derivative is decreasing, the derivative of the derivative, called the second derivative (written f′′(x)), must be negative! Conversely, in a local minimum, the second derivative must be positive. For f(x)=−x2, f′(x)=−2x and f′′(x)=−2<0. So f(x)=0 is a local maximum!
Now consider g(x)=x3+x2. We have g′(x)=3x2+2x, and g′(x)=0 gives 3x2+2x=0 or x(3x+2)=0. Then x=0∨3x+2=0 and so x=0∨x=−23. We have a local maximum or minimum in x=0 and a local maximum or minimum in x=−23. g′′(x)=6x+2, g′′(0)=6∗0+2=2>0 and g′′(−23)=6∗−23+2=−2<0. Therefore, we have a local minimum in x=0 and a local maximum in x=−23.
Multivariable functions
Multivariable functions are functions with, well, more than one variable. Take for example f(x,y)=2x+3y. For x=4 and y=5, we have f(4,5)=2∗4+3∗5=23. Or we can take g(x,y,z)=x+5y+2z, with g(1,1,1)=1+5+2=8.
Partial derivatives
A partial derivative of a multivariable function is determined by treating all but one variable like constants and taking the derivative with respect to the one variable left. For example, for f(x,y)=2x+3y, we can derive with respect to x: f′x(x,y)=2 and with respect to y: f′y=3. More generally, for any 2-variable function f(x,y), f′x(x,y)=limd→0f(x+d,y)−f(x,y)d and f′y(x,y)=limd→0f(x,y+d)−f(x,y)d. For f(x,y)=2x+3y, this means f′x(x,y)=limd→0f(x+d,y)−f(x,y)d=limd→0(2(x+d)+3y)−(2x+3y)d=limd→0(2x+2d+3y)−2x−3y)d, which indeed simplifies to f′x(x,y)=limd→02dd=limd→02=2.