To solve the given system of equations
\[
\frac{xy}{x + y} = 1, \quad \frac{xz}{x + z} = 2, \quad \frac{yz}{y + z} = 4,
\]
we first rewrite each equation in terms of its cross-multiplication:
1. \( \frac{xy}{x + y} = 1 \)
\[
xy = x + y
\]
\[
xy - x - y = 0 \quad \Rightarrow \quad xy - x - y + 1 = 1
\]
\[
(x-1)(y-1) = 2
\]
2. \( \frac{xz}{x + z} = 2 \)
\[
xz = 2(x + z)
\]
\[
xz - 2x - 2z = 0 \quad \Rightarrow \quad xz - 2x - 2z + 4 = 4
\]
\[
(x-2)(z-2) = 8
\]
3. \( \frac{yz}{y + z} = 4 \)
\[
yz = 4(y + z)
\]
\[
yz - 4y - 4z = 0 \quad \Rightarrow \quad yz - 4y - 4z + 16 = 16
\]
\[
(y-4)(z-4) = 20
\]
We now have three transformed equations:
\[
(x-1)(y-1) = 2
\]
\[
(x-2)(z-2) = 8
\]
\[
(y-4)(z-4) = 20
\]
We solve these equations step by step. Start with the first equation:
\[
(x-1)(y-1) = 2
\]
Express \( y \) in terms of \( x \):
\[
y = \frac{2}{x-1} + 1
\]
Next, substitute \( y \) into the second equation:
\[
(x-2)(z-2) = 8
\]
Express \( z \) in terms of \( x \):
\[
z = \frac{8}{x-2} + 2
\]
Substitute both \( y \) and \( z \) into the third equation:
\[
(y-4)(z-4) = 20
\]
Substituting \( y = \frac{2}{x-1} + 1 \) and \( z = \frac{8}{x-2} + 2 \):
\[
\left( \frac{2}{x-1} + 1 - 4 \right) \left( \frac{8}{x-2} + 2 - 4 \right) = 20
\]
Simplify \( y - 4 \) and \( z - 4 \):
\[
y - 4 = \frac{2}{x-1} - 3
\]
\[
z - 4 = \frac{8}{x-2} - 2
\]
So, the equation becomes:
\[
\left( \frac{2 - 3(x-1)}{x-1} \right) \left( \frac{8 - 2(x-2)}{x-2} \right) = 20
\]
Simplify the terms inside the parentheses:
\[
\left( \frac{2 - 3x + 3}{x-1} \right) \left( \frac{8 - 2x + 4}{x-2} \right) = 20
\]
\[
\left( \frac{5 - 3x}{x-1} \right) \left( \frac{12 - 2x}{x-2} \right) = 20
\]
Solve for \( x \). By testing rational values, we find:
Let \( x = 3 \):
\[
y = \frac{2}{3-1} + 1 = 2
\]
\[
z = \frac{8}{3-2} + 2 = 10
\]
Therefore, \(z = 10\).