Introduction
Introduction
Last term we introduced differentiation which is related to finding the
slope of a function at a point. Recall that in coordinate geometry we
can specify the location of a point using coordinates. For example in
2D we can say that the origin is located at (0,0), Any point on
on the plane can be specified using two coordinates in such fashion.
We can in this language draw a graph representation of a function. For
example if we have a function of x, f(x) say. Then we can say
that given x, the y coordinate is f(x).
We can then speak about the equation of a line since
given any line we can determine the function which is associated to it.
The general line is given by the equation y = mx+c where c is the value of
the function as x = 0 and m is the slope. We can express any line in this way.
The slope is how steep the line is, it's gradient or whatever you want to
call it. It is a measure of how much y changes given a unit change in x.
This can otherwise be written as
If we pick any two points on a line we get the same answer.
Say we have the line y = mx+c then we have that y1 = mx1+c and
y2 = mx2+c. Plugging these into the formula above we get
|
m = |
(mx2+c)-(mx1+c) x2-x1
|
= |
m(x2-x1) x2-x1
|
= m. |
|
If we know that the points (1,2) and (3,8) are on a line we
can figure out the associated equation. We first compute the slope
which is
and then compute c. If the points lie on a line they must
be solutions of the equation y = mx+c. So isince x = 1 and y = 2
is a solution with m = 2 we have 2 = 2·1 +c or c = 0.
We saw last term that if we wanted the slope at a point for a curve then
it was not uniquely defined since it depended on which two points you took.
To get round this problem we used limits. If we take two points x1 = x and
x2 = x+h then the slope between these points would be
|
|
f(x+h)-f(x) (x+h)-x)
|
= |
f(x+h)-f(x) h
|
. |
|
We took the limit of this as h® 0 and found that it was well defined
for polynomials.
If f(x) = x then the derivative of this is limh® 0 [((x+h)-x)/h] = 1
In general xn goes to nxn-1. Also sinx goes to cosx and cosx
to -sinx. These are our basic building blocks.
We also have the product rule, the quotient rule and the chain rule. These
let us break down more complicated problems into the basic building blocks
which we know how to deal with. This completes are review of differentiation.
- Product rule: If we have f(x)=u(x)v(x) then
- Quotient rule:If we have f(x) = u(x)/v(x) then
- Chain Rule: g(f(x)) goes to g¢(f(x))f¢(x).
A final trick is using substitution. Here we rewrite the problem in terms of u,
say, and the use the fact that
For example if we want to differentiate (2x-3)2 we say u = 2x-3.
Then [du/dx] = 2 and so
|
|
dy dx
|
= |
dy du
|
|
du dx
|
= 2u·2 = 4u = 4(2x-3). |
|
We could have said (2x-3)2 = 4x2-12x+9 and differentiated that
to get the same answer but that doesn't always work. For example
if we had (2x-3)[3/2].
Max/Min
If we have a function we can use differentiation to compute where
they take their max or min value. The idea here is to note that
when you at the max the slope has to be zero. If it wasn't then
the function would increase if you went a bit more to the
right(if slope positive) or left(if slope negative). Once
find the points where the slope is zero we can determine
whether we have a max or a min by looking at the 2nd derivative.
If this is positive at the point where the slope is zero then
we have a minimum, if it is negative we have a maximum.
We want to find where f(x) = 3x2-6x+2 takes its lowest value. To do this
we
- Differentiate and find c where [df(c)/dx] = 0.
- Differentiate again and check what the sign of [(d2f(c))/(dx2)]
is. If positive then c is a min, if negative then a max.
f(x) = 3x2-6x+2, so [df(c)/dx] = 6c-6 = 0 or c = 1.
[(df(1))/(dx2)] = 6 > 0 so this is a min.
We can then apply this approach.
If we have 400m of fence and we want to enclose a rectangular area
using this. What should the length, x, and width, y be to maximise the
area enclosed? We have 400m of fence so 2x+2y = 400 and the area enclosed
is given by product of the length and width xy. Using the first
equation we have that y = 200-x. Plugging this into our expression
for the area we have A(x) = x(200-x). We can then differentiate this
to find the max.
Taylor Expansion
Another application of differentiation are Taylor expansions. Here we say that
|
f(x+h) = f(x)+h |
df dx
|
+ |
h2 2!
|
|
d2f(x) dx2
|
+ |
h3 3!
|
|
d3f(x) dx3
|
+¼. |
|
This allows us to re-express functions in terms of polynomials. A
standard application of this is to use it for when h is small.
When this is the case h2 is smaller and h3 is small still. So
what we do is ignore these and only keep the first two terms of the
expression. We can for example look at
|
|
1 1-x
|
= (1-x)-1 = 1+h+ |
h2 2
|
+¼ |
|
expanding things about x = 0. Note that here we must have h < 1
since then x = 1 we are dividing by zero. Taylor expansions are
for continous functions.
Know that things are not working if the 3rd term in our expansion is not
small. This can result if we are near a danger spot. If
we expand about x then we cannot have a danger spot within h of it.
At danger spots the function we are approximating is no longer continuous and
so our approximation breaks down. For example with something like 1/x, x = 0
is a danger spot or for Öx, x < 0. In the example above 1/1-x
, x = 1 is obviously a danger spot and so we must have h < 1 to avoid this.
Newton-Raphson
Finally we look at Newton-Raphson. We can use this to help find
the roots of equations. We have f(x) and we want to find
when f(x) = 0. What we do is take a guess. This doesn't work
but using our first guess we can make another one which should
be better. So we have a point (x1,y1) where y1 = f(x1)
We then imagine that the function is linear. If that were the
case then the slope would be constant. We know that the slope
at the point x1 is given by the derivative of f(x) there.
We want f(x) = 0 but have f(x1) = y1 and know that the
slope, which tells us how y changes with respect to x,
at x1 is [(df(x1))/dx].
If y = f(x1) then we want to find x2 such that f(x2) = 0.
If x increase by 1 then y increase by mx. If we want
y to decrease by f(x1) then we should decrease x by
This is the the Newton-Raphson(NR) method. Of course the function is
not linear so we don't get f(x2) = 0 but we can make another guess
from x2 and after several attempts we converge to the solution.
It is more suited for numerical work but the idea is clear enough.
If we have a linear equation y = x+1 then we know that y = 0 when
x = -1. Using NR we take a guess, so say x1 = 1 then find that
y1 = 2. The slope of this line is 1 so our next guess would be
|
x2 = x1- |
f(x1)
|
= 1- |
2 1
|
= -1. |
|
Trying x2 = -1 we get y = -1+1 = 0! We would expect it to work in
one step for a line since the slope is constant.
File translated from
TEX
by
TTH,
version 2.70.
On 3 May 2002, 13:38.