Prove that $d(x,y) = \sum_{i\in\mathbb{N}} a_i\frac{d_i(x_i,y_i)}{1+d_i(x_i,y_i)}$ satisfies the triangle inequality Let $(X_i
, d_i), i ∈ \Bbb N$, be a collection of metric spaces.  
Define the metric \begin{align}d(x,y) = \sum_{i\in\mathbb{N}} a_i\frac{d_i(x_i,y_i)}{1+d_i(x_i,y_i)} \end{align} on the infinite product $\prod_{i \in \Bbb N} X_i.$ 
Note that $(a_i)_{i\in\mathbb{N}}$ is positive and satisfies $\sum_{i\in\mathbb{N}} a_i < +\infty$. For example $a_i = 2^{-i}$.
I am wondering how should I go about to prove that this metric satisfy the triangle inequality? 

It suffices to show that $$\frac{d_i(x_i,z_i)}{1 + d_i(x_i,z_i)} \le \frac{d_i(x_i,y_i)}{1 + d_i(x_i,y_i)} + \frac{d_i(y_i,z_i)}{1 + d_i(y_i,z_i)}$$ for each $i$. Use the fact that $f(x) = \dfrac{x}{1+x}$ is increasing for $x \ge 0$ (use the first derivative test, say). Since each $d_i$ is a metric you have $$d_i(x_i,z_i) \le d_i(x_i,y_i) + d_i(y_i,z_i)$$ and thus
$$\frac{d_i(x_i,z_i)}{1 + d_i(x_i,z_i)}  \le \frac{d_i(x_i,y_i) + d_i(y_i,z_i)}{1 + d_i(x_i,y_i) + d_i(y_i,z_i)} = \frac{d_i(x_i,y_i)}{1 + d_i(x_i,y_i) + d_i(y_i,z_i)} + \frac{d_i(y_i,z_i)}{1 + d_i(x_i,y_i) + d_i(y_i,z_i)}$$
which is trivially less than or equal to
$$\frac{d_i(x_i,y_i)}{1 + d_i(x_i,y_i)} + \frac{d_i(y_i,z_i)}{1 + d_i(y_i,z_i)}.$$
