Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

 Open In Colab

Roots of some nonlinear functions

Let’s build some intuition by exploring some type of roots in 1D functions using the graphical method: Plot the function and examine where it crosses the x-axis.

NB: Note the structure of the code below - Since we don’t know a priori where the roots will be, we have to take a series of initial guesses and cross our finger.... and even then we may fail to find them all!

Example 1: Real roots - x2−4x^2-4

Example 2: No roots - 1/x1/x

(Noting that the vertical line is a plotting artifact).

Example 3: Infinite roots sin⁡(x2)\sin(x^2)

Only the roots closest to the initial guesses are found!

Complex roots - x2+1x^2+1

Even the graphical method is not completely reliable due to the existence of complex roots.

But this is wrong! The quadratic has 2 roots but we need to use a different method.

Visualizing complex roots

DON’T WORRY - We won’t be dealing with complex numbers in general in this course :-)

Pathological / well-behaved functions

Some functions can be very tricky indeed, such as the Weierstrass Function,

∑n=0∞ancos⁡(bnπx)0<a<1ab>1+3π2\begin{aligned} \sum_{n=0}^\infty a^n \cos (b^n \pi x) \\ 0 < a < 1 \\ a b > 1+\frac{3 \pi}{2} \end{aligned}

which looks like:

This is a classic example of a continuous but nowhere differentiable function! It is a fractal, and yet roots do exist and may be on interest. It is a classic example of a pathological function.

Different applications will have different criteria for pathological vs well behaved functions, and no general definition exists although there is seldom disagreement among non-mathematicians about which is which.

Generally, well-behaved functions don’t have sharp corners, singularities, discontinuities, etc.