TITLE: Periods of the continued fraction expansions of Galois-conjugate quadratic-irrationals
QUESTION [5 upvotes]: Question: Given a quadratic irrational $x = a + b\sqrt{D}$ ($a,b \in \Bbb{Q}$, $D \in \Bbb{N}_{> 0}$ square-free) and its Galois conjugate $x' = a - b\sqrt{D}$, is it true that the continued fraction expansions of $x$ and $x'$ have the same period?
Computations of a few random example seems to suggest that is indeed the case, and I think I even saw a statement to this effect somewhere, but can't remember where.
Motivation: The continued fraction expansions of two numbers $x,x' \in \Bbb{R}$ conjugate via an element of $\text{PGL}_2(\Bbb{Z})$ are 'almost the same', i.e. $a_{k+n} = a'_{k+m}$ for some $n,m$ and all $k \geq 0$, and I suspect that in the case of two conjugate quadratic-irrationals there always exists a 'generalized reflection' $s_H = wsw^{-1}$, $w \in \text{PGL}_2(\Bbb{Z})$, $s \in \left\{\begin{bmatrix} & 1 \\ 1& \end{bmatrix}, \begin{bmatrix} -1 & 1 \\ & 1\end{bmatrix}, \begin{bmatrix} -1 & \\ & 1\end{bmatrix}\right\}$ such that $s_H(x) = x'$.

REPLY [6 votes]: The periodic part of the continued fraction for the Galois conjugate is always the mirror image of the periodic part for the original quadratic irrational. Here we are viewing the periodic part as a cycle arranged in a circle, and the mirror image is with respect to reflecting across a suitable diameter of this circle.  
The periodic part of every irrational number $\sqrt{p/q}$ (with $p$ and $q$ integers) is always palindromic in the sense that its cyclic arrangement has mirror symmetry.  This follows from the classical fact that the numbers $\sqrt{p/q}$ with $p/q>1$ are exactly the numbers whose continued fraction has the form $[a_0;\overline{a_1,\cdots,a_n}]$ with the terms $a_1,\cdots,a_{n-1}$ forming a palindrome and $a_n=2a_0$.  Inserting the last term $a_n$ into the palindromic cycle formed by $a_1,\cdots,a_{n-1}$ then produces a cycle with mirror symmetry across the diameter through $a_n$.
All this becomes visually clear using Conway's notion of topographs for binary quadratic forms over the integers.  One place to read about this viewpoint is in Chapter 4 of my unfinished book "Topology of Numbers", available on my webpage.