Specific Rule, and Pattern I am taking Calculus AB AP in high school currently, and I keep realizing that I can take certain individual solutions to trigonometric functions, and combine them into one.
I have this homework problem:

$$f(x)=\tan(\pi x)$$

I have to find the vertical asymptotes, and I simply solved for the zeroes of cosine, and got:

$$\cos(\pi x)=0$$
  $$\pi x= \frac{\pi}{2}+2\pi k$$
  $$\pi x= \frac{3 \pi}{2}+ 2 \pi k$$
  $$k\in \mathbb{Z}$$

The two final solutions I got are:

$x=\frac{1}{2}+2k$ and $=\frac{3}{2}+2k$

Then I combined them into one solution, and got:

$$\frac{1}{2}+k$$
  $$k\in \mathbb{Z}$$

Is there a rule, or a systematic system in which the solutions are being combined? Sometimes I can combine them, and sometimes I can't, any help on what exactly I am doing is very helpful.

Good question. As mentioned in the comments, the reason that you're able to simplify into one equation is that in your work, at the very beginning, you broke up the asymptotes to correspond to the "top" zeros ($\pi/2 +2\pi k$) and the "bottom" zeros  ($3\pi/2 +2\pi k$) of Cosine. Because the difference between these two sets of zeros is just $\pi$, the two lists can be interweaved to just give one list as you found. 
