Solution to Abstract Algebra by Dummit & Foote 3rd edition Chapter 1.6 Exercise 1.6.24
Let $G$ be a finite group and let $x$ and $y$ be distinct elements of order 2 in $G$ that generate $G$. Prove that $G \cong D_{2n}$, where $n = |xy|$.
Solution: Since $G$ is finite, $n = |xy| < \infty$. By Exercise 1.2.6, $x$ and $xy$ satisfy the relations of the usual presentation for $D_{2n}$; namely, $$D_{2n} = \langle r,s \ |\ r^n = s^2 = 1, rs = sr^{-1} \rangle.$$ Moreover, $G$ is generated by $x$ and $xy$; we know $G$ is generated by $x$ and $y$ and we have $y = (x^{-1}) \cdot (xy)$. From our discussion about $D_{2n}$, then, every element of $G$ can be written uniquely as $x^a(xy)^b$ for some $0 \leq a < 2$ and $0 \leq b < n$. We can thus define a mapping $\varphi : D_{2n} \rightarrow G$ by $\varphi(s^ar^b) = x^a(xy)^b$. This mapping is well defined since every element of $D_{2n}$ has a unique representation as $s^ar^b$ for some $0 \leq a < 2$ and $0 \leq b < n$. Moreover, $\varphi$ is a homomorphism since \begin{align*}\varphi(s^a r^b \cdot s^c r^d) =&\ \varphi(s^{a+c} r^{d-b}) \\=&\ x^{a+c} (xy)^{d-b} x^a (xy)^b \cdot x^c (xy)^d \\=&\ \varphi(s^ar^b) \cdot \varphi(s^c r^d).\end{align*} $\varphi$ is also injective, due to the uniqueness of representations of elements in $D_{2n}$ and $G$ in terms of $r$ and $s$ and $x$ and $xy$, respectively, and is surjective similarly. Thus $G \cong D_{2n}$.