Calculus/Differentiation

From testwiki
Jump to navigation Jump to search

What is differentiation?

Differentiation is a method that allows us to find a function that relates the rate of change of one variable with respect to another 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). But this is not enough to study how the car's position changes as the time changes; so far, we only have a way to tell where the car is at a specific time. Differentiation allows us to study dx/dt, which is the mathematical expression for how the car's position changes with respect to time.

Formally, we are able to find the slope at any point of a non-linear function (compare with determining the slope of a linear function: quite easy). Suppose we have determined the position of a particle at any time t modeled by the function:

x=3t2

Differentiating this would give us the amount of change in distance with respect to time (a rate, or speed).

The Definition of Slope

On a Line

Three lines with different gradients

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, a line from the top left to the bottom right has a negative slope.

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

Gradient=ΔyΔx

Alternatively, we can define gradient as the "tangent function" of the line:

Gradient=tan(α),

where α is the angle between the line to the horizontal (measured clockwise). Those who know how the tangent function is generated (opposite side over adjacent side) will be able to spot the equivalence here.

If we have two points on a line, P(x1,y1) and Q(x2,y2), the step in x from P to Q is given by:

Δx=x2x1

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

Δy=y2y1

This leads to the very important result below.

The definition of slope, m, between two points (x1,y1) and (x2,y2) on a line is
m=ΔyΔx=y2y1x2x1.

On a Function

Most functions we are interested in are not straight lines (although they can be). We cannot define a gradient of a curved function in the same way as we can for a line. In order for us to understand how to find the gradient of a function at a point, we will first have to cover the idea of tangency. 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 more than one point, but is tangent to C at P.
  4. There are many lines that cross C at P, but none are tangent. In fact, this curve has an undefined tangent at 'P.

A secant is a line drawn though two points on curve. We can construct a definition of the tangent as the limit of a secant of the curve drawn 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(x0,f(x0))

and

Q(x0+h,f(x0+h))

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

m=y2y1x2x1

Substituting in the points on the line,

m=f(x0+h)f(x0)(x0+h)x0.

This simplifies to

m=f(x0+h)f(x0)h.

This expression is called the difference quotient. Note that h can be postive or negative - it is perfectly valid to take a secant with a secondary point to the left.

Now, to find the slope of the tangent, m0 we let h be zero. We cannot simply set it 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:

m0=limh0[f(x0+h)f(x0)h]

Exercises

  1. Find the slope of the tangent to the curve y=x2 at x=1.

The Slope at a Point

Consider the formula for average velocity in the x-direction, ΔxΔt. This formula can be used to find approximate results for speed, but is rarely exact. To correct this we look at the change in position as the change in time approaches 0. Mathematically this is written as: limΔt0ΔxΔt=dxdt, where d denotes change, x denotes distance, and t denotes time. Compare the operator d with Δ. The delta should be familiar to you from studying slope. They both indicate a difference between two numbers, however d denotes an infinitesimal difference.

(Note that the letter s is often used to denote distance, which would yield dsdt. The letter d is often avoided in denoting distance due to the ambiguity in the expression dddt.)

If a function f(x) is plotted on an (x,y) Cartesian coordinate system, differentiation will yield a function which describes the rate of change of y with respect to x.

The rate of change at a specific point is called the instantaneous rate of change. The line with a slope equal to the instantaneous rate of change and that only touches the graph at that specific point is known as a tangent.

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. But what exactly do we mean by "touching"?

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 flat). In fact, at any vertex of any smooth function the slope is zero, because the slope of the tangent lines on either side of the point are opposite signs.

But how can you find the slope of, say, y=sinx+x2 at x=1.5?

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, dfdx or ddx[f], 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)=|x| (the absolute value function) then f(x)={1,x<0undefined,x=01,x>0.

Here, f(x) is not smooth (though it is continuous) at x=0 and so the limits limx0+f(x) and limx0f(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.

The Definition of the Derivative

The derivative is the formula mtan (slope of tangent line) on a curve at a specific point.

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 =ΔyΔ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=ΔyΔx=6*4=24 again. No need for a calculator!


f(x)=limΔx0[f(x+Δx)f(x)Δx]

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) = x2
f(x) = limΔx0(x+Δx2x2Δx)
= limΔx0(12)
= 12

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) = x2
f(x) = limΔx0[(x+Δx)2x2Δx]
= limΔx0(x2+2xΔx+Δx2x2Δx)
= limΔx0(2xΔx+Δx2Δx)
= limΔx0(2x+Δx)
= 2x

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 dydx. 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 ddx, which literally means "derivative with respect to x". You may safely assume that it is the equivalent of dydx 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 dxdy, which sometimes will be written ddy. Or, you may see a derivative in polar coordinates marked as dθdr.

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

  • dydx=2x
  • ddxx2=2x
  • dy=2xdx 
  • f(x)=2x 
  • D(f(x))=2x 

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 |x| 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 formulae and the fact limt0sintt=1

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.

Derivative of a Constant Function

For any fixed real number c,

ddx[c]=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Δx0[f(x+Δx)f(x)Δx]

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:

ddx[c]=limΔx0[(c)cΔx]=0

Example

ddx[3]=0

Example

ddx[z]=0

Derivative of a Linear Function

For any fixed real numbers m and c,

ddx[mx+c]=m

The special case dxdx=1 shows the advantage of the ddx 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.

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.

The Constant Rule

For any fixed real number c,

ddx[cf(x)]=cddx[f(x)]

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

ddx[x2]=2x.

Suppose we want to find the derivative of 3x2

ddx[3x2] = 3ddx[x2]
= 3×2x
= 6x

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

The Addition and Subtraction Rules

ddx[f(x)±g(x)]=ddx[f(x)]±ddx[g(x)]

Proof

From the definition:

limΔx0[[f(x+Δx)±g(x+Δx)[f(x)±g(x)]Δx]

=limΔx0[[f(x+Δx)f(x)]±[g(x+Δx)g(x)]Δx]

=limΔx0[[f(x+Δx)f(x)]Δx]±limΔx0[[g(x+Δx)g(x)]Δx]

By definition then, this last term is ddx[f(x)]+ddx[g(x)]

Example

What is:

ddx[3x2+5x] = ddx[3x2+5x]
= ddx[3x2]+ddx[5x]
= 6x+ddx[5x]
= 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.

The Power Rule

ddx[xn]=nxn1,x0

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 xn1=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

ddx[x] = ddx[x1/2]
= 12x1/2
= 12x

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.

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.

ddx[6x5+3x2+3x+1]

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

ddx[6x5]+ddx[3x2]+ddx[3x]+ddx[1].

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

ddx[6x5]+ddx[3x2]+3+0.

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

6ddx[x5]+3ddx[x2]+3.

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

6(5x4)+3(2x)+3.

And then do some algebra to get the final answer:

30x4+6x+3.

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

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.

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 meaing 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 fall or rise. Becuase 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(x)=x3.

The derivative is

f(x)=3x2

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 maxima or minima. 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.

The Extremum Test

A more rigourous 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(x)=0,f(x)=0,,f(n)(x)=0,f(n+1)(x)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(x)=x4

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

f(x)=4x3
f(x)=12x2
f(x)=24x
f(4)(x)=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 give 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.

Template:Calculus:TOC

[[Category:Calculus|Template:FULLCHAPTERNAME]]