Calculus/Differentiation

From Wikibooks, the open-content textbooks collection

< Calculus
Jump to: navigation, search

Contents

[edit] What is differentiation?

Differentiation is an operation that allows us to find a function that outputs the rate of change of one variable with respect to another variable when given that second variable.

Informally, we may suppose that we're tracking the position of a car on a two-lane road with no passing lanes. Assuming the car never pulls off the road, we can abstractly study the car's position by assigning it a variable, x. Since the car's position changes as the time changes, we say that x is dependent on time, or x = x(t). This tells where the car is at each specific time. Differentiation gives us a function dx / dt which represents the car's speed, that is the rate of change of its position with respect to time.

Equivalently, differentiation gives us the slope at any point of the graph of a non-linear function. For a linear function, of form f(x) = ax + b, a is the slope. For non-linear functions, such as f(x) = 3x2, the slope can depend on x; differentiation gives us a function which represents this slope.

[edit] The Definition of Slope

Historically, the primary motivation for the study of differentiation was the tangent line problem: for a given curve, find the slope of the straight line that is tangent to the curve at a given point. The word tangent comes from the Latin word tangens, which means touching. Thus, to solve the tangent line problem, we need to find the slope of a line that is "touching" a given curve at a given point, or, in modern language, that has the same slope. But what exactly do we mean by "slope" for a curve?

The solution is obvious in some cases: for example, a line y = mx + c is its own tangent; the slope at any point is m. For the parabola y = x2, the slope at the point (0,0) is 0; the tangent line is horizontal.

But how can you find the slope of, say, y = sinx + x2 at x = 1.5? This is in general a nontrivial question, but first we will deal carefully with the slope of lines.

[edit] Of a Line

Three lines with different slopes

The slope of a line, also called the gradient of the line, is a measure of its inclination. A line that is horizontal has slope 0, a line from the bottom left to the top right has a positive slope and a line from the top left to the bottom right has a negative slope.

The slope can be defined in two (equivalent) ways. The first way is to express it as how much the line climbs for a given motion horizontally. We denote a change in a quantity using the symbol Δ (pronounced "delta"). Thus, a change in x is written as Δx. We can therefore write this definition of slope as:

\mbox{Slope}=\frac{\Delta y}{\Delta x}

An example may make this definition clearer. If we have two points on a line, P \left(x_1,y_1 \right) and Q \left( x_2,y_2 \right), the change in x from P to Q is given by:

\Delta x = x_2 - x_1\,

Likewise, the change in y from P to Q is given by:

\Delta y = y_2 - y_1\,

This leads to the very important result below.

The slope of the line between the points (x1,y1) and (x2,y2) is
\frac{\Delta y}{\Delta x} = \frac{y_2 - y_1}{x_2 - x_1}.

Alternatively, we can define slope trigonometrically, using the tangent function:

\mbox{Slope}=\tan\left( \alpha \right),

where α is the angle from the line to the rightward-pointing horizontal (measured clockwise). If you recall that the tangent of an angle in a right triangle is defined as the length of the side opposite the angle over the length of the leg adjacent to the angle, you should be able to spot the equivalence here.

[edit] Of a Graph of a Function

The graphs of most functions we are interested in are not straight lines (although they can be) but rather curves. We cannot define the slope of a curve in the same way as we can for a line. In order for us to understand how to find the slope of a curve at a point, we will first have to cover the idea of tangency. Intuitively, a tangent is a line which just touches a curve at a point, such that the angle between them at that point is zero. Consider the following four curves and lines:

(i) (ii)
(iii) (iv)
  1. The line L crosses, but is not tangent to C at P.
  2. The line L crosses, and is tangent to C at P.
  3. The line L crosses C at two points, but is tangent to C only at P.
  4. There are many lines that cross C at P, but none are tangent. In fact, this curve has no tangent at P.

A secant is a line drawn through two points on a curve. We can construct a definition of a tangent as the limit of a secant of the curve taken as the separation between the points tends to zero. Consider the diagram below.

As the distance h tends to zero, the secant line becomes the tangent at the point x0. The two points we draw our line through are:

P \left( x_0, f\left( x_0 \right) \right)

and

Q \left( x_0+h, f\left( x_0+h \right) \right)

As a secant line is simply a line and we know two points on it, we can find its slope, mh, using the formula from before:

m = \frac{y_2 - y_1}{x_2 - x_1}

(We will refer to the slope as mh because it may, and generally will, depend on h.) Substituting in the points on the line,

m_h = \frac{f\left( x_0+h \right) - f\left( x_0 \right)}{\left(x_0 + h \right) - x_0}.

This simplifies to

