inputs: I am working on the file "5_root_finding_optimization.ipynb".
The first task is:
Comments

Secant method as shown is equivalent to linear interpolation
Can use higher order interpolation for higher order secant methods
Convergence is not quite quadratic
Not gauranteed to converge
Do not preserve brackets
Almost as good as Newton's method if your initial guess is good.

Hybrid Methods
Combine attributes of methods with others to make one great algorithm to rule them all (not really)
Goals

Robustness:  Given a bracket $[a,b]$, maintain bracket
Efficiency:  Use superlinear convergent methods when possible

Options

Methods requiring $f'(x)$
NewtSafe (RootSafe, Numerical Recipes)
Newton's Method within a bracket, Bisection otherwise
Methods not requiring $f'(x)$
Brent's Algorithm (zbrent, Numerical Recipes)
Combination of bisection, secant and inverse quadratic interpolation


scipy.optimize package

Optimization (finding extrema)
I want to find the extrema of a function $f(x)$ on a given interval $[a,b]$.
A few approaches:
 - Bracketing Algorithms:  Golden-Section Search (linear)
 - Interpolation Alogithms: Repeated parabolic interpolation
 - Hybrid Algorithms 
Bracketing Algorithm (Golden Section Search)
Given $f(x) \in C[a,b]$ that is convex over an interval $x \in [a,b]$ reduce the interval size until it brackets the minimum.
Note that we no longer have the $x=0$ help we had before so bracketing and doing bisection is a bit more tricky in this case.  In particular choosing your initial bracket is important!
Golden Section Search - The Idea
Assume $f(x)$ is unimodal (has a single minimum in the bracket) and given a bracket $[a,b]$, pick a point inside of the bracket that is not in the middle say $c$.  Since $f(x)$ is unimodal we know $f(c) < f(a)$ and $f(c) < f(b)$.  Now we attempt to choose a new point, say $d$, which has two possibilities:
1. $f(d) < f(c)$ in which case we know the minimum lies between $c$ and $b$.
2. $f(d) > f(c)$ in which case we know the minimum lies between $a$ and $c$

Golden Section Search - Picking Intervals
We also may want to choose the search points $c$ and...
Can you write Python code for it?

targets: 
def f(t):
    """Simple function for minimization demos"""
    return -3.0 * numpy.exp(-(t - 0.3)**2 / (0.1)**2) \
           +      numpy.exp(-(t - 0.6)**2 / (0.2)**2) \
           +      numpy.exp(-(t - 1.0)**2 / (0.2)**2) \
           +      numpy.sin(t)                        \
           -      2.0

t = numpy.linspace(0, 2, 200)
fig = plt.figure()
axes = fig.add_subplot(1, 1, 1)
axes.plot(t, f(t))
axes.set_xlabel("t (days)")
axes.set_ylabel("People (N)")
axes.set_title("Decrease in Population due to SPAM Poisoning")

plt.show()

phi = (numpy.sqrt(5.0) - 1.0) / 2.0

TOLERANCE = 1e-4
MAX_STEPS = 100

a = 0.3
b = 0.5
c = b - phi * (b - a)
d = a + phi * (b - a)

success = False
for n in xrange(1, MAX_STEPS):
    fc = f(c)
    fd = f(d)
    if fc < fd:
        b = d
        d = c
        c = b - phi * (b - a)
    else:
        a = c
        c = d 
        d = a + phi * (b - a)
    if numpy.abs(c - d) < TOLERANCE:
        success = True
        break
        
if success:
    print "Success!"
    print "  t* = %s" % str((b + a) / 2.0)
    print "  f(t*) = %s" % f((b + a) / 2.0)
    print "  number of steps = %s" % n
else:
    print "Reached maximum number of steps!"