Calculus/Differentiation/Differentiation Defined

From Wikibooks, open books for an open world
Jump to: navigation, search
← Differentiation/Contents Calculus Product and Quotient Rules →
Differentiation/Differentiation Defined

What is Differentiation?[edit]

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.

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 = f(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)=3x^2, the slope can depend on x; differentiation gives us a function which represents this slope.

The Definition of Slope[edit]

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 = m x + c is its own tangent; the slope at any point is m. For the parabola y = x^2, the slope at the point (0,0) is 0; the tangent line is horizontal.

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

Of a line[edit]

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 \Delta (pronounced "delta"). Thus, a change in x is written as \Delta 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 (x_1, y_1) and (x_2, y_2) 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 \alpha is the angle from the rightward-pointing horizontal to the line, measured counter-clockwise. If you recall that the tangent of an angle is the ratio of the y-coordinate to the x-coordinate on the unit circle, you should be able to spot the equivalence here.

Of a graph of a function[edit]

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)
Tangency Example 1.svg Tangency Example 2.svg
(iii) (iv)
Tangency Example 3.svg Tangency Example 4.svg
  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.

Tangent as Secant Limit.svg

As the distance h tends to zero, the secant line becomes the tangent at the point x_0. 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, m_h, using the formula from before:

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

(We will refer to the slope as m_h 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 (x_0,f(x_0)) 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 (x_0,f(x_0)) 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 (x_0,f(x_0)) with slope m.

Exercises[edit]

1. Find the slope of the tangent to the curve y=x^2 at (1,1).

2

Solutions

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

Consider the formula for average velocity in the x direction, \frac{\Delta x}{\Delta t}, where \Delta x is the change in x over the time interval \Delta 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 \Delta. The idea is that both indicate a difference between two numbers, but \Delta 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}.)

The Definition of the Derivative[edit]

You may have noticed that the two operations we've discussed — computing the slope of the tangent to the graph of a function and computing the instantaneous rate of change of the function — involved exactly the same limit. That is, the slope of the tangent to the graph of y=f(x) is \frac{dy}{dx}. Of course, \frac{dy}{dx} can, and generally will, depend on x, so we should really think of it as a function of x. We call this process (of computing \frac{dy}{dx}) 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.

Since lots of different sorts of people use derivatives, there are lots of different mathematical notations for them. Here are some:

  • f'(x)\ (read "f prime of x") for the derivative of f(x),
  • D_x[f(x)],
  • D f(x),
  • \frac{dy}{dx} for the derivative of y as a function of x or
  • \frac{d}{dx}\left[ y\right], which is more useful in some cases.

Most of the time the brackets are not needed, but are useful for clarity if we are dealing with something like D (fg), where we want to differentiate the product of two functions, f and g.

The first notation has the advantage that it makes clear that the derivative is a function. That is, if we want to talk about the derivative of f(x) at x=2, we can just write f'(2).

In any event, here is the formal definition:

Definition: (derivative)
Let f(x) be a function. Then f'(x) = \lim_{\Delta x \to 0}\frac{f(x+\Delta x)-f(x)}{\Delta x} wherever this limit exists. In this case we say that f is differentiable at x and its derivative at x is f'(x).

Examples[edit]

Example 1

The derivative of f(x)=x/2 is

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{\frac{x}{2}+\frac{\Delta x}{2} - \frac{x}{2}}{\Delta x}\right)=\lim_{\Delta x \to 0}\left(\frac{\frac{\Delta x}{2}}{\Delta x}\right)=\lim_{\Delta x \to 0}\left(\frac{\Delta x}{2 \Delta x}\right)=\lim_{\Delta x \to 0}\left(\frac{1}{2}\right)=\frac{1}{2},

no matter what x is. This is consistent with the definition of the derivative as the slope of a function.

Example 2

What is the slope of the graph of  y=3x^2 at (4,48)? 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 \Delta x=0.002.

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

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

But, to solve the problem precisely, we compute

