Substitution (…and Continued Fractions)

Today in Precalculus I went on a bit of a 7 minute digression, talking about continued fractions. You see, a recursive problem showed up (we’re doing sequences): Write out the first five terms of the following sequence:

a_{n+1}=\sqrt{2+a_n} where a_1=\sqrt{2}

So obviously they go like: a_1=\sqrt{2},a_2=\sqrt{2+\sqrt{2}}, a_3=\sqrt{2+\sqrt{2+\sqrt{2}}}, a_4=\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2}}}}, and a_5=\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2}}}}}

So great. Awesome. NOT. Booooring. So I showed them the decimal expansions:

\approx 1.414, \approx 1.848, \approx 1.961, \approx 1.990, \approx 1.998, \approx 1.999, \approx 1.9998, \approx 1.99996, \approx 1.999991, \approx 1.999997647

WHOA! This is getting closer and closer to 2… Weiiiird…

And then I say I can show them this will continue, and we can find a way to show that \sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+...}}}}} [where the pattern continues forever] will practically become 2.


To do this, I start with something else. I don’t know why, but I really wanted to show them a continued fraction first, to get the point across easier than with the square root. This was the continued fraction.

continued fraction

I went through a frenetic mini-lecture, and I think I had about 40% of the kids along with me for the whole ride. I’m not sure… maybe? But later a kid came by my office, and I thought of a better way to show it. Hence, this blogpost, to show you. (I have seen teachers use this method when teaching substitution when solving systems of equations… but I have never used it myself. I’m dumb! This is awesome!) This is what I did when showing the kid how to think about this in my office.

First I took a small piece of paper and I wrote the infinite fraction on it.


Then I flipped it over and on the back wrote what it equaled… Our unknown x that we were trying to solve for.

image (3)

I emphasized that that card itself represented the value of that fraction. The front and back are both different ways to express the same (unknown) quantity we were looking for.

Then I took a big sheet of paper and wrote 1+\frac{1}{} where I left the denominator blank. And then I put the small card (fraction side up) in the denominator of the fraction…

image (4)

And I said… what does this whole thing equal?

And without too much thinking, the student gave me the answer…

image (6)

Yup. We’ve seen that infinite fraction before. That is x!

Ready? READY?


image (7)

THAT FLIP IS THE COOLEST THING EVER FOR A MATH TEACHER. That flip was the single thing that made me want to blog about this.

Now you have an equation that you can solve for x… and x is what you’re trying to find the value of. This equation can easily be turned into a quadratic, and when you solve it you get x=\frac{1+\sqrt{5}}{2}\approx 1.618 (yes, the Golden Ratio). And it turns out that is close to what we might have predicted…

Because in class, we (by hand) calculated the first few terms of a_{n+1}=1+\frac{1}{a_n} where a_1=1… and we saw: 1, 2, 1.5, 1.66666666, 1.6, 1.625, ...

And when I drew a numberline on the board, plotted 1, then 2, then 1.5, then 1.66666666, then 1.6, then 1.625, we saw that the numbers bounced back and forth… and they seemed to be getting closer and closer to a single number… And yes, that single number is about 1.618.

COOL! [1]


So after I showed them how to calculate the crazy infinite fraction, I went back to the problem at hand… What is \sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+...}}}}}?

Let’s say \sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+...}}}}}=x

Then we can say \sqrt{2+x}=x

And even simply by inspection, we can see that x=2 is a solution to this!


[1] What’s neat is that yesterday I introduced the notion of a recursive sequence that relies on the previous two terms. So soon I can show them the Fibonacci sequence (1,1,2,3,5,8,13,…). What does that have to do with any of this? Well let’s look at the exact values of a_{n+1}=1+\frac{1}{a_n} where a_1=1.

2, \frac{3}{2}, \frac{5}{3}, \frac{8}{5}, \frac{13}{8}, .... WHAAAA?!?!

Lovely. It’s all coming together!!!



  1. Love the flip! And your mention of the number line representation also reminded me of another way to display (which if I had to guess, I first saw when I read “Chaos” back when I was in high school) — on the x-axis, put the value of a_n, and then on the y-axis, put the value of a_n+1. Makes a cool picture! (If I had any idea what to Google, I’d do so and link to a diagram here, but I don’t know what it’s called or even how others would describe it.)

    1. I think it’s called a “phase portrait.” For me, the number line was really beautiful. I think for this a phase portrait would have been okay, but it would have taken waaay longer to get students to understand what we were doing and why (in plotting it in that way) — to get the same effect. But you’re right — it is such a useful tool/visualization for many recursive sequences. I worked with two kids last year on the Logistic Equation and they generated phase portraits of that, as well as the bifurcation diagram!

  2. I did the square root thing by squaring both sides and getting 2 + x = x^2

    You can also solve quadratic equations by continued fractions.

    x^2 + 2x = 8 turns into x = 8/(2+x).

    So x = 8/(2 +8/(2+x)) etc

    This continued fraction gets closer and closer to 2.

  3. Recursives are symphonies! Within the music, I can hear every instrument – you just made beautiful music! I love the card. I also see how I can use that for something else I am teaching my ALG II class! Thank you!

    1. Yay for cards for substitution. I wish I could remember whose blog I saw that on for systems of equations… I did the card because I saw the infinite fraction as a “fractal” and so I thought I could use the card for the self-similarity. But once I did it, I realized that’s exactly what someone else did for systems of equations!

  4. Here’s another interesting coincidence about your choice of the [1,1,1,1,…] continued fraction as an illustration:

    Sqrt(x) has two choices and, conventionally, we prefer the positive branch. However, what if you sometimes took the negative inside your nested square roots? Would the series still converge and, if so, to what values?

    Let’s do one special case where we just alternate the signs: sqrt(2-sqrt(2+sqrt(2-sqrt(2….)))

    You can do your substitution trick again, but have to start 2 levels down. Square once, rearrange terms, then square again to get rid of all the radicals and liberate your starting variable.

    You think, ugh, this is a quartic and I don’t remember how to calculate roots of quartic polynomials. However, notice that the original (all positive) sequence will also satisfy this quartic. A little more thought will also turn up another (discarded) root from your original analysis that also has to be a root of this quartic. That means we have a quadratic polynomial factor of our quartic.

    Doing some quick polynomial long-division, you get x^2 + x -1 as the other factor. For those fibonacci/golden ratio fans, this quadratic will already look familiar. You can quickly see that the positive root here is the inverse of the golden ratio and is, indeed the value to which our nested alternating positive/negative roots converges.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s