L'Hospital's Rule, Min-Max (local & absolute)
              Curve Graphing, Newton's Method

                              Mathematica

Dr. Andrzej Korzeniowski
Department of Mathematics, UTA

Lab 4

[Graphics:Images/lesson4_gr_1.gif]
[Graphics:Images/lesson4_gr_2.gif]
[Graphics:Images/lesson4_gr_3.gif]
[Graphics:Images/lesson4_gr_4.gif]
[Graphics:Images/lesson4_gr_5.gif]
[Graphics:Images/lesson4_gr_6.gif]

L'Hospital's Rule

To find   [Graphics:Images/lesson4_gr_7.gif] x [Log [x + 5] - Log [x ]]  one may graph the expression first:

[Graphics:Images/lesson4_gr_8.gif]

[Graphics:Images/lesson4_gr_9.gif]

which suggests the limit at ∞ is 5.

To apply  L'Hospital's  rule notice that the expression can be written as  [Graphics:Images/lesson4_gr_10.gif] = [Graphics:Images/lesson4_gr_11.gif] with  [Graphics:Images/lesson4_gr_12.gif] at ∞ .

[Graphics:Images/lesson4_gr_13.gif]

Consequently  the limit of the original expression is

[Graphics:Images/lesson4_gr_14.gif]
[Graphics:Images/lesson4_gr_15.gif]

Local Extrema

Critical  numbers = {x | f ' [x] = 0 or  f ' [x]  does not exist} constitute a key element for studying maxima or minima (extrema) of  f [x].   

[Graphics:Images/lesson4_gr_16.gif]
[Graphics:Images/lesson4_gr_17.gif]

[Graphics:Images/lesson4_gr_18.gif]

[Graphics:Images/lesson4_gr_19.gif]
[Graphics:Images/lesson4_gr_20.gif]

Pick the real solutions only (use cut & paste )

[Graphics:Images/lesson4_gr_21.gif]
[Graphics:Images/lesson4_gr_22.gif]
[Graphics:Images/lesson4_gr_23.gif]

To verify that f [x] achieves a local  max  at  x = .902652 with  max = 5.1841 and local min at x = 2.56238 with  
min = f [2.56238] = -105.931 one can utilize the second derivative test as follows:

[Graphics:Images/lesson4_gr_24.gif]
[Graphics:Images/lesson4_gr_25.gif]

which shows that f ''  is negative (as required) at x = .902652  and f '' is positive (as required) at x = 2.56238.

Another way to find the min or max of  f [x] is to use the built-in numerical algorithms as follows (provided that
some initial approximation to the critical numbers is established by plotting f [x ] ).

[Graphics:Images/lesson4_gr_26.gif]
[Graphics:Images/lesson4_gr_27.gif]

[Graphics:Images/lesson4_gr_28.gif]

[Graphics:Images/lesson4_gr_29.gif]
[Graphics:Images/lesson4_gr_30.gif]

so taking  [Graphics:Images/lesson4_gr_31.gif]([Graphics:Images/lesson4_gr_32.gif]5.1841) = 5.1841 gives the correct maximum attained at x = 0.902652.

Absolute Extrema on  [a,b]

Continuous function on a closed bounded interval attains its absolute min and absolute max, quite often at the endpoints of the interval  [a,b].  Suspects for absolute min or max are among critical numbers augmented by points a, b.

[Graphics:Images/lesson4_gr_33.gif]
[Graphics:Images/lesson4_gr_34.gif]

[Graphics:Images/lesson4_gr_35.gif]

[Graphics:Images/lesson4_gr_36.gif]
[Graphics:Images/lesson4_gr_37.gif]
[Graphics:Images/lesson4_gr_38.gif]
[Graphics:Images/lesson4_gr_39.gif]
[Graphics:Images/lesson4_gr_40.gif]
[Graphics:Images/lesson4_gr_41.gif]
[Graphics:Images/lesson4_gr_42.gif]
[Graphics:Images/lesson4_gr_43.gif]
[Graphics:Images/lesson4_gr_44.gif]
[Graphics:Images/lesson4_gr_45.gif]

Newton's Method

To solve  f [x] = 0 numerically (which is always the case for any polynomial of degree higher than 5, except
in the special cases) the Newton's algorithm is as follows : identify the starting point [Graphics:Images/lesson4_gr_46.gif] near the solution
and use  [Graphics:Images/lesson4_gr_47.gif] = [Graphics:Images/lesson4_gr_48.gif][Graphics:Images/lesson4_gr_49.gif] .  Then lim[Graphics:Images/lesson4_gr_50.gif] = x  is the root, i.e., f [x]=0.  The initial guess [Graphics:Images/lesson4_gr_51.gif] should be found
  from the graph of  f [x].

To find all roots of  [Graphics:Images/lesson4_gr_52.gif] = 0,  graph first over large interval [-a, a].

[Graphics:Images/lesson4_gr_53.gif]

[Graphics:Images/lesson4_gr_54.gif]

As seen from the graph (zoom if needed) there are 2 real roots, namely around -3 and around 10.  
To find the positive solution take the initial guess as 9:

[Graphics:Images/lesson4_gr_55.gif]
[Graphics:Images/lesson4_gr_56.gif]
[Graphics:Images/lesson4_gr_57.gif]
[Graphics:Images/lesson4_gr_58.gif]
[Graphics:Images/lesson4_gr_59.gif]
[Graphics:Images/lesson4_gr_60.gif]

To streamline computations define a new function g[x] which evaluates numerically the first 25 digits
of approximation sequence:

[Graphics:Images/lesson4_gr_61.gif]

Then

[Graphics:Images/lesson4_gr_62.gif]
[Graphics:Images/lesson4_gr_63.gif]

To compute  n iterations starting at x0 one uses the NestList[g, x0, n] as follows:

[Graphics:Images/lesson4_gr_64.gif]
9
10.76857749469214437367303609341825902336`25
10.216955306206155083503611723443462405`24.1064
10.12058299258635588182831319643859182795`23.2099
10.117806239312983280218683208819809`22.3144
10.11780397413295562844228212398523`21.4188
10.117803974131449032521296575722705`20.5233

Compare the above results to built-in functions such as NRoots[expr[x] = = 0, x], NSolve[ expr[x] = = 0], FindRoot[expr[x] = = 0,{x, [Graphics:Images/lesson4_gr_65.gif]}],
where [Graphics:Images/lesson4_gr_66.gif]is the initial approximation chosen in the vicinity of the exact solution.

[Graphics:Images/lesson4_gr_67.gif]
[Graphics:Images/lesson4_gr_68.gif]
[Graphics:Images/lesson4_gr_69.gif]
[Graphics:Images/lesson4_gr_70.gif]
[Graphics:Images/lesson4_gr_71.gif]
[Graphics:Images/lesson4_gr_72.gif]
[Graphics:Images/lesson4_gr_73.gif]
[Graphics:Images/lesson4_gr_74.gif]
[Graphics:Images/lesson4_gr_75.gif]
[Graphics:Images/lesson4_gr_76.gif]

As one can see the 4-th iteration in  Newton's scheme agrees up to the first 7 digits with the exact solution,
while the 6-th iteration provides the exact first 21 digits!  Numerical analysts, "Go to dust!"


Converted by Mathematica      March 27, 2001