\lim_{\Delta x\to 0}\frac{3(4+\Delta x)^2-48}{\Delta x}\, = 3\lim_{\Delta x\to 0}\frac{(4+\Delta x)^2-16}{\Delta x}
= 3\lim_{\Delta x\to 0}\frac{16+8\Delta x+(\Delta x)^2-16}{\Delta x}
= 3\lim_{\Delta x\to 0}\frac{8\Delta x+(\Delta x)^2}{\Delta x}
= 3\lim_{\Delta x\to 0}(8+\Delta x)
= 3(8)
= 24.

We were lucky this time; the approximation we got above turned out to be exactly right. But this won't always be so, and, anyway, this way we didn't need a calculator.

In general, the derivative of f(x)=3x^2 is

f'(x)\, = \lim_{\Delta x\to 0}\frac{3(x+\Delta x)^2-3x^2}{\Delta x}
= 3\lim_{\Delta x\to 0}\frac{(x+\Delta x)^2-x^2}{\Delta x}
= 3\lim_{\Delta x\to 0}\frac{x^2+2x\Delta x+(\Delta x)^2-x^2}{\Delta x}
= 3\lim_{\Delta x\to 0}\frac{2x\Delta x+(\Delta x)^2}{\Delta x}
= 3\lim_{\Delta x\to 0}(2x+\Delta x)
= 3(2x)
= 6x.

Example 3

