It doesn’t bring you down an interesting rabbit hole or provide a deep reason why but if you take

$$(1 + \sqrt 2)^n + (1 – \sqrt 2)^n$$

and apply the binomial expansion, you’re almost done.

Despite not being interesting, it does give you a way to generalize to an infinite number of $(a + \sqrt b)^n$ with a pretty simple condition relating $a$ and $b$.

]]>For another approach, we can use the fact that x’s continued fraction is [2;2,2,2,2,…]. Applying an elementary error estimate for convergents then tells us that, if p/q is a convergent to x, then 1/4q^2 < |x-p/q| < 1/2q^2. This can be combined with the Wallis-Euler recurrence q_(k+1) = 2*q_k + q_(k-1) with q_0 = 1 and q_1 = 2 for the convergents' denominators to easily determine how many terms we need in the continued fraction to compute x to any desired precision.

]]>