m_h = \frac{f\left( x_0+h \right) - f\left( x_0 \right)}{h}.

This expression is called the difference quotient. Note that h can be positive or negative — it is perfectly valid to take a secant through any two points on the curve — but cannot be 0.

The definition of the tangent line we gave was not rigorous, since we've only defined limits of numbers — or, more precisely, of functions that output numbers — not of lines. But we can define the slope of the tangent line at a point rigorously, by taking the limit of the slopes of the secant lines from the last paragraph. Having done so, we can then define the tangent line as well. Note that we cannot simply set h to zero as this would imply division of zero by zero which would yield an undefined result. Instead we must find the limit of the above expression as h tends to zero:

Definition: (Slope of the graph of a function)

The slope of the graph of f(x) at the point (x0,f(x0)) is

\lim_{h \to 0}\left[\frac{f\left( x_0+h \right) - f\left( x_0 \right)}{h}\right]

If this limit does not exist, then we say the slope is undefined.

If the slope is defined, say m, then the tangent line to the graph of f(x) at the point (x0,f(x0)) is the line with equation

y-f(x_0) = m\cdot(x-x_0)

This last equation is just the point-slope form for the line through (x0,f(x0)) with slope m.

[edit] Exercises

  1. Find the slope of the tangent to the curve y = x2 at (1,1).

Answer: 2

[edit] The Rate of Change of a Function at a Point

Consider the formula for average velocity in the x-direction, \frac{\Delta x}{\Delta t}, where Δx is the change in x over the time interval Δt. This formula gives the average velocity over a period of time, but suppose we want to define the instantaneous velocity. To this end we look at the change in position as the change in time approaches 0. Mathematically this is written as: \lim_{\Delta t \to 0} \frac{\Delta x}{\Delta t}, which we abbreviate by the symbol \frac{dx}{dt}. (The idea of this notation is that the letter d denotes change.) Compare the symbol d with Δ. The (entirely non-rigorous) idea is that both indicate a difference between two numbers, but Δ denotes a finite difference while d denotes an infinitesimal difference. Please note that the symbols dx and dt have no rigorous meaning on their own, since \lim_{\Delta t \to 0} \Delta t=0, and we can't divide by 0.

(Note that the letter s is often used to denote distance, which would yield \frac{ds}{dt}. The letter d is often avoided in denoting distance due to the potential confusion resulting from the expression \frac{dd}{dt}.)

[edit] The Definition of the Derivative

The easiest way to find slopes for any function is by differentiation. Differentiation results in another function whose value for any value x is the slope of the original function at x. This function is known as the derivative of the original function, and is denoted by either a prime sign, as in f'(x)\ (read "f prime of x"), the quotient notation, \frac{df}{dx} or \frac{d}{dx}\left[ f\right], which is more useful in some cases, or the differential operator notation, Dx[f(x)], which is generally just written as Df(x).

Most of the time the brackets are not needed, but are useful for clarity if we are dealing with something like D(fg) for a product.

Example: If\ f(x) = 3x + 5, \ f'(x) = 3, no matter what x.
Example: If f(x) = \left|x\right| (the absolute value function) then f'(x) = \left\{ \begin{matrix} -1, & x < 0 \\ \operatorname{undefined}, & x = 0 \\ 1, & x > 0 \end{matrix} \right. .

Here, f(x) is not smooth (though it is continuous) at x = 0 and so the limits \lim_{x \to 0^{+}} f'(x) and \lim_{x \to 0^{-}} f'(x) (the limits as 0 is approached from the right and left respectively) are not equal. f'(0) is said to be undefined, and so f'(x) has a discontinuity at 0. This sort of point of non-differentiability is called a cusp. Functions may also not be differentiable because they go to infinity at a point, or oscillate infinitely frequently.

[edit] An example

Draw a curve defined as y = 3x2 and select any point on it. We select the point at which x = 4; what is the slope at this point? We can do it "the hard (and imprecise) way", without using differentiation, as follows, using a calculator and using small differences below and above the given point:

When x = 3.999, y = 47.976003.

When x = 4.001, y = 48.024003.

Then the difference between the two values of x is Δx = 0.002.

Then the difference between the two values of y is Δy = 0.048.

Thus, the slope = \frac{\Delta y}{\Delta x} = 24 at the point of the graph at which x = 4.


Now using differentiation rules (see below) to solve this problem again, when y = 3x2 then the slope at any point of that curve is found by evaluating y' = 6x.

Our x is 4, so that y' = \frac{\Delta y}{\Delta x} = 6 * 4 = 24 again. No need for a calculator!