If f(x) = \left|x\right| (the absolute value function) then f'(x) = \frac{x}{\left|x\right|}, which can also be stated as f'(x) = \left\{ \begin{matrix} -1, & x < 0 \\ \operatorname{undefined}, & x = 0 \\ 1, & x > 0 \end{matrix} \right. . Finding this derivative is a bit complicated, so we won't prove it at this point.


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. From the definition, f'(0)=\lim_{\Delta x\to 0}\frac{\left|\Delta x\right|}{\Delta x}, which does not exist. Thus, f'(0) is 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.

Understanding the derivative notation[edit]

The derivative notation is special and unique in mathematics. The most common notation for 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, although you should remember that the precise definition is the one we gave above. Often, in an equation, you will see just \frac{d}{dx}, which literally means "derivative with respect to x". This means we should take the derivative of whatever is written to the right; that is, \frac{d}{dx}(x+2) means \frac{dy}{dx} where y=x+2.

As you advance through your studies, you will see that we sometimes pretend that dy and dx are separate entities that can be multiplied and divided, by writing things like dy=x^4\,dx. Eventually you will see derivatives such as \frac {dx} {dy}, which just means that the input variable of our function is called y and our output variable is called x; sometimes, we will write  \frac{d}{dy}, to mean the derivative with respect to y of whatever is written on the right. In general, the variables could be anything, say \frac{d\theta}{dr}.

All of the following are equivalent for expressing the derivative of y = x^{2}

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

Exercises[edit]

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

2

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

\frac{d x^3}{dx}=3x^2\qquad\frac{d x^4}{dx}=4x^3

4. 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.

\begin{alignat}{2}\lim_{\Delta x\to 0^-}\frac{\left|0+\Delta x\right|-\left|0\right|}{\Delta x}
&=\lim_{\Delta x\to 0^-}\frac{-\Delta x}{\Delta x}
& \qquad\lim_{\Delta x\to 0^+}\frac{\left|0+\Delta x\right|-\left|0\right|}{\Delta x}
&= \lim_{\Delta x\to 0^+}\frac{\Delta x}{\Delta x}\\
&=\lim_{\Delta x\to 0^-}-1
& &=\lim_{\Delta x\to 0^+}1\\
&=-1
& &=1
\end{alignat}
Since the limits from the left and the right at x=0 are not equal, the limit does not exist, so \left|x\right| is not differentiable at x=0.

5. Graph the derivative to y=4x^2 on a piece of graph paper without solving for  dy/dx . Then, solve for  dy/dx and graph that; compare the two graphs.
6. Use the definition of the derivative to show that the derivative of \sin x is \cos x . Hint: Use a suitable sum to product formula and the fact that \lim_{t \to 0}\frac{\sin(t)}{t}=1 and \lim_{t \to 0}\frac{\cos(t)-1}{t}=0.

\begin{align}\lim_{\Delta x\to 0}\frac{\sin(x+\Delta x)-\sin(x)}{\Delta x}
&=\lim_{\Delta x\to 0}\frac{(\sin(x)\cos(\Delta x)+\cos(x)\sin(\Delta x))-\sin(x)}{\Delta x}\\
&=\lim_{\Delta x\to 0}\frac{\sin(x)(\cos(\Delta x)-1)+\cos(x)\sin(\Delta x)}{\Delta x}\\
&=\sin(x)\cdot\lim_{\Delta x\to 0}\frac{\cos(\Delta x)-1}{\Delta x}+\cos(x)\cdot\lim_{\Delta x\to 0}\frac{\sin(\Delta x)}{\Delta x}\\
&=\sin(x)\cdot 0+\cos(x)\cdot 1\\
&=\cos(x)
\end{align}

Solutions

Differentiation Rules[edit]

The process of differentiation is tedious for complicated 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 fairly easy to differentiate a wide variety of functions. Some of the simplest rules involve the derivative of linear functions.

Derivative of a constant function[edit]

For any fixed real number c,

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

Intuition[edit]

The graph of 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 values of x and c.

Proof[edit]

The definition of a derivative is

\lim_{\Delta x \to 0}\frac{f(x+\Delta x)-f(x)}{\Delta x}.

Let  f(x) = c for all x. (That is, f is a constant function.) Then  f(x+\Delta x) = c . Therefore

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

Let g(\Delta x)=\frac{0}{\Delta x}. To prove that \lim_{\Delta x\to 0}g(\Delta x)=0, we need to find a positive \delta such that, for any given positive \varepsilon, \left|g(\Delta x)-0\right|<\varepsilon whenever 0<\left|\Delta x-0\right|<\delta. But \left|g(\Delta x)-0\right|=0, so \left|g(\Delta x)-0\right|<\varepsilon for any choice of \delta.

Examples[edit]

  1. \frac{d}{dx}\left[3\right]=0
  2. \frac{d}{dx}\left[z\right]=0

Note that, in the second example, z is just a constant.

Derivative of a linear function[edit]

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.

Intuition[edit]

The graph of y=mx+c is a line with constant slope m.

Proof[edit]

If f(x)=mx+c, then f(x+\Delta x)=m(x+\Delta x)+c. So,

f'(x)\, = \lim_{\Delta x\to 0}\frac{m(x+\Delta x)+c-mx-c}{\Delta x}\,
= \lim_{\Delta x\to 0}\frac{m(x+\Delta x)-mx}{\Delta x}
= \lim_{\Delta x\to 0}\frac{mx+m\Delta x-mx}{\Delta x}\,
= \lim_{\Delta x\to 0}\frac{m\Delta x}{\Delta x}
= m.

Constant multiple and addition rules[edit]

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 by breaking them up into simpler functions. Two tools that let us do this are the constant multiple rule and the addition rule.

The Constant Rule[edit]

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. The details are left as an exercise.

Example

We already know that

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

Suppose we want to find the derivative of 3x^2

\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.

The Addition and Subtraction Rules[edit]

\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 the derivative of 3x^2+5x?

\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.

The Power Rule[edit]

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

For example, in the case of x^2 the derivative is 2x^1=2x as was established earlier. A special case of this rule is that dx/dx=dx^1/dx=1x^0=1.

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.

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}

Derivatives of polynomials[edit]

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.

Exercises[edit]

  • Find the derivatives of the following equations:
7.  f(x) = 42

f'(x)=0

8.  f(x) = 6x + 10

f'(x)=6

9.  f(x) = 2x^2 + 12x + 3

f'(x)=4x+12

Solutions

← Differentiation/Contents Calculus Product and Quotient Rules →
Differentiation/Differentiation Defined