ExercisesExercise 4 - FilterExercise 5 - Newton's methodDocumentation and user's manualTable of contentsOCaml programs

Exercise 5 - Newton's method

Let a and b two real numbers such that a < b. Let I = [a, b]. Let f : R-> R a differentiable function defined and strictly monotonic on the interval I, and such that f(a) f(b) < 0 .

It can easily be shown that f has a unique zero in I (let it be denoted by z).

Let h : R-> R defined by h(x) = x - f(x) / f'(x).

Let (un)n in N the sequence defined by u0 = b if both f and f' are increasing, or both decreasing, u0 = a else, and by un+1 = h(un) for any natural number n.

It can be shown that if f' is differentiable on I, f" continuous on I and f" with no zero in I, then the sequence (un)n in N converges to z. Then an approximate value for z can be computed by the Newton's method, which consists of computing the successive elements in the sequence (un)n in N until a value considered closed enough to z is reached.

 1 
  Using the higher-order function  deriv , write a higher-order function (named  newton ) which, given a function f from real numbers to real numbers and two real numbers a and b, computes by the Newton's method an approximation of the unique zero f has on the closed interval defined by a and b (f will be assumed to satisfy the conditions stated above).

 2 
  Compute an approximation of the square root of 2 by the Newton's method.


Latest update : October 5, 2006
This document was translated from LaTeX by Hyperlatex 2.5, which is not the latest version of Hyperlatex.

ExercisesExercise 4 - FilterExercise 5 - Newton's methodDocumentation and user's manualTable of contentsOCaml programs