There are various methods of computing fundamental groups, for example one method using maximal trees of a simplicial complex (considered a slow method). There is one “trick” using van Kampen’s Theorem that makes it relatively fast to compute the fundamental group.
This “trick” doesn’t seem to be explicitly written in books, I had to search online to learn about it.
Fundamental Group of Torus
First we let and be open subsets of the torus (denoted as )as shown in the diagram below. is an open disk, while is the entire space with a small punctured hole. We are using the fundamental polygon representation of the torus. This trick can work for many spaces, not just the torus.
is contractible, thus . has as a deformation retract, thus . We note that and is path-connected. These are the necessary conditions to apply van Kampen’s Theorem.
Then, by Seifert-van Kampen Theorem, , the free product of and with amalgamation.
Let be the generator in . We have and . ( and are the inclusions. )