# My Favorite Function

My favorite function is $f\left( x \right)=\sin \left( \ln \left( x \right) \right)$. I like to ask folks how many zeros this function has on the interval $0.

Most folks will get their calculator out and graph the function on the interval Two zeros: one at 1 and the other about 0.05 more or less.

So then I suggest they look at $0. This is the left 10% of the first window. Sure enough there is the zero near 0.05 but there is another near 0

So another window $0 Pretty soon they get the idea. Every time we stretch out the graph, there are more roots.

What is going on? The first thing is that this is not a question to be answered on a graphing calculator, the nice graphs notwithstanding.

So try to solve it by hand. Since $\sin \left( x \right)=0$ for $x=k\pi$ where k is an integer, we need to see when $\ln \left( x \right)=k\pi$. That will be when $\displaystyle x={{e}^{k\pi }}$. And since our domain is proper fractions it must be that $k\le 0$. So the zeros are infinite in number, namely $\displaystyle x={{e}^{0}},{{e}^{-\pi }},{{e}^{-2\pi }},{{e}^{-3\pi }},\cdots$. Which answers the original question, but raises others.

Why can’t we see the zeros on the graph?

This is not a calculator glitch; in fact computers can do no better. Each root is the next largest root divided by $\displaystyle {{e}^{\pi }}\approx 23$. So each root is about $\displaystyle \tfrac{1}{23}$of the larger next root.

The calculator screen is made up of pixels. The number you choose for xmin is the center of the column of pixels; the number you choose for xmax is the center of the right-most column of pixels. The distance between the two ends is divided and assigned evenly to the centers of the other columns of pixels. The y-coordinates of the pixels are calculated the same way. The calculator evaluates the function at each pixel value and turns on the pixel in that column closest to (rarely at) the function’s value. A lot can go on between the pixels and the graphing calculator and its operator will not see what is happening there.

In this example, all the missing roots are between the first and second pixels on the left! When you change xmax to see the left 10% of the screen you see one and every now and then two roots, but the rest are still between the two pixels on the left.

Would a wider screen help? Perhaps a little, but not much.

Here’s a good exercise for a class: Suppose you could print the graph on a paper 1 mile (5280 feet) wide with the root at x = 1 on the right edge. Where would the next several roots be?

• $\displaystyle {{e}^{-\pi }}$ is 228.169 feet from the left edge
• $\displaystyle {{e}^{-2\pi }}$ is 9.860 feet from the left edge
• $\displaystyle {{e}^{-3\pi }}$ is 0.426 feet or 5.113 inches from the left edge
• $\displaystyle {{e}^{-4\pi }}$ is 0.221 inches from the left edge (less than ¼ inch)
• And all the remaining roots are within 0.00955 inches from the left edge.

If the paper stretched from the earth to the sun you could see a few more. At 93,000,000 miles, the zero at $\displaystyle {{e}^{-10\pi }}$ is about 0.134 inches from the edge.

So why do I like this problem?

Look at all the math we did.

• We learned that graphing is not always the path to the answer.
• We learned how calculators choose the points they graph, and which they miss.
• We practiced how to solve a trig equation.
• We practiced how to solve a natural logarithm equation.
• We consider the actual size of the negative powers of e and saw how they got exponentially smaller.
• We did a practical problem in scaling to illustrate how fast the numbers diminish.

Why do I like this function?

What’s not to like?

Update (February 7, 2015) Chip Rollinson made this cool Geogebra applet to illustrate My Favorite Function. Use the slider on the screen and notice the x-axis scale as it changes. Thank you Chip.

## 8 thoughts on “My Favorite Function”

1. Jay says:

I don’t understand the domain. Why proper fractions and k<=0? I plug in e^pi I get same answer of 0

Like

• Lin McMullin says:

Because, from the second sentence, we are looking only in the interval 0 < x < 1. These numbers are proper fractions. To make e^(k pi) in that domain k must be less than 0.

Like

2. Daniel Hallinan Jr. says:

I would argue that a computer does just fine. You can see as many roots as you like if you plot x on a log scale.

Like

3. Chip Rollinson says:

Very interesting problem… I just made this with GeoGebra:
http://tube.geogebra.org/student/m638583

Move the slider at the bottom to change the x-window.

Like

• Lin McMullin says:

Cool! Thanks Chip.

Like

4. mrdardy says:

Lin

Since we are experienced enough (we being the teachers) to know some of these pitfalls, we find these types of examples illuminating. I have a fear that it may simply feel like a parlor trick and may make the kids distrust their calculator even in situations where they should not. I get that the underlying idea is a thorough analysis of the algebra of this function. I just worry that the beauty of it may not come through with some of our students feeling pretty fragile in their knowledge.

Like

• Lin McMullin says:

I see your point, but I also think examples like this can help students understand how their calculators and computers work and thereby help them anticipate where the should “distrust” their calculator.

Like

This site uses Akismet to reduce spam. Learn how your comment data is processed.