numerically approximate the real roots of an expression using the secant method - Maple Help

Home : Support : Online Help : Education : Student Package : Numerical Analysis : Visualization : Student/NumericalAnalysis/Secant

Student[NumericalAnalysis][Secant] - numerically approximate the real roots of an expression using the secant method

 Calling Sequence Secant(f, x=[a, b], opts) Secant(f, [a, b], opts)

Parameters

 f - algebraic; expression in the variable x representing a continuous function x - name; the independent variable of f a - numeric; one of two initial approximates to the root b - numeric; the other of the two initial approximates to the root opts - (optional) equation(s) of the form keyword=value, where keyword is one of functionoptions, lineoptions, maxiterations, output, pointoptions, showfunction, showlines, showpoints, showverticallines, stoppingcriterion, tickmarks, caption, tolerance, verticallineoptions, view; the options for approximating the roots of f

Description

 • The Secant command numerically approximates the roots of an algebraic function, f, using a technique similar to Newton's method but without the need to evaluate the derivative of f.
 • Given an expression f and an initial approximate a, the Secant command computes a sequence ${p}_{k}$, $k$=$0..n$, of approximations to a root of f, where $n$ is the number of iterations taken to reach a stopping criterion.
 • The Secant command is a shortcut for calling the Roots command with the method=secant option.

Notes

 • The secant method has the limitation that it may diverge when the initial approximates a and b are not sufficiently close to the root.

Examples

 > $\mathrm{with}\left(\mathrm{Student}[\mathrm{NumericalAnalysis}]\right):$
 > $f:={x}^{3}-7{x}^{2}+14x-6:$
 > $\mathrm{Secant}\left(f,x=\left[2.7,3.2\right],\mathrm{tolerance}={10}^{-2}\right)$
 ${3.005775850}$ (1)
 > $\mathrm{Secant}\left(f,x=\left[2.7,3.2\right],\mathrm{tolerance}={10}^{-2},\mathrm{output}=\mathrm{sequence}\right)$
 ${2.7}{,}{3.2}{,}{3.100884956}{,}{2.858406793}{,}{3.026267866}{,}{3.005775850}$ (2)
 > $\mathrm{Secant}\left(f,x=\left[2.7,3.2\right],\mathrm{tolerance}={10}^{-2},\mathrm{stoppingcriterion}=\mathrm{absolute}\right)$
 ${2.999670283}$ (3)

To play the following animation in this help page, right-click (Control-click, on Macintosh) the plot to display the context menu.  Select Animation > Play.

 > $\mathrm{Secant}\left(f,x=\left[3.2,4.0\right],\mathrm{output}=\mathrm{animation},\mathrm{stoppingcriterion}=\mathrm{function_value}\right)$
 > $\mathrm{Secant}\left(f,x=\left[2.9,3.1\right],\mathrm{tolerance}={10}^{-3},\mathrm{output}=\mathrm{plot}\right)$