Zero-finding is like when you get ahold of a treasure map. And you need to find where the “X” spot in the map is. You use the trees and rocks as your reference points until… you find it. The treasure is yours.

It’s like tracing back your steps.


Exponentials

Let’s say you have a number, \(5\).
What could the exponent for this number be?

exp(5)
## [1] 148.4132

That’s easy enough.

But let’s say that, to begin with, you only have a totally random value. Let’s say, 148.4132. And the treasure is the number of which the exponent equals to that value. How would you trace back your steps?

Well, you know what the opposite of exponents are: logarithms!

log(148.4132)
## [1] 5


Numerical zero-findings

Let’s say you have a function \(f(x) = x^2 - 4\)

f <- makeFun(x^2 - 4 ~ x)

Let’s play around with this function. What’s would \(f(5)\) equal to?

f(5)
## [1] 21

\(21\). As we would expect:

\(f(5) = 5^2 - 4\)
\(f(5) = 25 - 4\)
\(f(5) = 21\)

Now let’s find an \(x\) value which when passed through the function \(f\) will equal to the number \(5\).
The mathematical expression of this would be:

\(f(x) - 5\)

Zeros(f(x) - 5 ~ x, bounds(x=-5:5))
## # A tibble: 2 × 2
##       x .output.
##   <dbl>    <dbl>
## 1    -3        0
## 2     3        0

Seems like either \(-3\) or \(3\) would cut it. Of course! It’s a quadratic function.

As you can see, where the line meets the red line, are when the value for \(x\) is either \(-3\) or \(3\).

Proof for \(3\):

\(f(3) = 3^2 - 4\)
\(f(3) = 9 - 4\)
\(f(3) = 5\)

Proof for \(-3\):

\(f(-3) = -3^2 - 4\)
\(f(-3) = 9 - 4\)
\(f(-3) = 5\)


Reference:

Kaplan, Daniel. 2022. MOSAIC Calculus. GitHub Pages. https://dtkaplan.github.io/MC2/