Representation of $S^1\times S^2$ as the union of two solid tori Let $f,g:S^1\times S^1\to S^1\times S^1$ be the maps defined by $f(z,w)=(z,w)$ and $g(z,w)=(w,z)$. Then, $S^3=D^2\times S^1 \cup_f S^1\times D^2 $. For this, I have seen many explanations and the easiest for me is to think of $S^3$ as the boundary of $D^4$, so $$S^3=\partial(D^4)=\partial(D^2\times D^2)=D^2\times S^1 \cup_f  S^1\times D^2.$$
Is there any way to explain why $D^2\times S^1 \cup_g  S^1\times D^2=S^2\times S^1$?
 A: Let us first consider $S^3$. As you say, we have
$$S^3 = \partial D^4 \approx \partial (D^2 \times D^2) =  D^2 \times S^1 \cup S^1 \times D^2 .$$
This is an ordinary union of two genuine subsets of $\partial (D^2 \times D^2)$. Their intersection is $S^1 \times S^1$. But now we can identify $\partial (D^2 \times D^2)$ with the quotient space $D^2 \times S^1 \cup_f S^1 \times D^2$ obtained from the disjoint union $D^2 \times S^1 + S^1 \times D^2$ by identifying the points of $S^1 \times S^1$ in both summands via the identity map $f$. The same result is obtained if we form $D^2 \times S^1 \cup_g D^2 \times S^1$ or $S^1 \times D^2 \cup_g S^1 \times D^2$. Here we start with the disjoint union of two copies of the same variant of the solid torus, but need a coordinate switch for gluing. In $D^2 \times S^1 \cup_f S^1 \times D^2$ we start with homeomorphic, but formally different, variants of the solid torus and we do not need a coordinate switch for gluing. In fact, a coordinate switch for gluing is unnecessary because we have done it before by starting with "switched" variants of the solid torus. This also explains Moishe Kohan's last comment.
Now let us come to $S^2 \times S^1$. We can identify $S^2$ with $D^2 \cup_i D^2$, where $i : S^1 \to S^1$ is the identity map. Doing so, we get an identifications of $S^2 \times S^1$ with $D^2 \times S^1 \cup_f D^2 \times S^1$. If we change the perspective as above, we get
$$S^2 \times S^1 \approx D^2 \times S^1 \cup_g S^1 \times D^2 .$$
The coordinate switch for gluing is necessary to compensate starting with switched variants of the solid torus.
