Factor each of the following elements in Z[i] into a product of irreducibles 1 + 3i
Is there a way to find out if they are irreducible or by trial and error?
 A: Yes, you'd look at the prime factorization, which is unique in $\Bbb Z[i]$. If all you care about is irreducibility, there is an easy criterion:

If $z=a+bi$ and $a^2+b^2=p$ is a prime number then the element is irreducible. If $z=a+bi$ and $a^2+b^2=p^2$ and $p\equiv 3\mod 4$ is a prime, then $z$ is irreducible. All other cases are reducible.

In the example you cite, you have an element of norm $1^2+3^2=10$, so it factors as $u(1+i)x$ where $x=2+i$ or $x=2-i$, since these are the only elements of norm $5$ up to units, and $u$ is a unit so that we get exact equality. Since $1+i$ is the only element of norm $2$ (up to units), it is in the factorization for free from the norm computation. Testing, it is easily seen that
$${1+3i\over 2+i}={(1+3i)(2-i)\over 5}={2+3+i(6-1)\over 5}=1+i$$
so that $x=2+i$ and $u=1$.
The standard strategy in the Gaußian integers is to take norms and then trying to divide out the Gaußian primes dividing the rational ones, until you reach the factorization, just like with ordinary integers. This is a modified sieving process, and is basically how you find factorizations.
A: Suppose some $\alpha \in \mathbf{Z}[i]$ divides $1 + 3i$, so for some $\beta \in \mathbf{Z}[i]$
$$\alpha \beta = 1 + 3i.$$
Taking norms gives 
$$N(\alpha\beta) = N(1 + 3i) = 1^2 + 3^2 = 10,$$
and since the norm is multiplicative this gives
$$N(\alpha)N(\beta) = 10.$$
Since we want a non-trivial factorization, $N(\alpha)$, $N(\beta) \neq 1$. Then without loss of generality we say $N(\alpha) = 2$ and $N(\beta) = 5$. There is only one Gaussian integers with norm $2$ (up to multiplication by a unit) though: $1 + i$. If you divide $1 + 3i$ by $1 + i$ you find that 
$$1 + 3i = (1 + i)(2 + i).$$
(Also, this happens to be a prime factorization, because $N(1 + i) = 2$ and $N(2 + i) = 5$ are both prime, which implies $1 + i$ and $2 + i$ are Gaussian primes.)