f'(x) = \lim_{\Delta x \to 0}\left[\frac{f(x+\Delta x)-f(x)}{\Delta x}\right]

This is the definition of the derivative. If the limit exists we say that f is differentiable at x and its derivative at x is f'(x). A visual explanation of this formula is that the slope of the tangent line is the limit of the slope of a secant line when the difference of the points (Δx) tends to zero.

Example

Let us try this for a simple function:

f(x)\, = \frac{x}{2}
f'(x)\, = \lim_{\Delta x \to 0}\left(\frac{\frac{x+\Delta x}{2} - \frac{x}{2}}{\Delta x}\right)
= \lim_{\Delta x \to 0}\left(\frac{1}{2}\right)
= \frac{1}{2}

This is consistent with the definition of the derivative as the slope of a function.

Sometimes, the slope of a function varies with x. This is demonstrated by the function f(x) = x2,

f(x)\, = x^2\,
f'(x)\, = \lim_{\Delta x \to 0}\left[\frac{(x+\Delta x)^2-x^2}{\Delta x}\right]
= \lim_{\Delta x \to 0}\left(\frac{x^2+2x\Delta x+\Delta x^2-x^2}{\Delta x}\right)
= \lim_{\Delta x \to 0}\left(\frac{2x\Delta x+\Delta x^2}{\Delta x}\right)
= \lim_{\Delta x \to 0}\left(2x+\Delta x\right)
= 2x

[edit] Understanding the Derivative Notation

The derivative notation is special and unique in mathematics. The most common use of derivatives you'll run into when first starting out with differentiating is the Leibniz notation, expressed as  \frac{dy}{dx}. You may think of this as "rate of change in y with respect to x". You may also think of it as "infinitesimal value of y divided by infinitesimal value of x". Either way is a good way of thinking. Often, in an equation, you will see just \frac{d}{dx}, which literally means "derivative with respect to x". You may safely assume that it is the equivalent of  \frac{dy}{dx} for now.

As you advance through your studies, you will see that dy and dx can act as separate entities that can be multiplied and divided (to a certain degree). Eventually you will see derivatives such as \frac {dx} {dy}, which sometimes will be written  \frac{d}{dy}. Or, you may see a derivative in polar coordinates marked as \frac{d\theta}{dr}.

All of the following are equivalent for expressing the derivative of y = x2

  • \frac{dy}{dx} = 2x
  • \frac{d}{dx} x^{2} = 2x
  • dy = 2x dx \
  • f '(x) = 2x \
  • D(f(x)) = 2x \

[edit] Exercises

Using the definition of the derivative find the derivative of the function f(x) = 2x + 3

Using the definition of the derivative find the derivative of the function f(x) = x3. Now try f(x) = x4. Can you see a pattern? In the next section we will find the derivative of f(x) = xn for all n.

The text states that the derivative of \left|x\right| is not defined at x = 0. Use the definition of the derivative to show this.

Graph the derivative to y = 4x2 on a piece of graph paper without solving for dy / dx. Then, solve for dy / dx and graph that; compare the two graphs.

Use the definition of the derivative to show that the derivative of sinx is cosx. Hint: Use a suitable sum to product formula and the fact \lim_{t \rightarrow 0}\frac{\sin t}{t}=1

[edit] Differentiation rules

The process of differentiation is tedious for large functions. Therefore, rules for differentiating general functions have been developed, and can be proved with a little effort. Once sufficient rules have been proved, it will be possible to differentiate a wide variety of functions. Some of the simplest rules involve the derivative of linear functions.

[edit] Derivative of a Constant Function

For any fixed real number c,

\frac{d}{dx}\left[c\right]=0

Intuition

The function f(x) = c is a horizontal line, which has a constant slope of zero. Therefore, it should be expected that the derivative of this function is zero, regardless of the value of x.

Proof

From the definition of a derivative:

\lim_{\Delta x \to 0}\left[\frac{f(x+\Delta x)-f(x)}{\Delta x}\right]

Let f(x) = c. Then f(x + Δx) = c because there are no x's in the function with which to plug in x + Δx. Therefore:

 \frac{d}{dx}\left[c\right] = \lim_{\Delta x \to 0} \left[\frac{(c)-c}{\Delta x}\right] = 0

Example

\frac{d}{dx}\left[3\right]=0

Example

\frac{d}{dx}\left[z\right]=0

[edit] Derivative of a Linear Function

For any fixed real numbers m and c,

\frac{d}{dx}\left[mx+c\right]=m

The special case \frac{dx}{dx} = 1 shows the advantage of the \frac{d}{dx} notation -- rules are intuitive by basic algebra, though this does not constitute a proof, and can lead to misconceptions to what exactly dx and dy actually are.

