Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
MS121: IT Mathematics
Differentiation
Introduction
John CarrollSchool of Mathematical Sciences
Dublin City University
Outline
1 Introduction
2 Secant Lines & Tangents
3 Differentiation from First Principles
4 First Principles: Examples
5 How Can a Function Fail to Be Differentiable?
Introduction
Outline
1 Introduction
2 Secant Lines & Tangents
3 Differentiation from First Principles
4 First Principles: Examples
5 How Can a Function Fail to Be Differentiable?
Differentiation (1/5) MS121: IT Mathematics John Carroll 3 / 58
Introduction Differentiation
Differentiation
What is Differentiation
Differentiation is a mathematical technique for analysing the way inwhich functions change.
In particular, it determines how rapidly a function is changing at anyspecific point.
Differentiation also allows us to find maximum and minimum valuesof a function which can be useful in determining optimum values ofkey variables.
Differentiation (1/5) MS121: IT Mathematics John Carroll 4 / 58
Introduction Differentiation
Differentiation from First Principles
Slope of a Line
Recall how we find the slope of a straight line connecting two points(x1, y1) and (x2, y2), given by
slope =y2 − y1
x2 − x1.
We could also write this as
slope =change in y
change in x=
dy
dx
Differentiation (1/5) MS121: IT Mathematics John Carroll 5 / 58
Introduction Differentiation
Differentiation from First Principles
Slope of a Curve?
How do we define the slope of a curve? We define it in terms of the slopeof a straight line which we already know.
Finding the Slope of a Curve
Take any curve and the point at which the slope is required.
At this point, draw the tangent to the curve.
The tangent is a straight line which, at the point in question, appearsto be parallel to the curve.
The slope of the curve at this point is simply the slope of the tangent.
Differentiation (1/5) MS121: IT Mathematics John Carroll 6 / 58
Secant Lines & Tangents
Outline
1 Introduction
2 Secant Lines & Tangents
3 Differentiation from First Principles
4 First Principles: Examples
5 How Can a Function Fail to Be Differentiable?
Differentiation (1/5) MS121: IT Mathematics John Carroll 7 / 58
Secant Lines & Tangents Tangents
Differentiation: An Introduction — Tangents
If a curve C has equation y = f (x)and we want to find the tangentline to C at the point P(a, f (a)),then we consider a nearby pointQ(x , f (x)), where x 6= a, andcompute the slope of the secantline:
mPQ =f (x)− f (a)
x − a
Differentiation (1/5) MS121: IT Mathematics John Carroll 8 / 58
Secant Lines & Tangents Tangents
Differentiation: An Introduction — Tangents
mPQ =f (x)− f (a)
x − a
Then we let Q approach Palong the curve C by letting xapproach a.
If mPQ approaches a number m,then we define the tangent t tobe the line through P with slopem.
The tangent line is the limitingposition of the secant line PQas Q approaches P.
Differentiation (1/5) MS121: IT Mathematics John Carroll 9 / 58
Secant Lines & Tangents Tangents
Differentiation: An Introduction — Tangents
Definition
The tangent line to the curvey = f (x) at the point at the pointP(a, f (a)) is the line through P withslope
m = limx→a
f (x)− f (a)
x − a
provided that this limit exists.
Differentiation (1/5) MS121: IT Mathematics John Carroll 10 / 58
Secant Lines & Tangents Tangents
Differentiation: An Introduction — Tangents
Easier Expression
If h = x − a, then x = a + h andso the slope of the secant linePQ is
mPQ =f (a + h)− f (a)
h
As x approaches a, h approaches0 (because h = x − a) and sothe expression for the slope ofthe tangent line becomes
m = limh→0
f (a + h)− f (a)
h
Differentiation (1/5) MS121: IT Mathematics John Carroll 11 / 58
Secant Lines & Tangents Illustration using Secant Lines
Tangent to y = x2 at the point x = 1
−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−1
−0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
x
y
y = x2
y = 2x − 1
Differentiation (1/5) MS121: IT Mathematics John Carroll 12 / 58
Secant Lines & Tangents Illustration using Secant Lines
Differentiation from First Principles
−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−1
−0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
x
y
y = x2
y = 2x − 1
Slope of a Curve
As you will see from the graph, the slopes at different points on the curvewill be different (unlike the straight line where the slope is always thesame, no matter where it is evaluated).
Differentiation (1/5) MS121: IT Mathematics John Carroll 13 / 58
Secant Lines & Tangents Illustration using Secant Lines
Limit of Secant Lines: y = x2 at the point x = 1
SECANT LINE ILLUSTRATION
f(x) = x2 C = (1,1)
−1.5 −1 −0.5 0 0.5 1 1.5 2 2.5−0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
*C
o
o
Secant slopes.
1.4695
Differentiation (1/5) MS121: IT Mathematics John Carroll 14 / 58
Secant Lines & Tangents Illustration using Secant Lines
Limit of Secant Lines: y = x2 at the point x = 1
SECANT LINE ILLUSTRATION
f(x) = x2 C = (1,1)
−1.5 −1 −0.5 0 0.5 1 1.5 2 2.5−0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
*C
o
o
Secant slopes.
1.4695
1.5453
Differentiation (1/5) MS121: IT Mathematics John Carroll 15 / 58
Secant Lines & Tangents Illustration using Secant Lines
Limit of Secant Lines: y = x2 at the point x = 1
SECANT LINE ILLUSTRATION
f(x) = x2 C = (1,1)
−1.5 −1 −0.5 0 0.5 1 1.5 2 2.5−0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
*C
o
o
Secant slopes.
1.4695
1.5453
1.6211
Differentiation (1/5) MS121: IT Mathematics John Carroll 16 / 58
Secant Lines & Tangents Illustration using Secant Lines
Limit of Secant Lines: y = x2 at the point x = 1
SECANT LINE ILLUSTRATION
f(x) = x2 C = (1,1)
−1.5 −1 −0.5 0 0.5 1 1.5 2 2.5−0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
*C
o
o
Secant slopes.
1.4695
1.5453
1.6211
1.6969
Differentiation (1/5) MS121: IT Mathematics John Carroll 17 / 58
Secant Lines & Tangents Illustration using Secant Lines
Limit of Secant Lines: y = x2 at the point x = 1
SECANT LINE ILLUSTRATION
f(x) = x2 C = (1,1)
−1.5 −1 −0.5 0 0.5 1 1.5 2 2.5−0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
*C
o
o
Secant slopes.
1.4695
1.5453
1.6211
1.6969
1.7726
Differentiation (1/5) MS121: IT Mathematics John Carroll 18 / 58
Secant Lines & Tangents Illustration using Secant Lines
Limit of Secant Lines: y = x2 at the point x = 1
SECANT LINE ILLUSTRATION
f(x) = x2 C = (1,1)
−1.5 −1 −0.5 0 0.5 1 1.5 2 2.5−0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
*C
o
o
Secant slopes.
1.4695
1.5453
1.6211
1.6969
1.7726
1.8484
Differentiation (1/5) MS121: IT Mathematics John Carroll 19 / 58
Secant Lines & Tangents Illustration using Secant Lines
Limit of Secant Lines: y = x2 at the point x = 1
SECANT LINE ILLUSTRATION
f(x) = x2 C = (1,1)
−1.5 −1 −0.5 0 0.5 1 1.5 2 2.5−0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
*C
o
o
Secant slopes.
1.4695
1.5453
1.6211
1.6969
1.7726
1.8484
2
Slope of Tangent Line
Differentiation (1/5) MS121: IT Mathematics John Carroll 20 / 58
Secant Lines & Tangents Illustration using Secant Lines
Example
Find an equation of the tangent lineto the hyperbola y = 3
x at the point(3, 1).
Differentiation (1/5) MS121: IT Mathematics John Carroll 21 / 58
Secant Lines & Tangents Illustration using Secant Lines
Solution (1/2): Slope of Tangent
Let f (x) = 3x . Then the slope of the
tangent at (3, 1) is:
m = limh→0
f (3 + h)− f (3)
h
= limh→0
33+h − 1
h
= limh→0
−1
3 + h
= −1
3
Differentiation (1/5) MS121: IT Mathematics John Carroll 22 / 58
Secant Lines & Tangents Illustration using Secant Lines
Solution (2/2): Equation of Tangent
Therefore, an equation of thetangent at the point (3, 1) is
y − 1 = −1
3(x − 3)
which simplifies to
x + 3y − 6 = 0
Differentiation (1/5) MS121: IT Mathematics John Carroll 23 / 58
Differentiation from First Principles
Outline
1 Introduction
2 Secant Lines & Tangents
3 Differentiation from First Principles
4 First Principles: Examples
5 How Can a Function Fail to Be Differentiable?
Differentiation (1/5) MS121: IT Mathematics John Carroll 24 / 58
Differentiation from First Principles Definition
Differentiation from First Principles
Method of Differentiation
We do not need to keep drawing tangents to find the slopes — wecan use differentiation.
The derivative (obtained by differentiation) of a curve at a point isthe slope of the curve at that point.
We shall first differentiate functions from first principles.
Differentiation (1/5) MS121: IT Mathematics John Carroll 25 / 58
Differentiation from First Principles Definition
The Derivative of a Function
Definition
The derivative of the function f : R → R at a value x = a, if it exists, is
limh→0
f (a + h)− f (a)
h
Differentiation (1/5) MS121: IT Mathematics John Carroll 26 / 58
Differentiation from First Principles Definition
Differentiation from First Principles
Basic Approach
The idea is to consider the line joining the two points (a, f (a)) and(a + h, f (a + h)) which, for h small, will approximate the tangent tothe curve at the point x = a.
Compute the slope of this line:
slope =y2 − y1
x2 − x1=
f (a + h)− f (a)
(a + h)− a=
f (a + h)− f (a)
h
and then take the limit as h tends to zero, giving
dy
dx= lim
h→0
f (a + h)− f (a)
h.
Differentiation (1/5) MS121: IT Mathematics John Carroll 27 / 58
Differentiation from First Principles Definition
Differentiation from First Principles
Differentiation (1/5) MS121: IT Mathematics John Carroll 28 / 58
First Principles: Examples
Outline
1 Introduction
2 Secant Lines & Tangents
3 Differentiation from First Principles
4 First Principles: Examples
5 How Can a Function Fail to Be Differentiable?
Differentiation (1/5) MS121: IT Mathematics John Carroll 29 / 58
First Principles: Examples Using the Limit Equation
Example 1
We will find the derivative from first principles of f (x) = x2 at x = a.
Solution
We will find the derivative from first principles of f (x) = x2 at x = a.First compute
f (a + h)− f (a)
h=
(a + h)2 − a2
h
=(a2 + 2ah + h2)− a2
h
=2ah + h2
h= 2a + h
Differentiation (1/5) MS121: IT Mathematics John Carroll 30 / 58
First Principles: Examples Using the Limit Equation
f (x) = x2
Example 1 (Cont’d)
Then take limits to obtain
limh→0
f (x + h)− f (x)
h= lim
h→0(2a + h) = 2a
Differentiation (1/5) MS121: IT Mathematics John Carroll 31 / 58
First Principles: Examples Using the Limit Equation
The function y = x2 on the interval [0, 3]
0 0.5 1 1.5 2 2.5 30
1
2
3
4
5
6
7
8
9
y = x2
Differentiation (1/5) MS121: IT Mathematics John Carroll 32 / 58
First Principles: Examples Using the Limit Equation
Function y = x2 1st Secant Line with h = 2
0 0.5 1 1.5 2 2.5 30
1
2
3
4
5
6
7
8
9
y = x2
Differentiation (1/5) MS121: IT Mathematics John Carroll 33 / 58
First Principles: Examples Using the Limit Equation
Function y = x2 2nd Secant Line with h = 1.75
0 0.5 1 1.5 2 2.5 30
1
2
3
4
5
6
7
8
9
y = x2
Differentiation (1/5) MS121: IT Mathematics John Carroll 34 / 58
First Principles: Examples Using the Limit Equation
Function y = x2 3rd Secant Line with h = 1.5
0 0.5 1 1.5 2 2.5 30
1
2
3
4
5
6
7
8
9
y = x2
Differentiation (1/5) MS121: IT Mathematics John Carroll 35 / 58
First Principles: Examples Using the Limit Equation
Function y = x2 4th Secant Line with h = 1.25
0 0.5 1 1.5 2 2.5 30
1
2
3
4
5
6
7
8
9
y = x2
Differentiation (1/5) MS121: IT Mathematics John Carroll 36 / 58
First Principles: Examples Using the Limit Equation
Function y = x2 5th Secant Line with h = 1
0 0.5 1 1.5 2 2.5 30
1
2
3
4
5
6
7
8
9
y = x2
Differentiation (1/5) MS121: IT Mathematics John Carroll 37 / 58
First Principles: Examples Using the Limit Equation
Function y = x2 6th Secant Line with h = 0.75
0 0.5 1 1.5 2 2.5 30
1
2
3
4
5
6
7
8
9
y = x2
Differentiation (1/5) MS121: IT Mathematics John Carroll 38 / 58
First Principles: Examples Using the Limit Equation
Function y = x2 Limit as h→ 0
0 0.5 1 1.5 2 2.5 30
1
2
3
4
5
6
7
8
9
x
y
y = x2
y = 2x − 1
Differentiation (1/5) MS121: IT Mathematics John Carroll 39 / 58
First Principles: Examples Using the Limit Equation
Differentiation
Notation
The notation we use is as follows:
limh→0
f (a + h)− f (a)
h=
df (x)
dx
∣∣∣∣x=a
=dy
dx
∣∣∣∣x=a
where the vertical line (above) denotes “evaluated at”.
Differentiation (1/5) MS121: IT Mathematics John Carroll 40 / 58
First Principles: Examples Using the Limit Equation
Differentiation
Other Notation
It is important to note at this point that an alternative (“∆x”) notation isalso widely used, namely:
lim∆x→0
(y + ∆y)− y
(x + ∆x)− x= lim
∆x→0
∆y
∆x
=dy
dx.
We illustrate the use of the “∆” in the following example.
Differentiation (1/5) MS121: IT Mathematics John Carroll 41 / 58
First Principles: Examples Using the Limit Equation
Example 2
Differentiate the function y = x3 + 1 from first principles at x = a.
Solution
First compute the quotient ∆y∆x :
y = x3 + 1
y + ∆y = (x + ∆x)3 + 1
∆y = (x + ∆x)3 − x3
= x3 + 3x2∆x + 3x(∆x)2 + (∆x)3 − x3
= 3x2∆x + 3x(∆x)2 + (∆x)3
∆y
∆x= 3x2 + 3x∆x + (∆x)2
Differentiation (1/5) MS121: IT Mathematics John Carroll 42 / 58
First Principles: Examples Using the Limit Equation
y = x3 + 1
Example 2 (Cont’d)
We then take the limit as ∆x tends to zero:
∆y
∆x= 3x2 + 3x∆x + (∆x)2
dy
dx= lim
∆x→0
∆y
∆x
= 3x2
⇒ dy
dx
∣∣∣∣x=a
= 3a2
Differentiation (1/5) MS121: IT Mathematics John Carroll 43 / 58
First Principles: Examples Using the Limit Equation
Example 3
As a simpler example, we will find the derivative from first principles off (x) = x .
Solution
We compute
f (a + h)− f (a)
h=
(a + h)− a
h=
h
h= 1
so that, irrespective of h, we obtain
limh→0
f (x + h)− f (x)
h= lim
h→01 = 1
This is as expected since y = x is just the straight line with constant slope(= 1).
Differentiation (1/5) MS121: IT Mathematics John Carroll 44 / 58
First Principles: Examples Using the Limit Equation
Example 4
Differentiate from first principles the function y =√x for x > 0.
Solution
Since
f (x + h)− f (x)
h=
√x + h −
√x
h
=
√x + h −
√x
h·[√
x + h +√x√
x + h +√x
]=
1√x + h +
√x
we obtain
limh→0
f (x + h)− f (x)
h= lim
h→0
1√x + h +
√x
=1
2√x
Differentiation (1/5) MS121: IT Mathematics John Carroll 45 / 58
First Principles: Examples Using the Limit Equation
y =√x x > 0
Solution (Cont’d)
We then obtain
limh→0
f (x + h)− f (x)
h= lim
h→0
1√x + h +
√x
=1
2√x
Differentiation (1/5) MS121: IT Mathematics John Carroll 46 / 58
First Principles: Examples Using the Limit Equation
y =√x x > 0
Differentiation (1/5) MS121: IT Mathematics John Carroll 47 / 58
First Principles: Examples Using the Limit Equation
Footnote to Example 4
Note that, in order to simplify the expression√x + h −
√x , we
multiplied above and below by the “conjugate” expression√x + h +
√x .
We are making use of the identity
A2 − B2 = (A− B)(A + B)
and on the basis that it may sometimes be easier to deal withA2 − B2 than A− B (as in this case).
Differentiation (1/5) MS121: IT Mathematics John Carroll 48 / 58
First Principles: Examples Using the Limit Equation
Example 5
What is the slope of the curve y = 1x at the point x = 2?
Solution
As before, we compute:
f (x + h)− f (x)
h=
1x+h −
1x
h
=x − (x + h)
x(x + h)h
=−h
x(x + h)h
=−1
x(x + h)
Differentiation (1/5) MS121: IT Mathematics John Carroll 49 / 58
First Principles: Examples Using the Limit Equation
y =1
x
Example 5 (Cont’d)
Then take limits to obtain
limh→0
f (x + h)− f (x)
h=
−1
x(x + 0)= − 1
x2.
Finally, evaluate at x = 2 to obtain
dy
dx
∣∣∣∣x=2
= − 1
x2
∣∣∣∣x=2
= −1
4.
Differentiation (1/5) MS121: IT Mathematics John Carroll 50 / 58
How Can a Function Fail to Be Differentiable?
Outline
1 Introduction
2 Secant Lines & Tangents
3 Differentiation from First Principles
4 First Principles: Examples
5 How Can a Function Fail to Be Differentiable?
Differentiation (1/5) MS121: IT Mathematics John Carroll 51 / 58
How Can a Function Fail to Be Differentiable? Definition
When is a Function Differentiable?
Definition
A function is differentiable at a if f ′(a) exists.
It is differentiable on an open interval (a, b) if it is differentiable atevery number in the interval.
Differentiation (1/5) MS121: IT Mathematics John Carroll 52 / 58
How Can a Function Fail to Be Differentiable? Example: |x|
When is a Function Differentiable?
Example: f (x) = |x |
Differentiation (1/5) MS121: IT Mathematics John Carroll 53 / 58
How Can a Function Fail to Be Differentiable? Example: |x|
When is a Function Differentiable?
Example: f (x) = |x |: Case x > 0
If x > 0, then |x | = x and we can choose h small enough so thatx + h > 0 and hence |x + h| = x + h. Therefore, for x > 0, we have
f ′(x) = limh→0
|x + h| − |x |h
= limh→0
x + h − x
h
= limh→0
h
h= lim
h→01 = 1
and so f is differentiable for any x > 0.
Differentiation (1/5) MS121: IT Mathematics John Carroll 54 / 58
How Can a Function Fail to Be Differentiable? Example: |x|
When is a Function Differentiable?
Example: f (x) = |x |: Case x < 0
If x < 0, then |x | = −x and we can choose h small enough so thatx + h < 0 and hence |x + h| = −(x + h). Therefore, for x < 0, we have
f ′(x) = limh→0
−(x + h)− (−x)
h
= limh→0
−x − h + x
h
= limh→0
−hh
= limh→0−1 = −1
and so f is differentiable for any x < 0.
Differentiation (1/5) MS121: IT Mathematics John Carroll 55 / 58
How Can a Function Fail to Be Differentiable? Example: |x|
When is a Function Differentiable?
f ′(0) does not exist.
Differentiation (1/5) MS121: IT Mathematics John Carroll 56 / 58
How Can a Function Fail to Be Differentiable? Example: |x|
When is a Function Differentiable?
A formula for f ′ is given by
f ′(x) =
{−1 if x < 0+1 if x > 0
Note
f (x) = |x | is differentiable at all x except 0.
Differentiation (1/5) MS121: IT Mathematics John Carroll 57 / 58
How Can a Function Fail to Be Differentiable? Summary of Cases
How Can a Function Fail to Be Differentiable?
If the graph of a function f has a “corner” or “kink” in it, then the graphof has no tangent at this point and is not differentiable there.
The Three Cases
Differentiation (1/5) MS121: IT Mathematics John Carroll 58 / 58