1. Functions and Plots
    • We are interested in continuous functions, which is not always the case. Could define f(x) = 1 when x ³ 0 and -1 when x is negative.
    • Also looking at cases where y=f(x). For example where f(x) is linear like x, 3x+2, 3-x. Can of course be x3+2x or more complex polynomials. Can plot these using mathematica to see what it looks like. To get a feel for what x2 looks like or y=mx+c for various m's and c's.
    • Can also have parametric functions, where both x and y are functions of some other variable, t say.

  2. Working with the line
    1. What is the equation of a line through (3,8) and (1,2)? Does (3,2) lie on the line through (4,4) and (6,8)?
    2. Where does the line through (1,3) and (2,2) intersect with the line through (1,1) and (2,5)?

    3.If draw a curve, with positive slope then keeps getting higher and higher. If it has a maximum though then the slope must level off and then become negative. Similarly for a minimum it must level off before becoming positive.

    If we have a polynomial then we would like to find where its slope is zero(as in where it levels off) and whether the slope then becomes +ve(then a minimum) or -ve(then a max).

    We can do this using mathematica since D[f[x],x] gives us the slope of f[x] as a function of x. Then we would like to know where this is zero. Can do this too by using Solve[D[f[x],x]==0,x]. For the moment only looking at polynomials so you only need to know that xn goes to nxn-1.

    Using D[D[f[x],x],x] can check whether max or min. Try these for tuesday:

    1. x3-2x+2
    2. 3x2+2x-8

    and so on.

  3. Newton-Raphson
    • Algorithm to find roots of polynomials
    • Will use the fact that the derivative is the slope and that the derivative of xn is nxn-1.
    • We begin by making a guess for root of f(x), which in general not be right. Will have f(x0). Now look at the slope of the function at x0. If m then would guess that f hits zero at
      x1 = x0-f(x0)/m,
      which would the case if the f was linear. This 2nd guess will also not normally be a root but if we keep going we will find one. So look at f(x1) and the slope at x1, use these to get x2 and so on!
    • To find a root of x3-x2+x-1 = 0 we need to make an initial guess. So I chose x0 = 0. f(x) = -1 so this is not a root. Now using the algorithm we can determine
      x1 = x0-f(x0)/m.
      x0 = -1 and f(0) = -1 but we need to determine m, the slope. The slope at x0 is given by the derivative at x0 which is
      x3-x2+x-1 ® 3x2-2x+1.
      The slope at x0 then is
      3(0)2-2(0)+1 = 1
      and
      x1 = 0- (-1)/1 = 1.
      Then x1 = 1 and f(1) = 1-1+1-1 = 0 so we have found the root already.
    • Normally will not get an exact solution and we look for x where | f(x) | < 0.001 to get close to a root.
    • We only get a root this way. In order to get all of them would divide the polynomial by (x-xroot) to get a simpler polynomial which we would again apply the algorithm too. Depending on our initial guess we converge to different roots.


File translated from TEX by TTH, version 2.70.
On 3 Dec 2002, 10:50.