TITLE: What is the center of a semidirect product?
QUESTION [8 upvotes]: Let $G_1$ and $G_2$ be groups. Let $\varphi:G_2\rightarrow \operatorname{Aut}(G_1) $ be a group homomorphism defining the semidirect product $G_1 \rtimes G_2$. Determine the center $\operatorname{Z}(G_1 \rtimes G_2)$.

REPLY [2 votes]: The general description of the centre of $G_2 \rtimes G_1$ in the last paragraph of @YCor's answer is not correct; there is one condition missing, namely that $g_2 \in \mathrm{Fix}(\varphi)$. (I spotted this while applying the description to the ribbon braid group $\mathbb{Z}^n \rtimes B_n$. The description as written would claim that its centre is $\mathbb{Z}^n \rtimes Z(B_n)$, whereas its centre is actually just $\Delta_{\mathbb{Z}} \times Z(B_n)$ where $\Delta_{\mathbb{Z}}$ denotes the diagonal in $\mathbb{Z}^n$.)
After adding this condition, the description simplifies slightly, so a correct description of the centre $Z(G_2 \rtimes G_1)$ of the semi-direct product $G_2 \rtimes G_1$ with respect to the action $\varphi \colon G_1 \to \mathrm{Aut}(G_2)$ is the set of pairs $(g_2,g_1)$ such that $g_1 \in Z(G_1)$, $g_2 \in \mathrm{Fix}(\varphi)$ and $\varphi(g_1) = \mathrm{Inn}(g_2)^{-1}$, where $\mathrm{Inn} \colon G_2 \to \mathrm{Inn}(G_2)$ sends an element $h$ to the inner automorphism $h - h^{-1}$.