Solution (source code)

= Solution

One form of the <Seifert-van Kampen theorem> says that if $X=U\cup V$, with $U,V,U\cap V$ open and path-connected and containing the base point, then $\pi_1(X)$ is the pushout of
$$
\pi_1(U)\longleftarrow\pi_1(U\cap V)
\longrightarrow\pi_1(V).
$$

For the <fundamental group after attaching a 2-cell>, take $U$ to be $X$ together with a collar of the attached disc and $V$ to be a slightly enlarged open disc. Then $U\simeq X$, $V$ is simply connected, and $U\cap V\simeq S^1$; its generator maps to $[\alpha]$ in $\pi_1(X)$. Van Kampen therefore gives
$$
\pi_1(X\cup_\alpha D^2,x_0)
\cong\pi_1(X,x_0)/\langle\!\langle[\alpha]\rangle\!\rangle.
$$

Take $X=S^1_a\vee S^1_b$, whose fundamental group is the free group $F(a,b)$, and attach one 2-cell along the loop represented by $a^2b^{-3}$. The resulting connected <presentation complex> $Y$ satisfies
$$
\boxed{\pi_1(Y,y_0)\cong
F(a,b)/\langle\!\langle a^2b^{-3}\rangle\!\rangle
=\langle a,b\mid a^2b^{-3}\rangle.}
$$