Date: 12 September 2013

x

x

n

n+1

xmin = -1
xmax = 5
ymin = -1
ymax = 5
f(x) = 0.7 * (x - 1) * (x - 2) * (x - 4) + x
fxmin = -1.0E100
fxmax = 1.0E100
g = Function(f, fxmin, fxmax)
xsubscriptdisplayed = If(Length[xsubscript] > 0, "_{" + xsubscript + "}", "")
ysubscriptdisplayed = If(Length[ysubscript] > 0, "_{" + ysubscript + "}", "")
ylabeldisplayed: "" + (LaTeX[ylabel]) + "" + (LaTeX[ysubscriptdisplayed]) + ""
xlabeldisplayed: "" + (LaTeX[xlabel]) + "" + (LaTeX[xsubscriptdisplayed]) + ""
xlabelwithsub: "" + (LaTeX[xlabel]) + "" + (LaTeX[xsubscriptdisplayed]) + ""
x0 = 3.9
n = 3
list1 = IterationList(f, x0, n)
oncurves = Sequence((Element[list1, i], Element[list1, i + 1]), i, 1, n)
diagonals = Sequence((Element[list1, i], Element[list1, i]), i, 2, n)
initialvert = Segment((x0, 0), (x0, f(x0)))
vertsegs = Sequence(Segment[Element[diagonals, i - 1], Element[oncurves, i]], i, 2, n)
horizsegs = Sequence(Segment[Element[oncurves, i], Element[diagonals, i]], i, 1, n - 1)
X_0: (x0, 0)
text1: "" + (LaTeX[xlabel]) + "_0"
theroots: {Roots[f(x) - x, xmin, xmax]}
equilibrium_points = Zip((x(A), x(A)), A, theroots)
show_equilibria = false