Abelian subgroup equals centralizer of derived subgroup in generalized dihedral group unless it is a 2-group of exponent at most four

Statement
Suppose $$H$$ is an abelian group and $$G$$ is the corresponding fact about::generalized dihedral group for $$H$$. Thus, $$G$$ contains $$H$$ as an abelian normal subgroup of index two. Then, unless $$H$$ is a $$2$$-group of exponent at most four, $$H$$ is the fact about::centralizer of commutator subgroup in $$G$$, i.e., $$H = C_G([G,G])$$.

Facts used

 * 1) uses::Abelian subgroup is contained in centralizer of commutator subgroup in generalized dihedral group

Proof
Given: Generalized dihedral group $$G$$ for abelian group $$H$$.

To prove: Either $$H$$ is a $$2$$-group of exponent at most four, or $$H = C_G([G,G])$$.

By fact (1), we know that $$H \le C_G([G,G])$$. Since $$H$$ is a maximal subgroup of $$G$$, either $$H = C_G([G,G])$$ or $$G = C_G([G,G])$$.

In the latter case, $$[G,G]$$ is in the center of $$G$$. In particular, $$[H,x]$$ is in the center of $$G$$. $$[H,x]$$ is the set of squares in $$H$$. For this to be in the center, we need $$[[H,x],x]$$ to be trivial. But $$[[H,x],x]$$ is the set of squares of elements in $$[H,x]$$, which is the set of fourth powers of elements in $$H$$. Thus, the exponent of $$H$$ divides $$4$$, so $$H$$ is a $$2$$-group of exponent at most four.