Because I've heard good things about it, I've switched to the Julia programming language. This post is written as an IJulia notebook. It's like a REPL session, except with text in between, and you can go back and edit and re-run any expression. You can download this notebook and load it up in IJulia to play with the code. This is the first time I'm using Julia, so I very much welcome any tips & corrections.

In part 1 we used Newton's method to solve equations \(f(x) = 0\). Now we're going to use Newton's method for optimization. Optimization in math doesn't mean making something run faster; it means finding the maximum or minimum of a function:

\[\text{minimize } f(x)\]

As you may know, we can find such a minimum or maximum by solving

\[f'(x) = 0\]

We will use Newton's method to find a solution to that equation.