How to find the number of continued fraction from a periodic representation?

Problem
Find the number that represented by $[2,2,2 \ldots]$

I know it wasn't difficult, but I was absent the last two classes. So I just want to make sure that I got it right.

My attempt was,
Consider $x = [2;\overline{2}] \implies [2;x]$ Hence, $x = 2 + \dfrac{1}{x} \Leftrightarrow x = \dfrac{2x + 1}{x} \Leftrightarrow x^2 - 2x - 1 = 0$. Solving the quadratic equation we have $x = \sqrt{2} + 1$ since $x > 0$. Therefore $[2,2,2, \ldots] = \sqrt{2} + 1$

Is it correct?

Thank you,

-
That looks right to me. – yunone May 2 '11 at 3:45
Yes that looks right, and is in fact a different proof that $\sqrt{2}$ is irrational. – Aryabhata May 2 '11 at 3:51
Yes - now try something a little harder, like $[2,3,4,3,4,3,4,3,4,\dots]$, with the $3,4$ repeating. – Gerry Myerson May 2 '11 at 4:12
@all: Thanks a lot. – Chan May 2 '11 at 4:24
If you put a number into Wolfram Alpha it'll give you back its continued fraction representation. This isn't the direction you're trying to go, but it'll help you check your work. – Michael Lugo May 2 '11 at 16:05

Yes, your solution is entirely correct. You might like to try to modify your technique to evaluate something that is only eventually periodic, like $[2,\overline{3,4}]$.