## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

# Chapter 4. Nonlinear Equations and Optimization

In this chapter, we will review two basic operations that are fundamental to the development of Numerical Mathematics: the search of zeros and extrema of real-valued functions.

# Motivation

Let's revisit Runge's example from Chapter 2, Interpolation and Approximation, where we computed a Lagrange interpolation of Runge's function using eleven equally spaced nodes in the interval from `-5` to `5`:

```In [1]: import numpy as np, matplotlib.pyplot as plt; \
...: from scipy.interpolate import BarycentricInterpolator
In [2]: def f(t): return 1. / (1. + t**2)
In [3]: nodes = np.linspace(-5, 5, 11); \
...: domain = np.linspace(-5, 5, 128); \
...: interpolant = BarycentricInterpolator(nodes, f(nodes))
In [4]: plt.figure(); ...```

## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

No credit card required