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

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

Student[NumericalAnalysis][Bisection] - numerically approximate the real roots of an expression using the bisection method

 Calling Sequence Bisection(f, x=[a, b], opts) Bisection(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, stoppingcriterion, tickmarks, caption, tolerance, verticallineoptions, view; the options for approximating the roots of f

Description

 • The Bisection command numerically approximates the roots of an algebraic function, f, using a simple binary search algorithm.
 • Given an expression f and an initial approximate a, the Bisection 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. This sequence is guaranteed to converge linearly toward the exact root, provided that f is a continuous function and the pair of initial approximations bracket it.
 • The Bisection command is a shortcut for calling the Roots command with the method=bisection option.

Examples

 > $\mathrm{with}\left(\mathrm{Student}[\mathrm{NumericalAnalysis}]\right):$
 > $f:={x}^{3}-7{x}^{2}+14x-6:$
 > $\mathrm{Bisection}\left(f,x=\left[2.7,3.2\right],\mathrm{tolerance}={10}^{-2}\right)$
 ${2.996875000}$ (1)
 > $\mathrm{Bisection}\left(f,x=\left[2.7,3.2\right],\mathrm{tolerance}={10}^{-2},\mathrm{output}=\mathrm{sequence}\right)$
 $\left[{2.7}{,}{3.2}\right]{,}\left[{2.950000000}{,}{3.2}\right]{,}\left[{2.950000000}{,}{3.075000000}\right]{,}\left[{2.950000000}{,}{3.012500000}\right]{,}\left[{2.981250000}{,}{3.012500000}\right]{,}{2.996875000}$ (2)
 > $\mathrm{Bisection}\left(f,x=\left[2.7,3.2\right],\mathrm{tolerance}={10}^{-2},\mathrm{stoppingcriterion}=\mathrm{absolute}\right)$
 ${3.004687500}$ (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{Bisection}\left(f,x=\left[3.2,4.0\right],\mathrm{output}=\mathrm{animation},\mathrm{tolerance}={10}^{-3},\mathrm{stoppingcriterion}=\mathrm{function_value}\right)$
 > $\mathrm{Bisection}\left(f,x=\left[2.95,3.05\right],\mathrm{output}=\mathrm{plot},\mathrm{tolerance}={10}^{-3},\mathrm{maxiterations}=10,\mathrm{stoppingcriterion}=\mathrm{relative}\right)$