Can you find the closed form for the following integral
$$ \int_0^\infty \prod_{i=1}^n \frac{1}{a_i^2 + x^2} \, dx = \int_0^\infty \! \frac{dx}{(a_1^2 + x^2) (a_2^2 + x^2) \cdots (a_n^2 + x^2)} $$
where $a_i \in \mathbb{R}$ for any $i\in\mathbb{Z}_{\gt0}$?
For example,
$$ \begin{align} &\int_0^\infty \! \frac{dx}{a^2 + x^2} = \frac\pi2 \frac1a \\[3pt] &\int_0^\infty \! \frac{dx}{(a^2 + x^2)(b^2 + x^2)} = \frac\pi2 \frac1{ab \, (a+b)} \\[3pt] &\int_0^\infty \! \frac{dx}{(a^2 + x^2)(b^2 + x^2)(c^2 + x^2)} = \frac\pi2 \frac{a+b+c}{abc \, (a+b)(b+c)(c+a)} \\[3pt] \end{align} $$
Partial fractions was suggested. If the $a_i$ are all different, then there exist numerators $b_i$ with $$ \prod_{i=1}^n\frac{1}{a_i^2 + x^2}= \sum_{i=1}^n\frac{b_i}{a_i^2+x^2} $$ so that $$ \int_0^\infty \! \prod_{i=1}^n\frac{1}{a_i^2 + x^2} \, dx = \left[\sum_{i=1}^n \frac{b_i}{a_i}\arctan\frac{x}{a_i} \;\right]_{x=0}^\infty = \sum_{i=1}^n \frac{\pi b_i}{2 a_i} $$
What are the numerators $b_i$? That is a linear algebra problem. $$ b_i = \prod_{j \ne i} \frac{1}{a_j^2-a_i^2} $$