[edit] Constant multiple and addition rules

Since we already know the rules for some very basic functions, we would like to be able to take the derivative of more complex functions and break them up into simpler functions. Two tools that let us do this are the constant multiple rules and the addition rule.

[edit] The Constant Rule

For any fixed real number c,

\frac{d}{dx}\left[cf(x)\right] = c \frac{d}{dx}\left[f(x)\right]

The reason, of course, is that one can factor c out of the numerator, and then of the entire limit, in the definition.

Example

We already know that

\frac{d}{dx}\left[x^2\right]=2x.

Suppose we want to find the derivative of 3x2

\frac{d}{dx}\left[3x^2\right] = 3\frac{d}{dx}\left[x^2\right]
= 3\times2x\,
= 6x\,

Another simple rule for breaking up functions is the addition rule.

[edit] The Addition and Subtraction Rules

\frac{d}{dx}\left[f(x)\pm g(x)\right]= \frac{d}{dx}\left[f(x)\right]\pm\frac{d}{dx}\left[g(x)\right]

Proof

From the definition:

 \lim_{\Delta x \to 0}\left[\frac{[f(x+\Delta x) \pm g(x + \Delta x)] - [f(x) \pm g(x)]}{\Delta x}\right]

 = \lim_{\Delta x \to 0} 
   \left[\frac{[f(x+\Delta x) - f(x)] \pm [g(x + \Delta x) - g(x)]}{\Delta x}\right]

 = \lim_{\Delta x \to 0} \left[\frac{[f(x+\Delta x) - f(x)]}{\Delta x}\right]
  \pm \lim_{\Delta x \to 0} \left[\frac{[g(x+\Delta x) - g(x)]}{\Delta x}\right]

By definition then, this last term is  \frac{d}{dx} \left[f(x)\right] \pm \frac{d}{dx}\left[g(x)\right]

Example

What is:

\frac{d}{dx}\left[3x^2+5x\right] = \frac{d}{dx}\left[3x^2+5x\right]
= \frac{d}{dx}\left[3x^2\right]+\frac{d}{dx}\left[5x\right]
= 6x+\frac{d}{dx}\left[5x\right]
= 6x+5\,

The fact that both of these rules work is extremely significant mathematically because it means that differentiation is linear. You can take an equation, break it up into terms, figure out the derivative individually and build the answer back up, and nothing odd will happen.

We now need only one more piece of information before we can take the derivatives of any polynomial.

[edit] The Power Rule

\frac{d}{dx}\left[x^n\right]=nx^{n-1}, x\ne0

For example, in the case of x2 the derivative is 2x1 = 2x as was established earlier. This rule is actually in effect in linear equations too, since xn − 1 = x0 when n=1, and of course, any real number or variable to the zero power is one.

This rule also applies to fractional and negative powers. Therefore

\frac{d}{dx}\left[\sqrt x \right] = \frac{d}{dx}\left[ x^{1/2}\right]
= \frac 1 2 x^{-1/2}
= \frac 1 {2\sqrt x}

Since polynomials are sums of monomials, using this rule and the addition rule lets you differentiate any polynomial. A relatively simple proof for this can be derived from the binomial expansion theorem.

[edit] Derivatives of polynomials

With these rules in hand, you can now find the derivative of any polynomial you come across. Rather than write the general formula, let's go step by step through the process.

\frac{d}{dx}\left[6x^5+3x^2+3x+1\right]

The first thing we can do is to use the addition rule to split the equation up into terms:

\frac{d}{dx}\left[6x^5\right]+\frac{d}{dx}\left[3x^2\right]+\frac{d}{dx}\left[3x\right]+\frac{d}{dx}\left[1\right].

We can immediately use the linear and constant rules to get rid of some terms:

\frac{d}{dx}\left[6x^5\right]+\frac{d}{dx}\left[3x^2\right]+3+0.

Now you may use the constant multiplier rule to move the constants outside the derivatives:

6\frac{d}{dx}\left[x^5\right]+3\frac{d}{dx}\left[x^2\right]+3.

Then use the power rule to work with the individual monomials:

6\left(5x^4\right)+3\left(2x\right)+3.

And then do some algebra to get the final answer:

30x^4+6x+3.\,

These are not the only differentiation rules. There are other, more advanced, differentiation rules, which will be described in a later chapter.

[edit] Exercises

  • Find the derivatives of the following equations:
f(x) = 42
f(x) = 6x + 10
f(x) = 2x2 + 12x + 3
  • Use the definition of a derivative to prove the derivative of a constant function, of a linear function, and the constant rule and addition or subtraction rules.
  • Answers:
f'(x) = 0
f'(x) = 6
f'(x) = 4x + 12

[edit] Extrema and Points of Inflexion

The four types of extrema.

Maxima and minima are points where a function reaches a highest or lowest value, respectively. There are two kinds of extrema (a word meaning maximum or minimum): global and local, sometimes referred to as "absolute" and "relative", respectively. A global maximum is a point that takes the largest value on the entire range of the function, while a global minimum is the point that takes the smallest value on the range of the function. On the other hand, local extrema are the largest or smallest values of the function in the immediate vicinity.

All extrema look like the crest of a hill or the bottom of a bowl on a graph of the function. A global extremum is always a local extremum too, because it is the largest or smallest value on the entire range of the function, and therefore also its vicinity. It is also possible to have a function with no extrema, global or local: y=x is a simple example.

At any extremum, the slope of the graph is necessarily zero, as the graph must stop rising or falling at an extremum, and begin to head in the opposite direction. Because of this, extrema are also commonly called stationary points or turning points. Therefore, the first derivative of a function is equal to zero at extrema. If the graph has one or more of these stationary points, these may be found by setting the first derivative equal to zero and finding the roots of the resulting equation.

The function f(x)=x3, which contains a point of inflexion at the point (0,0).

However, a slope of zero does not guarantee a maximum or minimum: there is a third class of stationary point called a point of inflexion. Consider the function

f \left(x \right) = x^3.

The derivative is

f^\prime \left(x \right) = 3 x^2

The slope at x=0 is 0. We have a slope of zero, but while this makes it a stationary point, this doesn't mean that it is a maximum or minimum. Looking at the graph of the function you will see that x=0 is neither, it's just a spot at which the function flattens out. True extrema require the a sign change in the first derivative. This makes sense - you have to rise (positive slope) to and fall (negative slope) from a maximum. In between rising and falling, on a smooth curve, there will be a point of zero slope - the maximum. A minimum would exhibit similar properties, just in reverse.

Good (B and C, green) and bad (D and E, blue) points to check in order to classify the extremum (A, black). The bad points lead to an incorrect classification of A as a minimum.

This leads to a simple method to classify a stationary point - plug x values slightly left and right into the derivative of the function. If the results have opposite signs then it is a true maximum/minimum. You can also use these slopes to figure out if it is a maximum or a minimum: the left side slope will be positive for a maximum and negative for a minimum. However, you must exercise caution with this method, as, if you pick a point too far from the extremum, you could take it on the far side of another extremum and incorrectly classify the point.

[edit] The Extremum Test

A more rigorous method to classify a stationary point is called the extremum test. As we mentioned before, the sign of the first derivative must change for a stationary point to be a true extremum. Now, the second derivative of the function tells us the rate of change of the first derivative. It therefore follows that if the second derivative is positive at the stationary point, then the gradient is increasing. The fact that it is a stationary point in the first place means that this can only be a minimum. Conversely, if the second derivative is negative at that point, then it is a maximum.

Now, if the second derivative is zero, we have a problem. It could be a point of inflexion, or it could still be an extremum. Examples of each of these cases are below - all have a second derivative equal to zero at the stationary point in question:

  • y = x3 has a point of inflexion at x = 0
  • y = x4 has a minimum at x = 0
  • y = − x4 has a maximum at x = 0

However, this is not an insoluble problem. What we must do is continue to differentiate until we get, at the (n+1)th derivative, a non-zero result at the stationary point:

f^{\prime} \left(x \right)=0, \,f^{\prime \prime} \left(x \right)=0,\, \ldots ,f^{\left(n\right)} \left(x \right)=0,\,f^{\left(n+1\right)} \left(x \right)\ne 0

If n is odd, then the stationary point is a true extremum. If the (n+1)th derivative is positive, it is a minimum; if the (n+1)th derivative is negative, it is a maximum. If n is even, then the stationary point is a point of inflexion.

As an example, let us consider the function

f \left( x \right) = -x^4

We now differentiate until we get a non-zero result at the stationary point at x=0 (assume we have already found this point as usual):

f^\prime \left( x \right) = -4x^3
f^{\prime \prime} \left( x \right) = -12x^2
f^{\prime \prime \prime} \left( x \right) = -24x
f^{\left(4\right)} \left( x \right) = -24

Therefore, (n+1) is 4, so n is 3. This is odd, and the fourth derivative is negative, so we have a maximum. Note that none of the methods given can tell you if this is a global extremum or just a local one. To do this, you would have to set the function equal to the height of the extremum and look for other roots.

See the "Sales Example" below for an application of these principles.

Personal tools
Create a book