Proof of the monotone column permanent conjecture

Abstract: Let A be an n-by-n matrix of real numbers which are weakly decreasing down each column, Z_n = diag(z_1,..., z_n) a diagonal matrix of indeterminates, and J_n the n-by-n matrix of all ones. We prove that per(J_nZ_n+A) is stable in the z_i, resolving a recent conjecture of Haglund and Visontai. This immediately implies that per(zJ_n+A) is a polynomial in z with only real roots, an open conjecture of Haglund, Ono, and Wagner from 1999. Other applications include a multivariate stable Eulerian polynomial, a new proof of Grace's apolarity theorem and new permanental inequalities.

\section{The monotone column permanent conjecture.}

Recall that the \emph{permanent} of an $n$-by-$n$ matrix $H=(h_{ij})$
is the unsigned variant of its determinant:
$$
\mathrm{per}(H) = \sum_{\sigma\in\S_n} \prod_{i=1}^n h_{i,\sigma(i)},
$$
with the sum over all permutations $\sigma$ in the symmetric group $\S_n$.
A \emph{monotone column matrix} $A=(a_{ij})$ has real entries which are
weakly decreasing reading down each column:\ that is, $a_{ij}\geq a_{i+1,j}$
for all $1\leq i\leq n-1$ and $1\leq j\leq n$.  Let $J_n$ be the $n$-by-$n$
matrix in which every entry is $1$.\\

\noindent\textbf{The Monotone Column Permanent Conjecture (MCPC).}\\
If $A$ is an $n$-by-$n$ monotone column matrix then $\mathrm{per}(zJ_n+A)$
is a polynomial in $z$ which has only real roots.\\

The MCPC first appears as Conjecture 2 of \cite{HOW}.
(Originally with increasing columns -- but the convention of decreasing
columns is clearly equivalent and will be more natural later.)
Theorem 1 of \cite{HOW} proves the MCPC for monotone column matrices
in which every entry is either $0$ or $1$.  Other special cases appear in
\cite{H,HOW,HV,KYZ}, either for $n\leq 4$ or for rather restrictive conditions
on the entries of $A$.  In this paper we prove the MCPC in full
generality\footnote{Thus, it was not really a permanent conjecture.}.
In fact we prove more.  The following multivariate version of the MCPC
originates in \cite{HV}.  Let $Z_n=\mathrm{diag}(z_1,\ldots,z_n)$ be an $n$-by-$n$
diagonal matrix of algebraically independent commuting indeterminates
$\mathbf{z}=\{z_1,\ldots,z_n\}$.  A polynomial $f(z_1,\ldots,z_n)\in\CC[\mathbf{z}]$ is
\emph{stable} provided that either $f\equiv 0$ or whenever $w_j\in\CC$ are
such that $\Im(w_j)>0$ for all $1\leq j\leq n$, then $f(w_1,\ldots,w_n)\neq 0$.
A stable polynomial with real coefficients is \emph{real stable}.
\\

\noindent\textbf{The Multivariate MCP Conjecture (MMCPC).}\\
If $A$ is an $n$-by-$n$ monotone column matrix then $\mathrm{per}(J_nZ_n+A)$
is a real stable polynomial in $\RR[\mathbf{z}]$.\\

Note that $J_nZ_n+A=(z_j+a_{ij})$, so that $z_j$ is associated with the $j$-th
column, for each $1\leq j\leq n$.  We also write
$\mathrm{per}(J_nZ_n+A)=\mathrm{per}(z_j+a_{ij})$ as it seems clearer.  The MMCPC implies the
MCPC since if one sets all $z_j=z$, then $\mathrm{per}(z+a_{ij})$ is a polynomial
in one variable with real coefficients; this diagonalization preserves stability
(see Lemma \ref{basic}(c) below), and a univariate real polynomial is stable if and
only if it has only real roots.

In Section 2 we review some results from the theory of stable polynomials which
are required for our proofs.
In Section 3 we reduce the MMCPC to the case of $\{0,1\}$-matrices which are
weakly decreasing down columns and weakly increasing from left to right across
rows -- these we call \emph{Ferrers matrices} for convenience.
Then we further transform the MMCPC for Ferrers matrices,
derive a differential recurrence relation for the resulting polynomials, and
use this and the results of Section 2 to prove the conjecture by induction.
In Section 4 we extend these results to sub-permanents of rectangular matrices,
derive a cycle-counting extension of one of them, discuss a multivariate stable
generalization of Eulerian polynomials,  present a new proof of Grace's
apolarity theorem and derive new permanental inequalities.

\section{Stable polynomials.}

Over a series of several papers, Borcea and Br\"and\'en have developed
the theory of stable polynomials into a powerful and flexible technique.
The results we need are taken from \cite{BB4,BB5,Br}; see also Sections 2
and 3 of \cite{W}.

Let $\EuScript{H}=\{w\in\CC:\ \Im(w)>0\}$ denote the open upper
half of the complex plane, and let $\overline{\EuScript{H}}$ denote its closure in $\CC$.
As above, $\mathbf{z}=\{z_1,\ldots,z_n\}$ is a set of $n$ indeterminates.
For $f\in\CC[\mathbf{z}]$ and $1\leq j\leq n$, let $\deg_{z_j}(f)$ denote the degree of $z_j$
in $f$.
\begin{LMA}[see Lemma 2.4 of \cite{W}] \label{basic}
These operations preserve stability of polynomials in $\CC[\mathbf{z}]$.\\
\textup{(a)}\ \textup{Permutation:}\ for any permutation $\sigma\in\S_n$,
$f \mapsto f(z_{\sigma(1)},\ldots,z_{\sigma(n)})$.\\
\textup{(b)}\ \textup{Scaling:}\ for $c\in\CC$ and $\a\in\RR^{n}$ with
$\a>\boldsymbol{0}$, $f \mapsto cf(a_{1}z_{1},\ldots,a_{n}z_{n})$.\\
\textup{(c)}\ \textup{Diagonalization:}\ for $1\leq i<j\leq n$,
$f \mapsto f(\mathbf{z})|_{z_i=z_j}$.\\
\textup{(d)}\ \textup{Specialization:}\ for $a\in\overline{\EuScript{H}}$,
$f \mapsto f(a, z_{2},\ldots,z_{n})$.\\
\textup{(e)}\ \textup{Inversion:}\ if $\deg_{z_1}(f)=d$,
$f \mapsto z_{1}^{d}f(-z_{1}^{-1},z_{2},\ldots,z_{n})$.\\
\textup{(f)}\ \textup{Translation:}\
$f \mapsto f_1 = f(z_1+t,z_2,\ldots,z_n)\in\CC[\mathbf{z},t]$.\\
\textup{(g)}\ \textup{Differentiation:}\
$f \mapsto \partial f(\mathbf{z})/\partial z_1$.
\end{LMA}
\begin{proof}
Only part (f) is not made explicit in \cite{BB4,BB5,W}.  But clearly if
$z_1\in\EuScript{H}$ and $t\in\EuScript{H}$ then $z_1+t\in\EuScript{H}$, from which the result follows.
\end{proof}
Of course, parts (d,e,f,g) apply to any index $j$ as well, by permutation.
Part (g) is the only difficult one -- it is essentially the Gauss-Lucas Theorem.

\begin{LMA} \label{coeffs}
Let $f(\mathbf{z},t)\in\CC[\mathbf{z},t]$ be stable, and let
$$
f(\mathbf{z},t) = \sum_{k=0}^d f_k(\mathbf{z}) t^k
$$
with $f_d(\mathbf{z})\not\equiv 0$.  Then $f_k(\mathbf{z})$ is stable for all $0\leq k\leq d =
\deg_t(f)$.
\end{LMA}
\begin{proof}
Consider any $0\leq k\leq d$.  Clearly $f_k(\mathbf{z})$ is a constant multiple of $\partial^k f(\mathbf{z},t)/\partial t^k |_{t=0}$, which is stable by Lemma \ref{basic} (c, g).
\end{proof}

Polynomials $g, h \in \RR[\mathbf{z}]$ are in \emph{proper position}, denoted
by $g \ll h$, if the polynomial $h + \i g$ is stable.  This is the
multivariate analogue of interlacing roots for univariate polynomials with only
real roots.

\begin{PROP}[Lemma 2.8 of \cite{BB5} and Theorem 1.6 of \cite{BB4}] \label{HB-O}
Let $g,h\in\RR[\mathbf{z}]$.\\
\textup{(a)}\ Then $h\ll g$ if and only if $g+th\in\RR[\mathbf{z},t]$ is stable.\\
\textup{(a)}\ Then $ag+bh$ is stable for all $a,b\in\RR$ if and only if
either $h\ll g$ or $g\ll h$.
\end{PROP}
It then follows from Lemma \ref{basic}(d,g) that if $h \ll g$ then both $h$ and $g$
are stable (or identically zero).

\begin{PROP}[Lemma 2.6 of \cite{BB4}] \label{proper}
Suppose that $g\in \RR[\mathbf{z}]$ is stable. Then the sets
$$
\{h \in \RR[\mathbf{z}] : g\ll h \} \quad \mbox{ and }
\quad \{h \in \RR[\mathbf{z}] : h \ll g\}
$$
are convex cones containing $g$.
\end{PROP}

\begin{PROP}\label{cone}
Let $V$ be a real vector space, $\phi : V^{n}\rightarrow \RR$
a multilinear form, and $e_1,\ldots,  e_n, v_2, \ldots, v_n$ fixed vectors
in $V$. Suppose that the polynomial
$$
\phi(e_1,  v_2 +z_2e_2, \ldots,  v_n + z_ne_n)
$$
in $\RR[\mathbf{z}]$ is not identically zero. Then the set of all $v_1 \in  V$
for which the polynomial
$$
\phi(v_1+z_1e_1,  v_2 +z_2e_2, \ldots,  v_n + z_ne_n)
$$
is stable is either empty or a convex cone (with apex $0$) containing
$e_1$ and $-e_1$.
\end{PROP}
\begin{proof}
Let $C$ be the set of all $v_1 \in V$ for which the polynomial
$\phi(v_1+z_1e_1,  v_2 +z_2e_2, \ldots,  v_n + z_ne_n)$
is stable. For $v\in V$ let $F_v =   \phi(v,  v_2 +z_2e_2, \ldots,  v_n + z_ne_n)$.
Since
$$
\phi(v_1+z_1e_1,  v_2 +z_2e_2, \ldots,  v_n + z_ne_n)= F_{v_1} + z_1F_{e_1},
$$
we have $C = \{v \in V : F_{e_1} \ll F_{v}\}$. Moreover since $F_{\lambda v+ \mu w}
= \lambda F_v + \mu F_w$ it follows from Proposition \ref{proper} that $C$ is a
convex cone provided that $C$ is non-empty. If $C$ is nonempty then
$F_v + z_1F_{e_1}$ is stable for some $v \in V$. But then $F_{e_1}$ is stable,
and so is
$$
(\pm 1 + z_1)F_{e_1} = \phi(\pm e_1+z_1e_1,  v_2 +z_2e_2, \ldots,  v_n + z_ne_n)
$$
which proves that $\pm e_1 \in C$.
\end{proof}
(Of course, by permuting the indices Proposition \ref{cone} applies to
any index $j$ as well.)

Let $\CC[\mathbf{z}]^\mathsf{ma}$ denote the vector subspace of \emph{multiaffine} polynomials:\
that is, polynomials of degree at most one in each indeterminate.

\begin{PROP}[Theorem 5.6 of \cite{Br}] \label{Delta}
Let $f\in\RR[\mathbf{z}]^\mathsf{ma}$ be multiaffine.  The following are equivalent:\\
\textup{(a)}\ $f$ is real stable.\\
\textup{(b)}\ For all $1\leq i<j\leq n$ and all $\a\in\RR^n$,
$f_i(\a)f_j(\a)-f(\a)f_{ij}(\a)\geq 0$, in which the subscripts denote
partial differentiation.
\end{PROP}

A linear transformation $T:\CC[\mathbf{z}]\rightarrow\CC[\mathbf{z}]$ \emph{preserves stability}
if $T(f)(\mathbf{z})$ is stable whenever $f(\mathbf{z})$ is stable.

\begin{PROP}[Theorem 1.1 of \cite{BB5}] \label{BB}
Let $T:\CC[\mathbf{z}]^{\mathsf{ma}}\rightarrow\CC[\mathbf{z}]$ be a linear transformation.
Then $T$ preserves stability if and only if either\\
\textup{(a)}\ $T(f) = \eta(f)\cdot p$ for some linear functional
$\eta:\CC[\mathbf{z}]^{\mathsf{ma}}\rightarrow\CC$ and stable $p\in\CC[\mathbf{z}]$, or\\
\textup{(b)}\ the polynomial $G_T(\mathbf{z},\w)=T \prod_{j=1}^n(z_j+w_j)$
is stable in $\CC[\mathbf{z},\w]$.
\end{PROP}

The \emph{complexification} $T_\CC:\CC[\mathbf{z}]\rightarrow\CC[\mathbf{z}]$ of a linear
transformation $T:\RR[\mathbf{z}]\rightarrow\RR[\mathbf{z}]$ is defined as follows.
For any $f\in\CC[\mathbf{z}]$ write $f = g + \i h$ with $g,h\in\RR[\mathbf{z}]$, which can be
done uniquely.  Then $T_\CC(f) = T(g)+\i T(h)$. Let also $\hat{T}_\CC= T(g)-\i T(h)$.

\begin{PROP} \label{R-to-C}
Let $T:\RR[\mathbf{z}]\rightarrow\RR[\mathbf{z}]$ be a linear transformation and let $f \in \CC|z]$ be a stable polynomial.
If $T$ preserves real stability then either $T_\CC(f)$ is stable, or $\hat{T}_\CC(f)$ is stable.
\end{PROP}
\begin{proof}
Let $f=g + \i h\in\CC[\mathbf{z}]$ with $g,h\in\RR[\mathbf{z}]$, and assume that $f$ is
stable.  Then $h\ll g$ by definition.  By Proposition \ref{HB-O}(b),
it follows that $ah+bg$ is real stable for all $a,b\in\RR$.  Therefore,
$aT(h)+bT(g)$ is real stable for all $a,b\in\RR$.  By Proposition \ref{HB-O}(b)
again, either $T(h)\ll T(g)$ or $T(g)\ll T(h)$.  By Proposition \ref{HB-O}(a),
either $T(g)+\i T(h)=T_\CC(f)$ is stable, or $T(g)-\i T(h) =
\hat{T}_\CC(f)$ is stable.
\end{proof}

\section{Proof of the MMCPC.}

\subsection{Reduction to Ferrers matrices.}

\begin{LMA}\label{ferrers}
If $\mathrm{per}(z_j+a_{ij})$ is stable for all Ferrers matrices,
then the MMCPC is true.
\end{LMA}
\begin{proof}
If $\mathrm{per}(z_j+a_{ij})$ is stable for all Ferrers matrices, then by
permuting the columns of such a matrix, the same is true for all monotone
column $\{0,1\}$-matrices.  Now let $A=(a_{ij})$ be an arbitrary $n$-by-$n$
monotone column matrix.  We will show that $\mathrm{per}(z_j+a_{ij})$ is stable by
$n$ applications of Proposition \ref{cone}.

Let $V$ be the vector space of column vectors of length $n$.
The multilinear form $\phi$ we consider is the permanent of an $n$-by-$n$
matrix obtained by concatenating $n$ vectors in $V$.
Let each of $e_1,\ldots,e_n$ be the all-ones vector in $V$.

Initially, let $v_1,v_2,\ldots,v_n$ be arbitrary monotone $\{0,1\}$-vectors.
Then $\phi(v_1+z_1e_1,\ldots,v_n+z_ne_n) = \mathrm{per}(J_nZ_n+H)$
for some monotone column $\{0,1\}$-matrix $H$.
One can specialize any number of $v_j$ to the zero vector, and
any number of $z_j$ to $1$, and the result is not identically zero.
By hypothesis, all these polynomials are stable.

Now we proceed by induction.
Assume that if $v_1,\ldots,v_{j-1}$ are the first $j-1$ columns of $A$,
and if $v_j,\ldots,v_n$ are arbitrary monotone $\{0,1\}$-columns, then
$\phi(v_1+z_1e_1,\ldots,v_n+z_ne_n)$ is stable.  (The base case, $j=1$,
is the previous paragraph.)  Putting $v_j=0$ and $z_j=1$, the resulting
polynomial is not identically zero.  By Proposition \ref{cone} (applied to index $j$),
the set of vectors $v_j$ such that $\phi(v_1+z_1e_1,\ldots,v_n+z_ne_n)$ is
stable is a convex cone containing $\pm e_j$.
Moreover, it contains all monotone $\{0,1\}$-columns, by hypothesis.
Now, any monotone column of real numbers can be written as a nonnegative
linear combination of $-e_1$ and monotone $\{0,1\}$-columns, and
hence is in this cone.  Thus, we may take $v_1,\ldots,v_{j-1},v_j$ to be the
first $j$ columns of $A$, $v_{j+1},\ldots,v_n$ to be arbitrary monotone
$\{0,1\}$-columns, and the resulting polynomial is stable.
This completes the induction step.

After the $n$-th step we find that $\mathrm{per}(J_nZ_n+A)$ is stable.
\end{proof}

\subsection{A more symmetrical problem.}

Let $A=(a_{ij})$ be an $n$-by-$n$ Ferrers matrix, and let $\mathbf{z}=\{z_1,\ldots,z_n\}$.
For each $1\leq j\leq n$, let $y_j=(z_j+1)/z_j$, and let
$Y_n=\mathrm{diag}(y_1,\ldots,y_n)$.  The matrix obtained from $J_nZ_n+A$ by factoring $z_j$
out of column $j$ for all $1\leq j\leq n$ is $AY_n+J_n-A=(a_{ij}y_j+1-a_{ij})$.
It follows that
\begin{equation} \label{z-to-y}
\mathrm{per}(z_j+a_{ij})= z_1 z_2 \cdots z_n\cdot\mathrm{per}(a_{ij}y_j+1-a_{ij}).
\end{equation}

\begin{LMA} \label{y-lma}
For a Ferrers matrix $A=(a_{ij})$, $\mathrm{per}(z_j+a_{ij})$ is stable if and
only if $\mathrm{per}(a_{ij}y_j+1-a_{ij})$ is stable.
\end{LMA}
\begin{proof}
The polynomials are not identically zero.
Notice that $\Im(z_j)>0$ if and only if $\Im(y_j)=\Im(1+z_j^{-1})<0$.
If $\mathrm{per}(z_j+a_{ij})$ is stable, then $\mathrm{per}(a_{ij}y_j+1-a_{ij})\neq 0$
whenever $\Im(y_j)<0$ for all $1\leq j\leq n$.  Since this polynomial has
real coefficients, it follows that it is stable.  The converse is similar.
\end{proof}

The set of $n$-by-$n$ Ferrers matrices has the following duality
$A\mapsto A^\vee = J_n - A^{\top}$:\ transpose and exchange
zeros and ones.  That is, $A^\vee = (a_{ij}^\vee)$ in which $a_{ij}^\vee =
1-a_{ji}$ for all $1\leq i,j\leq n$.  Note that $(A^\vee)^\vee=A$.
However, the form of the expression $\mathrm{per}(a_{ij}y_j+1-a_{ij})$ is not
preserved by this symmetry.  To remedy this defect, introduce new indeterminates
$\x=\{x_1,\ldots,x_n\}$ and consider the matrix $B(A)=(b_{ij})$ with entries
$b_{ij} = a_{ij}y_j+(1-a_{ij})x_{i}$ for all $1\leq i,j\leq n$.
For example, if
$$
A = \left[\begin{array}{lllll}
0 & 1 & 1 & 1 & 1 \\
0 & 0 & 1 & 1 & 1 \\
0 & 0 & 1 & 1 & 1 \\
0 & 0 & 0 & 1 & 1 \\
0 & 0 & 0 & 0 & 0
\end{array}\right]
\hspace{5mm}\mathrm{then}\hspace{5mm}
B(A) = \left[\begin{array}{lllll}
x_1 & y_2 & y_3 & y_4 & y_5 \\
x_2 & x_2 & y_3 & y_4 & y_5 \\
x_3 & x_3 & y_3 & y_4 & y_5 \\
x_4 & x_4 & x_4 & y_4 & y_5 \\
x_5 & x_5 & x_5 & x_5 & x_5
\end{array}\right].
$$

For emphasis, we may write $B(A;\x;\y)$ to indicate that the row variables are
$\x$ and the column variables are $\y$.  The matrices $B(A)$ and $B(A^\vee)$ have
the same general form, and in fact
\begin{eqnarray} \label{dual1}
\mathrm{per}(B(A^\vee;\x;\y)) = \mathrm{per}(B(A;\y;\x)).
\end{eqnarray}
Clearly $\mathrm{per}(B(A))$ specializes to $\mathrm{per}(a_{ij}y_j+1-a_{ij})$ by setting
$x_i=1$ for all $1\leq i\leq n$.  We will show that $\mathrm{per}(B(A))$ is stable,
for any Ferrers matrix $A$.  By Lemmas \ref{basic}(d), \ref{y-lma}, and
\ref{ferrers}, this will imply the MMCPC.

\subsection{A differential recurrence relation.}

Next, we derive a differential recurrence relation for polynomials of the form
$\mathrm{per}(B(A))$, for $A$ an $n$-by-$n$ Ferrers matrix.
There are two cases:\ either $a_{nn}=0$ or $a_{nn}=1$.
Replacing $A$ by $A^\vee$ and using (\ref{dual1}), if necessary, we can assume
that $a_{nn}=0$.

\begin{LMA} \label{diff-reln}
Let $A=(a_{ij})$ be an $n$-by-$n$ Ferrers matrix with $a_{nn}=0$,
let $k\geq 1$ be the number of $0$'s in the last column of $A$,
and let $A^\circ$ be the matrix obtained from $A$ by deleting the
last column and the last row of $A$.  Then
$$
\mathrm{per}(B(A)) =
k x_n\, \mathrm{per}(B(A^\circ)) + x_n y_n\, \partial \mathrm{per}(B(A^\circ)),
$$
in which
$$
\partial =
\sum_{i=1}^{n-k}\frac{\partial}{\partial x_i}
+ \sum_{j=1}^{n-1}\frac{\partial}{\partial y_j}.
$$
\end{LMA}
\begin{proof}
In the permutation expansion of $\mathrm{per}(B(A))$ there are two types of terms:\
those that do not contain $y_n$ and those that do. Let $T_\sigma$ be the
term of $\mathrm{per}(B(A))$ indexed by $\sigma\in\S_n$.  For each
$n-k+1\leq i\leq n$, let $\EuScript{C}} \newcommand{\CC}{\mathbb{C}_i$ be the set of those terms $T_\sigma$ such
that $\sigma(i)=n$;  for a term in $\EuScript{C}} \newcommand{\CC}{\mathbb{C}_i$ the variable chosen in the last column
is $x_{i}$.  Let $\EuScript{D}} \renewcommand{\d}{\mathbf{d}$ be the set of all other terms; for a term in $\EuScript{D}} \renewcommand{\d}{\mathbf{d}$ the
variable chosen in the last column is $y_n$.

For every permutation $\sigma\in\S_n$, let $(i_\sigma,j_\sigma)$ be such
that $\sigma(i_\sigma)=n$ and $\sigma(n)=j_\sigma$, and define
$\pi(\sigma)\in\S_{n-1}$ by putting $\pi(i)=\sigma(i)$ if $i\neq i_\sigma$,
and $\pi(i_\sigma)=j_\sigma$ (if $i_\sigma\neq n$).
Let $T_{\pi(\sigma)}$ be the corresponding term of $\mathrm{per}(B(A^\circ))$.
See Figure 1 for an example.  Informally, $\pi(\sigma)$ is obtained
from $\sigma$, in word notation, by replacing the largest element with the last
element, unless the largest element is last, in which case it is deleted.

\begin{figure}[tb]
$$
\left[\begin{array}{cccccc}
\cdot & \cdot & \Box & \cdot & \cdot & \cdot \\
\Box & \cdot & \cdot & \cdot & \cdot & \cdot \\
\cdot & \cdot & \cdot & \cdot & \cdot & \Box \\
\cdot & \cdot & \cdot & \cdot & \Box & \cdot \\
\cdot & \Box & \cdot & \cdot & \cdot & \cdot \\
\cdot & \cdot & \cdot & \Box & \cdot & \cdot
\end{array}\right]
\quad \mapsto \quad
\left[\begin{array}{cccccc}
\cdot & \cdot & \Box & \cdot & \cdot &  \\
\Box & \cdot & \cdot & \cdot & \cdot &  \\
\cdot & \cdot & \cdot & \Box & \cdot &  \\
\cdot & \cdot & \cdot & \cdot & \Box &  \\
\cdot & \Box & \cdot & \cdot & \cdot &  \\
 &  &  &  &  &
\end{array}\right]
$$
\caption{$\sigma= 3\ 1\ 6\ 5\ 2\ 4$ maps to $\pi(\sigma)= 3\ 1\ 4\ 5\ 2$.}
\end{figure}

For each $n-k+1\leq i\leq n$, consider all permutations $\sigma$ indexing terms
in $\EuScript{C}} \newcommand{\CC}{\mathbb{C}_i$.  The mapping $T_\sigma \mapsto T_{\pi(\sigma)}$ is a bijection from the
terms in $\EuScript{C}} \newcommand{\CC}{\mathbb{C}_i$ to all the terms in $\mathrm{per}(B(A^\circ))$.  Also, for each
$\sigma\in\EuScript{C}} \newcommand{\CC}{\mathbb{C}_i$, $T_\sigma = x_n T_{\pi(\sigma)}$.  Thus, for each
$n-k+1\leq i\leq n$, the sum of all terms in $\EuScript{C}} \newcommand{\CC}{\mathbb{C}_i$ is $x_n \mathrm{per}(B(A^\circ))$.

Next, consider all permutations $\sigma$ indexing terms in $\EuScript{D}} \renewcommand{\d}{\mathbf{d}$.
The mapping $T_\sigma\mapsto T_{\pi(\sigma)}$ is $(n-k)$-to-one
from $\EuScript{D}} \renewcommand{\d}{\mathbf{d}$ to the set of all terms in $\mathrm{per}(B(A^\circ))$, since one
needs both $\pi(\sigma)$ and $i_\sigma$ to recover $\sigma$.
Let $v_\sigma$ be the variable in position $(i_\sigma,j_\sigma)$ of $B(A^\circ)$.
Then $v_\sigma T_\sigma = x_n y_n T_{\pi(\sigma)}$.  It follows that
for any variable $w$ in the set $\{x_1,\ldots,x_{n-k},y_1,\ldots,y_{n-1}\}$,
the sum over all terms in $\EuScript{D}} \renewcommand{\d}{\mathbf{d}$ such that $v_\sigma=w$ is
$$
x_n y_n \frac{\partial}{\partial w} \mathrm{per}(B(A^\circ)).
$$
Since $v_\sigma$ is any element of the set
$\{x_1,\ldots,x_{n-k},y_1,\ldots,y_{n-1}\}$, it follows that the sum of all terms in
$\EuScript{D}} \renewcommand{\d}{\mathbf{d}$ is $x_n y_n \partial \mathrm{per}(B(A^\circ))$.

The preceding paragraphs imply the stated formula.
\end{proof}

\subsection{Finally, proof of the MMCPC}

\begin{THM} \label{perBA-stable}
For any $n$-by-$n$ Ferrers matrix $A$, $\mathrm{per}(B(A))$ is stable.
\end{THM}
\begin{proof}
As above, by replacing $A$ by $A^\vee$ if necessary, we may assume that
$a_{1n}=0$.  We proceed by induction on $n$, the base case $n=1$ being trivial.
For the induction step, let $A^\circ$ be as in Lemma \ref{diff-reln}.
By induction, we may assume that $\mathrm{per}(B(A^\circ))$ is stable;\
clearly this polynomial is multiaffine.
Thus, by Lemma \ref{diff-reln}, it suffices to prove that the linear
transformation $T=k+y_n\partial$ maps stable multiaffine polynomials to stable
polynomials if $k\geq 1$.  This operator has the form $T=k+z_{m}\sum_{j=1}^{m-1}
\partial/\partial z_j$ (renaming the variables suitably).  By Proposition \ref{BB}
it suffices to check that the polynomial
\begin{eqnarray*}
G_T(\mathbf{z},\w)
&=& T \prod_{j=1}^m(z_j+w_j)\\
&=& \left(k+z_m\sum_{j=1}^{m-1}\frac{1}{z_j+w_j}\right) \prod_{j=1}^m(z_j+w_j)
\end{eqnarray*}
is stable.
If $z_j$ and $w_j$ have positive imaginary parts for all $1\leq j\leq m$ then
$$
\xi = \frac{k}{z_m} + \sum_{j=1}^{m-1}\frac{1}{z_j+w_j}
$$
has negative imaginary part (since $k\geq 0$).  Thus $z_m\xi\neq 0$.  Also, $z_j+w_j$
has positive imaginary part, so that $z_j+w_j\neq 0$ for each $1\leq j\leq m$.
It follows that $G_T(\mathbf{z},\w)\neq 0$, so that $G_T$ is stable, completing the
induction step and the proof.
\end{proof}

\begin{proof}[Proof of the MMCPC]
Let $A$ be any $n$-by-$n$ Ferrers matrix.  By Theorem \ref{perBA-stable},
$\mathrm{per}(B(A))$ is stable.  Specializing $x_i=1$ for all $1\leq i\leq n$,
Lemma \ref{basic}(d) implies that $\mathrm{per}(a_{ij}y_j+1-a_{ij})$ is stable.
Now Lemma \ref{y-lma} implies that $\mathrm{per}(z_j+a_{ij})$ is stable.
Finally, Lemma \ref{ferrers} implies that the MMCPC is true.
\end{proof}
Henceforth, we shall refer to the MMCPT -- ``T'' for ``Theorem''.

\section{Further results.}

\subsection{Generalization to rectangular matrices.}

We can generalize Theorem \ref{perBA-stable} to rectangular matrices,
as follows.  Let $A=(a_{ij})$ be an $m$-by-$n$ matrix.
As in the square case, $A$ is a \emph{Ferrers matrix} if it is a
$\{0,1\}$-matrix that is weakly decreasing down columns and increasing across rows.
The matrix $B(A)$ is constructed just as in the square case:
$B(A)=(b_{ij}) = (a_{ij}y_j+(1-a_{ij})x_{i})$, using row variables
$\x=\{x_1,\ldots,x_m\}$ and column variables $\y=\{y_1,\ldots,y_n\}$.
For emphasis, we may write $B(A;\x;\y)$
to indicate that the row variables are $\x$ and the column variables are $\y$.
The symmetry $A\mapsto A^\vee$ takes an $m$-by-$n$ Ferrers matrix to
an $n$-by-$m$ Ferrers matrix.

Now let $k\leq \min\{m,n\}$.  The \emph{$k$-permanent} of
an $m$-by-$n$ matrix $H=(h_{ij})$ is
$$
\mathrm{per}_k(H) = \sum_R \sum_C \sum_\beta \prod_{i\in R} h_{i,\beta(i)},
$$
in which $R$ ranges over all $k$-element subsets of $\{1,\ldots,m\}$,
$C$ ranges over all $k$-element subsets of $\{1,\ldots,n\}$, and
$\beta$ ranges over all bijections from $R$ to $C$.  (Note that
$\mathrm{per}_0(H)=1$ for any matrix $H$.) In the case $k=m=n$
this reduces to the permanent of a square matrix.

For an $m$-by-$n$ Ferrers matrix $A$ and $k\leq\min\{m,n\}$, note that
\begin{eqnarray} \label{dual2}
\mathrm{per}_k(B(A^\vee;\x;\y)) = \mathrm{per}_k(B(A;\y;\x)).
\end{eqnarray}
Thus, replacing $A$ by $A^\vee$ if necessary, we may assume that $m\leq n$.

\begin{PROP} \label{m-to-k}
Let $A=(a_{ij})$ be an $m$-by-$n$ Ferrers matrix.
Then $\mathrm{per}_k(B(A))$ is stable for all $k\leq \min\{m,n\}$.
\end{PROP}
\begin{proof}
Using (\ref{dual2}), if necessary, we may assume that $m\leq n$.

We begin by showing that $\mathrm{per}_m(B(A))$ is stable.
Let $A'$ be the $n$-by-$n$ Ferrers matrix obtained by concatenating $n-m$ rows
of $0$'s to the bottom of $A$.
One checks that
$$
\mathrm{per}(B(A'))= (n-m)!\,x_n x_{n-1}\cdots x_{m+1} \cdot \mathrm{per}_m(B(A)).
$$
By Theorem \ref{perBA-stable}, $\mathrm{per}(B(A'))$ is stable, and it follows
easily that $\mathrm{per}_m(B(A))$ is stable.

Now, let $J_{m,n}$ be the $m$-by-$n$ matrix of all 1's.  Then
$$
\mathrm{per}_m(B(A)+tJ_{m,n})
= \sum_{k=0}^m \mathrm{per}_k(B(A)) \binom{n-k}{m-k}(m-k)! t^{m-k}.
$$
By Lemma \ref{basic}(c,f), this polynomial is stable.
Extracting the coefficient of $t^{m-k}$ from this, and dividing by
$ \binom{n-k}{m-k}(m-k)!$, Lemma \ref{coeffs} shows that $\mathrm{per}_k(B(A))$
is stable for all $0\leq k\leq m$.
\end{proof}

Proposition \ref{m-to-k} suggests the idea of a similar generalization of
the MMCPT:\ is it true that $\mathrm{per}_k(J_{m,n}Z_n+A)$ is stable for every
$m$-by-$n$ monotone column matrix $A$ and $k\leq\min\{m,n\}$?
This conjecture originates in \cite{HV}.  One cannot
derive this from Proposition \ref{m-to-k}, however, because there is no
analogue of (\ref{z-to-y}) for $k$-permanents.  Nonetheless, we can prove
this result for half the cases.

\begin{PROP}
Let $A$ be an $m$-by-$n$ monotone column matrix with $m\geq n$, and let
$k\leq n$.  Then $\mathrm{per}_k(J_{m,n}Z_n+A)$ is stable.
\end{PROP}
\begin{proof}
Let $A'$ be the $m$-by-$m$ matrix obtained from $A$ by concatenating
$m-n$ zero columns to the right of $A$.  Then
$$
\mathrm{per}(J_mZ_m+A') = (m-n)!z_m z_{m-1} \cdots z_{n+1}\cdot \mathrm{per}_n(J_{m,n}Z_n+A).
$$
Since $\mathrm{per}(J_mZ_m+A')$ is stable, it follows that $\mathrm{per}_n(J_{m,n}Z_n+A)$
is stable.  By Lemma \ref{basic}(c,f), it follows that
$\mathrm{per}_n(J_{m,n}Z_n+A+tJ_{m,n})$ is stable.
Extracting the coefficient of $t^{n-k}$ from this, and dividing by
$ \binom{m-k}{n-k}(n-k)!$, Lemma \ref{coeffs} shows that $\mathrm{per}_k(J_{m,n}Z_n+A)$
is stable for all $0\leq k\leq n$.
\end{proof}

\subsection{A cycle-counting generalization.}

Theorem \ref{perBA-stable} can be generalized in another direction, as follows.

For each permutation $\sigma\in\S_n$, let $\mathrm{cyc}(\sigma)$ denote the number of
cycles of $\sigma$.  For an indeterminate $\alpha$ and an
$n$-by-$n$ matrix $H=(h_{ij})$, the \emph{$\alpha$-permanent} of $H$ is
$$
\mathrm{per}(H;\alpha) = \sum_{\sigma\in\S_n} \alpha^{\mathrm{cyc}(\sigma)}
\prod_{i=1}^n h_{i,\sigma(i)}.
$$

The numbers $\mathrm{cyc}(\sigma)$ behave well with respect to the duality
$A\mapsto A^\vee$:\ for any Ferrers matrix $A$,
\begin{eqnarray} \label{dual3}
\mathrm{per}(B(A^\vee;\x;\y);\alpha) = \mathrm{per}(B(A;\y;\x);\alpha).
\end{eqnarray}

\begin{LMA}
Let $A=(a_{ij})$ be an $n$-by-$n$ Ferrers matrix with $a_{nn}=0$,
let $k\geq 1$ be the number of $0$'s in the last column of $A$,
and let $A^\circ$ be the matrix obtained from $A$ by deleting the
last column and the last row of $A$.  Then
$$
\mathrm{per}(B(A);\alpha) = (\alpha + k-1) x_n\, \mathrm{per}(B(A^\circ);\alpha)
+ x_n y_n\, \partial \mathrm{per}(B(A^\circ);\alpha),
$$
with $\partial$ as in Lemma \ref{diff-reln}.
\end{LMA}
\begin{proof}
Adopt the notation of the proof of Lemma \ref{diff-reln}.  To obtain
the present result, observe that if $T_\sigma$ is in $\EuScript{C}} \newcommand{\CC}{\mathbb{C}_n$ then
$\mathrm{cyc}(\sigma) = 1 + \mathrm{cyc}(\pi(\sigma))$, and otherwise
$\mathrm{cyc}(\sigma)=\mathrm{cyc}(\pi(\sigma))$.
\end{proof}

\begin{PROP} \label{alpha}
For $\alpha> 0$ and $A$ a Ferrers matrix, $\mathrm{per}(B(A);\alpha)$ is stable.
\end{PROP}
\begin{proof}
Reprising the proof of Theorem \ref{perBA-stable}, it suffices to show
that an operator of the form
$$
T=(\alpha+k-1)+z_{m}\sum_{i=1}^{m-1} \partial/\partial z_i
$$
preserves stability when $k\geq 1$.  The argument of the proof of Theorem \ref{perBA-stable} works
when $\alpha> 0$.
\end{proof}

For $\alpha> 0$ and $A$ a Ferrers matrix, specialize all $x_i=1$ and
diagonalize all $y_j=z$ in $\mathrm{per}(B(A);\alpha)$.  By Lemma \ref{basic}(c,d),
the result is a (univariate) polynomial with only real roots.  This special
case is also implied by Theorem 2.5 of \cite{H}.

\subsection{Multivariate stable Eulerian polynomials.}

Given a permutation $\sigma \in \S_n$, viewed as a linear sequence
$\sigma (1) \sigma (2) \cdots \sigma (n)$,
let $\text{L}(\sigma)$ denote the result of the following procedure.  First
form the two-line array
\begin{eqnarray*}
\text{T}(\sigma) = \left (
\begin{matrix}
1 & 2 & \cdots & n \\
\sigma (1) & \sigma (2) & \cdots & \sigma (n)
\end{matrix}
\right ).
\end{eqnarray*}
Then, viewing $\text{T}(\sigma)$ as a map sending $i$ to $\sigma (i)$,
break $\text{T}(\sigma)$ into cycles,
with the smallest element of each cycle at the end, and
cycles listed left-to-right with smallest elements increasing.
Finally, erase the parentheses delimiting the cycles to form
a new linear sequence $\text{L}(\sigma)$.  For example,
if $\sigma=341526978$, then $\text{T}(\sigma)$ has cycle decomposition
$(31)(452)(6)(987)$ and $\text{L}(\sigma)=314526987$.

Let $\text{P}(\sigma)$ denote the placement of $n$ nonattacking rooks on
the squares $(i,\sigma (i))$, $1\le i \le n$.
As noted by Riordan \cite{Rio}, rooks in $\text{P}(\sigma)$ that occur above the
diagonal correspond to
exceedences (values of $i$ for which $\sigma (i) > i$) in $\sigma$ and descents
(values of $i$ for which $\sigma (i) > \sigma (i+1)$) in $\text{L}(\sigma)$.
Hence
\begin{eqnarray}
\label{Eulerian}
\sum_{\sigma \in \S_n}
z^{\text{exc}(\sigma)} =
\sum_{\sigma \in \S_n}
z^{\text{des}(\sigma)},
\end{eqnarray}
where $\text{exc}(\sigma)$ is the number of exceedences and
$\text{des}(\sigma)$ the number of descents
of $\sigma$.

The polynomial in (\ref{Eulerian}) is known as the {\it Eulerian polynomial}.
It is one of the classic examples in
combinatorics of a polynomial with only real roots.
Let $E_n=(e_{ij})$ denote the $n$-by-$n$ matrix with $e_{ij}=0$ if $i\geq j$
and $e_{ij}=1$ if $i<j$.  Then $\mathrm{per}(B(E_n;\x;\y))$ is stable by Theorem
\ref{perBA-stable}. Let $\boldsymbol{1}$ be the vector (of appropriate size) of all ones.
From the above discussion, $\mathrm{per}(B(E_n;\boldsymbol{1};z,\ldots,z))$ equals the
Eulerian polynomial; by Lemma \ref{basic}(c,d) this is a univariate stable
polynomial with real coefficients, so it has only real roots.
Similarly, we see that
\begin{align}
\label{BBB}
\mathrm{per}(B(E_n;\boldsymbol{1};\y)) &=
\sum_{\sigma \in \S_n}
\prod _{ \sigma(i) > \sigma(i+1)} y_{\sigma(i)} \\ &=
\sum_{\sigma \in \S_n}
\prod _{ \sigma(i) > i} y_{\sigma(i)}
\end{align}
is stable in $\{y_1,y_2,\ldots ,y_{n}\}$ (but $y_1$ does not really occur).

Letting $f=\mathrm{per}(B(E_n;\boldsymbol{1};\y))$, note that the partial of $f$ with respect to $y_i$,
evaluated at all $y$-variables equal to $1$, equals the number of permutations
in $\S_n$ that have $i$ as a ``descent top", i.e. have the property that
$i$ is followed immediately
by something less than $i$.  Denoting this number by $\text{Top}(i;n)$,
applying Proposition \ref{Delta} to $f$ we get
\begin{align}
\text{Top}(i;n)\text{Top}(j;n) \ge n! \, \text{Top}(i,j;n),
\end{align}
where $\text{Top}(i,j;n)$ is the number of permutations in $\S_n$
having both $i$ and $j$ as descent
tops, with $2\le i<j\le n$.  Dividing both sides of the above equation by $n!^2$ shows that
occurrences of descent tops in a uniformly random permutation are negatively correlated.

More general forms of (\ref{BBB}) can be defined which still maintain stability.
First of all,
cycles in $\text{T}(\sigma)$
clearly translate into left-to-right minima in $\text{L}(\sigma)$, and so by Proposition
\ref{alpha} the polynomial
\begin{eqnarray*}
\sum_{\sigma \in \S_n}
\alpha ^{\text{LRmin}(\sigma)}
\prod _{\sigma(i) > \sigma(i+1)} y_{\sigma(i)}
\end{eqnarray*}
is stable in the $\y$ for $\alpha>0$, with $\text{LRmin}(\sigma)$
denoting the number of left-to-right minima of $\sigma$.

Secondly, the sum in (\ref{BBB}) can be replaced by a sum over permutations of a
multiset.  For a given vector $\v =(v_1,\ldots ,v_t) \in \mathbb N ^t$,
let $N(\v) = \{1^{v_1}2^{v_2}\cdots t^{v_t}\}$ denote the multiset
with $v_i$ copies of $i$, and $\EuScript{M}} \newcommand{\m}{\mathbf{m}(\v)$ the set of multiset permutations
of $N(\v)$ (so for example $\EuScript{M}} \newcommand{\m}{\mathbf{m}(2,1) = \{112,121,211\}$).
Riordan \cite{Rio} noted that if we map our previous sequence $L(\sigma)$ to a multiset permutation
$m(\sigma)$ by replacing numbers $1$ through $v_1$ in $L(\sigma)$ by $1$'s,
numbers $v_1+1$ through $v_1+v_2$ by $2$'s, etc., we get a $\prod v_i!$ to $1$ map,
and furthermore certain squares above the diagonal where rooks in $P(\sigma)$
correspond to descents in $L(\sigma)$ no longer correspond to descents in
$m(\sigma)$. For example, if $v_1=2$, then $1$ and $2$ in $L(\sigma)$ both get mapped
to $1$ in $m(\sigma)$, so a rook on square $(1,2)$ no longer corresponds to a descent.

Let $n$ denote the sum of the coordinates of $\v$, and let
$Y(\v)$ be the sequence of variables obtained by starting with
$y_1,\ldots ,y_n$ and setting the first $v_1$ $y$-variables equal to $y_1$,
the next $v_2$ $y$-variables equal to $y_2$, etc. Then if $E(\v)$ is the
Ferrers matrix whose first $v_1$ columns are all zeros, the next $v_2$ columns have
ones in the top $v_1$ rows and zeros below, the next $v_3$ columns have ones in the
top $v_1+v_2$ rows and zeros below, etc., an easy extension of the argument
above implies
\begin{align}
\label{MBBB}
(1/\prod _i v_i !) \text{per}(   B(  E(\v;\boldsymbol{1};Y(\v))  )   )
=\sum_{\sigma \in \EuScript{M}} \newcommand{\m}{\mathbf{m}(\v)}
\prod _{ \sigma(i) > \sigma(i+1)} y_{\sigma(i)}
\end{align}
is stable in the $y_i$.
This contains Simion's result \cite{Sim}, that the multiset Eulerian polynomial
has only real roots.  If $\v$ has all ones, i.e. $N(\v)$ is a set, it reduces to our
previous result.  Finally, we note that this argument also shows that if we replace the
condition $\sigma (i) > \sigma (i+1)$ by the more general condition
$\sigma (i) > \sigma (i+1)+j-1$, for any fixed positive integer $j$, we still get
stability.

\subsection{Grace's Apolarity Theorem.}

Univariate complex polynomials $f(t)=\sum_{k=0}^n \binom{n}{k} a_k t^k$ and
$g(t)=\sum_{k=0}^n \binom{n}{k} b_k t^k$ are \emph{apolar} if $a_nb_n\neq 0$
and
$$
\sum_{k=0}^n \binom{n}{k} (-1)^{n-k} a_k b_{n-k} = 0.
$$

\begin{LMA} \label{per-wz}
Let $f(t)=\sum_{k=0}^n \binom{n}{k} a_k t^k$ and
$g(t)=\sum_{k=0}^n \binom{n}{k} b_k t^k$ be complex polynomials of degree $n$.
Let the roots of $f(t)$ be $z_1,\ldots,z_n$ and let the roots of $g(t)$ be
$w_1,\ldots,w_n$.  Then
$$
\sum_{k=0}^n \binom{n}{k} (-1)^{n-k} a_k b_{n-k} = n!\,a_n b_n\, \mathrm{per}(w_i-z_j).
$$
In particular, $f(t)$ and $g(t)$ are apolar if and only if $\mathrm{per}(w_i-z_j)=0$.
\end{LMA}
\begin{proof}
It suffices to prove this for monic polynomials $f(t)$ and $g(t)$.
For each permutation $\sigma\in\S_n$ there are $2^n$ terms in $\mathrm{per}(w_i-z_j)$,
since for each $1\leq i\leq n$ either $w_i$ or $-z_{\sigma(i)}$ can be chosen.
For each subset $R$ of rows of size $k$, and subset $C$ of columns of size
$n-k$, the monomial $\w^R\mathbf{z}^C$ is produced $k!(n-k)!$ times.
Since $(-1)^{k}a_{n-k}$ is the $k$-th elementary symmetric function of
$\{z_1,\ldots,z_n\}$, and similarly for $(-1)^{k}b_{n-k}$ and $\{w_1,\ldots,w_n\}$,
the result follows.
\end{proof}

\begin{LMA} \label{mobius}
Let $f(t)$ and $g(t)$ be polynomials of degree $n$.
Let $t\mapsto\phi(t)=(at+b)/(ct+d)$ be a M\"obius transformation,
with inverse $\phi^{-1}(t)=(\alpha t+\beta)/(\gamma t + \delta)$.
Let $\widehat{f}(t)=(\gamma t+\delta)^n f(\phi^{-1}(t))$ and
$\widehat{g}(t)=(\gamma t+\delta)^n g(\phi^{-1}(t))$ have degree $n$.
Then $\widehat{f}(t)$ and $\widehat{g}(t)$ are apolar if and only if
$f(t)$ and $g(t)$ are apolar.
\end{LMA}
\begin{proof}
Let the roots of $f(t)$ be $z_1,\ldots,z_n$ and let the roots of $g(t)$
be $w_1,\ldots,w_n$.  Then the roots of $\widehat{f}(t)$ are
$\phi(z_1),\ldots,\phi(z_n)$ and the roots of $\widehat{g}(t)$ are
$\phi(w_1),\ldots,\phi(w_n)$.  Consider the permanent $\mathrm{per}(\phi(w_i)-\phi(z_j))$.
The $(i,j)$-entry of this matrix is
$$
\frac{aw_i+b}{cw_i+d}-\frac{az_j+b}{cz_j+d}=\frac{(ad-bc)(w_i-z_j)}{(cw_i+d)(cz_j+d)}.
$$
Factor $(cw_i+d)^{-1}$ out of row $i$, factor $(cz_j+d)^{-1}$ out of column
$j$, and factor $ad-bc$ out of every row.  Therefore
$$
\mathrm{per}(\phi(w_i)-\phi(z_j)) = \frac{(ad-bc)^n}{\prod_{h=1}^n (cw_h+d)(cz_h+d)}
\cdot \mathrm{per}(w_i-z_j).
$$
Since the prefactor on the right-hand side is neither zero nor infinite,
the result follows from Lemma \ref{per-wz}.
\end{proof}

A \emph{circular region} $\EuScript{A}} \renewcommand{\a}{\mathbf{a}$ is a proper subset of $\CC$ that is either
open or closed, and is bounded by either a circle or a straight line.

\begin{THM}[Grace's Apolarity Theorem] \label{grace}
Let $f(t)$ and $g(t)$ be apolar polynomials.  If every root of $g(t)$
is in a circular region $\EuScript{A}} \renewcommand{\a}{\mathbf{a}$, then $f(t)$ has at least one root in $\EuScript{A}} \renewcommand{\a}{\mathbf{a}$.
\end{THM}
\begin{proof}
It suffices to prove this for monic polynomials $f(t)$ and $g(t)$, and
for open circular regions $\EuScript{A}} \renewcommand{\a}{\mathbf{a}$ since a closed circular region is the intersection
of all open circular regions which contain it.  Let $t\mapsto\phi(t)$ be
a M\"obius transformation that maps $\EuScript{A}} \renewcommand{\a}{\mathbf{a}$ to the upper half-plane $\EuScript{H}$.
By Lemma \ref{mobius}, it suffices to prove this when the circular region
is $\EuScript{H}$ itself.  Let the roots of $f(t)$ be
$z_1,\ldots,z_n$ and let the roots of $g(t)$ be $w_1,\ldots,w_n$.

If all of $w_1,\ldots,w_n$ are real numbers, then by permuting the rows of
$(w_i+z_j)$ we can assume that $w_1\leq\cdots\leq w_n$ without changing the
value of $\mathrm{per}(w_i+z_j)$.  By the MMCPT,
$\mathrm{per}(w_i+z_j)$ is a real stable polynomial in $z_1,\ldots,z_n$.
In other words, the transformation $T:\RR[z]\rightarrow\RR[\mathbf{z}]$ defined by
$$
T(f(z)) = \mathrm{per}(w_i+z_j),
$$
where $f(z)=(z+w_1)(z+w_2)\cdots(z+w_n)$
preserves real stability.  This is a linear transformation.  Suppose that $f(z) \in \CC[z]$ is stable. By Proposition
\ref{R-to-C}, either $T_\CC(f(z))$ is stable or $\hat{T}_\CC(f(z))$ is stable.
Diagonalizing by setting $z_j=z$ for all $1\leq j\leq n$, we see that
$T_\CC(f)(z,\ldots,z)= n! f(z)$, so that $T_\CC(f(z))$ is stable.
Therefore $\mathrm{per}(w_i+z_j)$ is a stable polynomial
in $\CC[\mathbf{z}]$, for all $w_1,\ldots,w_n\in\EuScript{H}$.  Therefore $\mathrm{per}(w_i+z_j)$
is a stable polynomial in $\CC[\w,\mathbf{z}]$. Actually it satisfies a stronger stability property. Namely if $z_j \in \overline{\EuScript{H}}$ and
$w_j \in \EuScript{H}$ for all $1\leq j\leq n$, then $\mathrm{per}(w_i+z_j) \neq 0$. Indeed if we fix $\zeta_j \in \overline{\EuScript{H}}$ for all $1\leq j\leq n$, then
the polynomial $\mathrm{per}(w_i + \zeta_j) \in \CC[\w]$ is either identically zero or stable (and not identically zero) by Lemma \ref{basic} (d). Clearly  $\mathrm{per}(w_i + \zeta_j)$ is not identically zero.

Now assume that $w_i\in\EuScript{H}$ for all $1\leq i\leq n$.  Arguing for a
contradiction, assume that $z_j\not\in\EuScript{H}$ for all $1\leq j\leq n$.
Then $-z_j\in\overline{\EuScript{H}}$ for all $1\leq j\leq n$.  Hence  $\mathrm{per}(w_i-z_j)\neq 0$ by the argument given in the previous paragraph.  But $\mathrm{per}(w_i-z_j)=0$ by Lemma
\ref{per-wz}, since $f(t)$ and $g(t)$ are apolar.  This contradiction completes
the proof.
\end{proof}

Our proof of Grace's apolarity theorem relies on MMCPT. To avoid going in circles we should ensure ourselves that the
proof of MMCPT does not use any form of Grace's apolarity theorem. In fact what we use in the proof of MMCPT is that condition (b) in Proposition \ref{BB} implies that the operator preserves stability, the proof of which does not use Grace's apolarity theorem.

\subsection{Permanental inequalities}
If $A$ is a $n$-by-$n$ matrix and $S \subseteq [n]=\{1,\ldots,n\}$ let $A_S$ be the matrix obtained by replacing the columns indexed by $S$ by columns of all ones.
\begin{CORO}\label{negass}
Let $A$ be an  $n$-by-$n$ monotone matrix, $S \subset [n]$,  and  $i,j \in [n]\setminus S$. Then
$$
\mathrm{per}(A_{S\cup \{i\}})\mathrm{per}(A_{S\cup \{j\}}) \geq \mathrm{per}(A_{S\cup \{i,j\}}) \mathrm{per}(A_S).
$$
\end{CORO}
\begin{proof}
The proof follows immediately from Proposition \ref{Delta} applied to $\mathrm{per}(z_j+a_{ij})$.
\end{proof}
Note that Corollary \ref{negass} can be interpreted as that the permanent is pairwise negatively associated in columns.

The \emph{generating polynomial} of a discrete measure $\mu : 2^{[n]} \rightarrow \RR_{\geq 0}$ is given by
$$
G_\mu(\mathbf{z})= \sum_{S \in 2^{[n]}} \mu(S) \prod_{j \in S}z_j.
$$
The measure $\mu$ is \emph{Rayleigh} if
\begin{equation}\label{Ra}
\frac {\partial G_\mu}{\partial z_i}(\x)\frac {\partial G_\mu}{\partial z_j}(\x) \geq \frac {\partial^2 G_\mu}{\partial z_i\partial z_j}(\x)G_\mu(\x),
\end{equation}
for all $\x \in \RR_{\geq 0}^n$, and it is called \emph{strongly Rayleigh} if \eqref{Ra} holds for all $\x \in \RR^n$. We refer
to \cite{BBL,W1} for more information on Rayleigh and  strongly Rayleigh measures.

Suppose that $A$ is an  $n$-by-$n$ monotone matrix with nonnegative coefficients. Consider the
discrete measure $\mu_A : 2^{[n]} \rightarrow \RR_{\geq 0}$ defined by $\mu_A(S) = \mathrm{per}(A_S)$. By Proposition \ref{Delta} we see that $\mu_A$ is strongly Rayleigh. This fact entails many inequalities.
\begin{CORO}\label{nlc}
Suppose that $A$ is an  $n$-by-$n$ monotone matrix with nonnegative coefficients. Then
$$
\mathrm{per}(A_S)\mathrm{per}(A_T) \geq \mathrm{per}(A_{S\cup T})\mathrm{per}(A_{S \cap T}),
$$
for all $S, T \subseteq [n]$.

Moreover
$$
\mathrm{per}(A) \leq s_1\cdots s_n \frac {n!}{n^n},
$$
where $s_i$ is the sum of the elements in the $i$th column.
\end{CORO}
\begin{proof}
The first inequality holds for all Rayleigh measures, see \cite[Theorem 4.4]{W1}.

Let $\mu(S)= \mathrm{per}(A_{[n]\setminus S})/n!$. By the above $
\mu(S)\mu(T) \geq \mu(S\cup T)\mu(S \cap T)
$
for all $S, T \subseteq [n]$. Thus $\mu(S \cup T) \leq \mu(S)\mu(T)$ whenever $S\cap T=\emptyset$, and after iteration
$\mu([n]) \leq \mu(\{1\})\cdots \mu(\{n\})$. The proof now follows by observing that
$\mu(\{i\})= s_i/n$ for all $i \in [n]$.

One can also prove the last inequality by an elementary argument. If there are two
different consecutive elements $b>a$ in a column of $A$, replace these by their average to obtain the matrix $A'$. It is plain to see that $\mathrm{per}(A) \leq \mathrm{per}(A')$. Iterating this procedure it follows that $\mathrm{per}(A) \leq \mathrm{per}(B)$, where each element in column $i$ of $B$ is equal to $s_i/n$. The inequality now follows.
\end{proof}
The second inequality in Corollary \ref{nlc} can be compared with the Van der Waerden conjecture
which asserts that the permanent of a doubly stochastic matrix is greater than or equal to $n!/n^n$. The Van der Waerden conjecture which was stated in 1926 was proved by Falikman in 1981; the case of equality was proved by Egorychev. Gurvits has recently provided a beautiful proof of a vast generalization of  the Van der Waerden conjecture using stable polynomials, see \cite{Gu} and
\cite[Section 8]{W}.

If $f : 2^{[n]} \rightarrow \RR$, and $\mu$ is a discrete measure on $2^{[n]}$ we let
$$
\int f d \mu = \sum_{S \in 2^{[n]}} f(S)\mu(S).
$$
A measure $\mu$ on $2^{[n]}$ is \emph{negatively associated} if for all increasing functions
$f,g : 2^{[n]} \rightarrow \RR$ depending on disjoint sets of variables
$$
\int fg d\mu \int d\mu \leq \int f d\mu \int g d\mu,
$$
see e.g. \cite{BBL}.
\begin{CORO}
Suppose that $A$ is an  $n$-by-$n$ monotone matrix with nonnegative coefficients.  Then the
discrete measure $\mu_A : 2^{[n]} \rightarrow \RR_{\geq 0}$, defined by $\mu_A(S) = \mathrm{per}(A_S)$, is negatively associated.
\end{CORO}
\begin{proof}
The corollary follows from the fact that $\mu_A$ is strongly Rayleigh. Such measures are negatively associated, which was proved in \cite[Theorem 4.9]{BBL}
\end{proof}


Eigenvalue continuity and Geršgorin's theorem

Abstract: Two types of eigenvalue continuity are commonly used in the literature. However, their meanings and the conditions under which continuities are used are not always stated clearly. This can lead to some confusion and needs to be addressed. In this note, we revisit the Geršgorin disk theorem and clarify the issue concerning the proofs of the theorem by continuity.

\section{Introduction}

In his seminal paper in 1931 \cite{Ger31}, Ger\v{s}gorin presented an important result about the localization of the eigenvalues of matrices.  He showed that
(1) all eigenvalues of a square matrix lie in the union of the later so-called {\em Ger\v{s}gorin disks} and (2) if some, say $m$, of the disks are disjoint from the remaining disks, then the union of these $m$ disks contains exactly $m$ eigenvalues (counted with algebraic multiplicities). The result was named after  Ger\v{s}gorin as the {\em Ger\v{s}gorin disk theorem} due to its importance and applications for estimating  and  localizing   eigenvalues.

Let $A=(a_{ij})$ be an $n\times n$ complex matrix and let $r_i=\sum_{j\not = i} |a_{ij}|$, $i=1, \dots, n$.
The set $D_i=\{z\in \Bbb C : |z-a_{ii}|\leq r_i\}$ is referred to as a Ger\v{s}gorin disk of $A$.
Let $A_0$ be the diagonal matrix that has the same main diagonal as  $A$.
Ger\v{s}gorin  proved the second  part of his theorem by considering the matrix $A(t)=A_0+t(A-A_0)$, $t\in [0, 1]$, and letting $t$ increase continuously  from 0 to 1. Intuitively,
the concentric Ger\v{s}gorin disks of $A(t)$ centered at
$a_{ii}$ ($i=1, \dots, n$)  get larger and larger  as $t$ increases from 0 to 1.
 He stated that
``Since the eigenvalues of the matrix depend continuously on its elements, it follows that $m$ eigenvalues must always lie in the disks ...".
Ger\v{s}gorin used   as a fact without justification that
{\em eigenvalues are continuous functions of the entries of matrices}.

Such a statement is often seen in the literature when it comes to the proof of the second part of the
Ger\v{s}gorin disk theorem.
For instance, here are a few widely-cited
and comprehensive  references.   In the first edition of Horn and Johnson's book
{\em Matrix Analysis} \cite{HJ185}, page~345, it asserts that ``the eigenvalues are continuous functions of the entries of $A$ (see Appendix D)...", in Rahman and  Schmeisser's
{\em Analytic Theory of Polynomials} \cite{Rahman02}, page~55,
it states that
\lq\lq The eigenvalues of $A(t)$ are continuous functions of
$t$ ...\rq\rq,
in Varga's  {\em Ger\v{s}gorin and His Circles} \cite{Var2004}, page~8,
it is written that
``the eigenvalues $\lambda_i(t)$ of $A(t)$ also vary continuously
with $t$
...",
and
in Wilkinson's   {\em The Algebraic Eigenvalue Problem} \cite{Wil1965},
page~72,
 it says that
``the eigenvalues all traverse continuous paths".

What does it really mean to say that eigenvalues  are continuous functions?
 Ger\v{s}gorin's  proof by continuity may lead one to imagine {continuous}
curves of the eigenvalues  evolving
on the complex plane,  or one may trace the curves continuously.
But that is not as easy as it sounds. First, ordering eigenvalues with a parameter
can be tricky and difficult; second,
the eigenvalue curves may merge
 and the algebraic multiplicities of eigenvalues can change as the parameter varies.

\begin{example}\label{example1}
{\rm
Let $A(t) = \left( {0 \atop t}{t\atop 0}\right )$, $t\in [-1, 1].$  Each  $t$
produces a set of two eigenvalues.
How does one order the eigenvalues as functions of $t$? It is natural to order the eigenvalues of $A(t)$ as $\lambda_1(t)=t$, $\lambda_2(t)=-t$.
Notice that $A(t)$ is real symmetric. For real symmetric (or complex Hermitian) matrices, we usually want  the eigenvalues to be in a non-increasing (or non-decreasing) order. So we would order the
eigenvalues as $\mu_1(t)=|t|\geq  \mu_2(t)=-|t|$. (Unlike $\lambda_1(t)$ and $\lambda_2(t)$, $\mu_1(t)$ and $\mu_2(t)$ are not differentiable.  Of course, there are
infinitely many  ways to parameterize the eigenvalues as non-continuous functions.)}
\end{example}\label{example0}

The eigenvalues in Example~\ref{example0}  are parameterized as continuous functions of $t$.
Is this always possible?
The answer is {\em yes} for $t$ on a real interval (but why? see Theorem \ref{thm1})
and {\em no} for $t$ on a complex domain containing the origin (see Example~\ref{example1}).

  Ger\v{s}gorin's original proof   by continuity is  more like  \lq\lq hand-waving" than a rigorous  proof and it
 has led to some confusion or ambiguity
\cite{Farenick2005}. A rigorous proof of the theorem using eigenvalues as continuous functions  requires creating or referencing some heavy machinery that was absent from all the classical sources. This issue deserves attention and clarification for both teaching and research.

Additionally, matrices depending on a parameter play   important roles in  scientific areas.
In some studies  such as stability problems and adiabatic quantum computing, one may consider a real parameter $t$  joining matrix $A$ and matrix  $B$ by $(1-t)A+tB$  and analyze the change of the eigenvalues
as $t$ varies.

In section 2, we briefly recap the eigenvalue continuity in the topological sense. In section 3, we summarize a celebrated result of Kato on the continuity of eigenvalues as functions. In section 4, we discuss the existing proofs of
the Ger\v{s}gorin disk theorem and present a proof with topological continuity and a proof with functional continuity. We  end the paper
by including  a short and neat proof of the second part of the Ger\v{s}gorin disk theorem by using   the argument principle.

\section{Topological continuity of eigenvalues}

Are eigenvalues of a matrix continuous functions of the matrix?
Since eigenvalue problems of matrices  are essentially  root problems of (characteristic) polynomials, one
immediately realizes that the question is a bit subtle and needs careful formulation.
It is  known that the roots of a polynomial vary continuously as {\em a function} of the coefficients. In \cite{Har_AMSP_1987}, the authors gave a nice proof for the
result concerning the continuity of  zeros of complex polynomials.
In fact, the map sending a monic polynomial
$f(z) = z^n + a_1z^{n-1} + \cdots + a_n$
to the multi-set of its zeros
$\pi(f) = \{\lambda_1, \dots, \lambda_n\}$
is continuous in the following   sense.
For   monic polynomials
$f(z) = z^n + a_1 z^{n-1} + \cdots + a_n$
and $\tilde f(z) = z^n + \tilde a_1 z^{n-1} + \cdots + \tilde a_n$
with multi-sets of zeros
$\pi(f) = \{\lambda_1, \dots, \lambda_n\}$ and
$\pi (\tilde f) = \{\tilde \lambda_1, \dots, \tilde \lambda_n\}$,
 one can  use  the metrics
$$\|f-\tilde f\| = \max\{|a_j-\tilde a_{j}|: 1 \le j \le n\}$$
and
{\small $$d(\pi (f), \pi (\tilde f)) =
\min_{J}
\left\{ \max_{1 \le j \le n}  |\lambda_j - \tilde \lambda_{j_\ell}|:
J=(j_1, \dots, j_n)
\hbox{ is a permutation of } (1, \dots, n)\right\}.$$}
Then $\pi$ is (pointwise) continuous; that is, for fixed $f$ and
for any given  $\varepsilon>0$, there exists  $\delta>0$ (depending on $f$)  such that
$\|f-\tilde f\| <\delta$ implies $d(\pi(f), \pi(\tilde f))<\varepsilon$.
Moreover, if $\xi$ is a zero of $f(z)$ with algebraic multiplicity $m$, then
$\tilde f$ has exactly $m$ zeros
in the disk centered at $\xi$ with radius $\varepsilon$.

If we identity $f$ with $n$-tuple $(a_1, \dots, a_{n})\in {\mathbb C}^n$,
then $\pi$ is a homeomorphism between ${\mathbb C}^n$ (with the usual topology) and the quotient space  ${\mathbb C}^n_{\sim}$ (with the induced quotient topology),
the  unordered $n$-tuples (see \cite[p.\,153]{BhaMA97}) .

Applying this  result to matrices, one
gets the eigenvalue continuity  as
the eigenvalues of an $n\times n$ matrix $A$
 are the zeros of
the characteristic polynomial
$$p_A(z) = \det(zI - A) = z^n + a_1 z^{n-1} + \cdots + a_n,$$
where $a_j$ is $(-1)^j$ times the sum of the
$j\times j$ principal minors of $A$.

To be more specific, with $M_n$ for the space of $n\times n$ complex matrices,
we consider the eigenvalue function
$\sigma: M_n \rightarrow {\mathbb C}^n_{\sim}$ that maps a matrix $A\in M_n$ to its spectrum
$\sigma (A)\in {\mathbb C}^n_{\sim}$.
For the continuity of $\sigma$, we can use any (fixed) norm $\|\cdot\|$
on $M_n$.

The function $\sigma$ is continuous, i.e., for fixed $A\in M_n$ and for  any given $\varepsilon > 0$, there is
$\delta > 0$ (depending on $A$) such that
$d(\sigma(A), \sigma(\tilde A)) < \varepsilon$ whenever $\|A-\tilde A\| < \delta$.
Such an eigenvalue continuity
may be referred to as
{\em eigenvalue  topological  continuity} or {\em eigenvalue  matching continuity}.
Thus,  eigenvalues are always continuous in the topological sense.

  A nice proof regarding eigenvalue topological continuity for the discrete case (i.e., matrix sequences)  is available in \cite[pp.\,138--140]{Artin}.  The same continuity of eigenvalues is also studied
  in \cite[p.\,121]{HJ1_2nd}) by using Schur triangularization and compactness of the unitary group.
Closely related to eigenvalue continuity are
eigenvalue perturbation (variation) results with norm bounds
involving  the entries of matrices (see \cite{RCLiHandbookPert, Ost} and \cite[p.\,563, Appendix D]{HJ1_2nd}).

There is another possible way of thinking of the eigenvalue continuity problem. Let $A(t)$ be a family of $n\times n$ matrices depending continuously on a parameter $t$ over a domain in the complex plane or on a real interval. Then do there exist $n$ continuous complex functions of $t$  that   represent eigenvalues of $A(t)$?
We discuss the question in the next section.

\section{Parametrization of eigenvalues as continuous functions}

In some applications, one needs to consider a continuous
function $A: D \rightarrow M_n$, where $A(t) \in M_n$ and $D$ is a certain subset of
${\mathbb C}$ (say, a domain); and one wants to  parametrize the eigenvalues of $A(t)$ as
$n$ continuous functions $\lambda_1(t), \dots, \lambda_n(t)$ with $t \in D$.
We  refer to such continuity as {\em eigenvalue functional continuity} provided
there exist $n$ continuous functions of $t$  that represent eigenvalues of $A(t)$.

Eigenvalue functional continuity is widely used in
the proof of the second part of the Ger\v{s}gorin disk theorem;
similar ideas are needed in  the perturbation
theory of Hermitian matrices, stable matrices, etc.
However,
such a parametrization  is not always possible over a complex domain (\cite[p.\,154]{BhaMA97},
\cite[p.\,64;  p.\,108]{Kato95}).

\begin{example}\label{example1}
{\rm
 Let $A(t) = \left( {0 \atop t}{1\atop 0}\right )$, $t \in D = \{z\in {\mathbb C}: |z| < 1\}.$
It is impossible   to have two continuous functions
$\lambda_1(t), \lambda_2(t)$ on $D$ representing the
eigenvalues of $A(t)$. This is because each eigenvalue
$\lambda$ of $A(t)$ satisfies $\lambda^2 = t$; thus, the desired
continuous functions $\lambda_1(t)$ and $\lambda_2(t)$ have
to satisfy $(\lambda_1(t))^2 = (\lambda_2(t))^2 = t$ for all $t$ on the open unit disk,
which is impossible (as is known, there is no continuous function $f$ on a disk  $D$ containing  the origin  such that $(f(z))^2=z$ for all $z\in D$).

However,
as $t\rightarrow 0$, $A(t)$ approaches $A(0)=\left( {0 \atop 0}{1\atop 0}\right )$
(entrywise),  which has repeated eigenvalue 0. Any small disk that contains the origin will contain two eigenvalues of  $A(t)$ when $t$ is close enough to $0$.
(This is what   topological continuity means.)}
\end{example}

 The difference between   topological continuity  and  functional continuity is that the eigenvalues (as a whole) are always topologically continuous but need not be continuous
  as individual functions.
 The two continuities for $A(t)$ are equivalent
  when the parameter  $t$  belongs to a real interval.
     This is well explained in \cite{BhaMA97, Kato95}.

In \cite[p.\,109, Theorem 5.2]{Kato95}, the following remarkable result is shown.

\begin{theorem}[Kato, 1966] \label{thm1} Suppose  that $D \subset {\mathbb C}$ is a connected domain
and that $A: D \rightarrow M_n$ is a continuous function.
If   {\rm (1)}  $D$ is a  real interval, or  {\rm (2)}
$A(t)$   has only real eigenvalues, then there exist  $n$ eigenvalues $($counted with
algebraic multiplicities$)$ of $A(t)$ that
can be parameterized as continuous functions $\lambda_1(t),$ $ \dots,$ $ \lambda_n(t)$
from $D$ to $\Bbb C$.
In the second case, one can set
$\lambda_1(t) \ge \cdots \ge \lambda_n(t)$.
\end{theorem}

The study of eigenvalue functional continuity can be traced back at least as early as 1954
\cite{Rellich54}.
Rellich \cite[p.\,39]{Rellich69} showed that individual eigenvalues are continuous functions when the matrices are Hermitian (in such case all eigenvalues are necessarily real). In his well-received book,
 Kato \cite[p.\,109]{Kato95}
 showed   that
 topological continuity   implies  functional continuity  when the parameter is restricted to a real interval or if all the eigenvalues of the matrices  are real, i.e., Theorem~\ref{thm1}.

It is tempting to extend Kato's result on a real interval for the parameter  to a domain (with
interior points) on the complex plane.  However, this is impossible.
Let $z_0\not = 0$ and let $D_{z_0}$ be an open disk centered at $z_0$ that does not contain the origin. Considering $A(z) = \left (
{0 \atop z-z_0} {\;1 \atop \;0} \right )$,
 $z\in D_{z_0}$,  we see that  there does not exist a continuous  eigenvalue function
of $A(z)$  on $D_{z_0}$.
Suppose, otherwise,  there is a  continuous eigenvalue function $\lambda(z)$ on  $D_{z_0}$, then
$(\lambda(z))^2 = z-z_0$ for all $z\in D_{z_0}$. This leads to a continuous function
$f(z) = \lambda(z+z_0)$ defined on the open unit disk $D=\{z\in {\mathbb C} : |z|<1\}$  such that $(f(z))^2 = z$
for all $z\in D$, a contradiction.

So, in a sense,  the result of Kato is the best possible with respect to eigenvalue functional continuity.

\section{Proofs of the Ger\v{s}gorin disk theorem}

Ger\v{s}gorin's  disk theorem
is a useful result for estimating  and  localizing  the eigenvalues of a matrix. Usually and traditionally, the second part of the theorem is proved by considering the matrix $A(t)=A_0+t(A-A_0)$ (where $A_0$ is the diagonal matrix that has the same main diagonal as  $A$)  and by using eigenvalue continuity (see
\cite{Bru1994},  \cite[p.\,23]{HoodThesis17}, \cite[p.\,345]{HJ185}, \cite[p.\,74]{Hou1964}, \cite[p.\,372]{Lan1985},
\cite[p.\,499]{Meyer2000}, \cite[p.\,55]{Rahman02}, \cite[p.\,169]{SS1990},
   \cite[p.\,8]{Var2004},   \cite[p.\,72]{Wil1965}), and \cite[p.\,70]{ZFZbook11}).
   However, in these references, it is not always clear
    which types of  eigenvalue continuity conditions
    were used. If it is topological continuity,
    then one needs to add some details in the proofs to justify why the total number of eigenvalues in an isolated  region remains the same when $t$ increases from 0 to 1 (note that the algebraic multiplicity of an eigenvalue may change); if
    it is functional continuity (which is the case in most texts), then it would
    be nice to state Kato's result (or other references) as evidence of
    the existence of continuous functions that represent the eigenvalues.
 In the following, we
 state the Ger\v{s}gorin disk theorem and give two different proofs. One
 (Proposition~5) uses eigenvalue functional continuity (Kato's theorem) and exploits the fact that a continuous function takes a connected set into a connected set; the other (Proposition~6)
uses eigenvalue topological  continuity and exploits the fact that a continuous
function on a compact set is {\em uniformly continuous}.
In the latter, we completely avoid the continuity of each
eigenvalue as a function.

\begin{theorem}[Ger\v{s}gorin \cite{Ger31}, 1931]\label{GDT}
  Let $A = (a_{ij}) \in M_n$ and define the disks
$$D_i = \big \{ z \in {\mathbb C}: |z-a_{ii}| \le \sum_{j\ne i} |a_{ij}|\big  \}, \quad i = 1, \dots, n.$$
Then \,
 {\rm (1)} All eigenvalues of $A$ are contained in the union $\cup_{i=1}^n D_i$.
{\rm (2)}  If $\cup_{i=1}^n D_i$ is the union of
$k$ disjoint connected regions $R_1, \dots, R_k$,
and $R_r$ is the union of $m_r$ of the disks $D_1, \dots, D_n$, then
$R_r$  contains exactly $m_r$ eigenvalues of $A$, $r = 1, \dots, k$.
\end{theorem}

Part (1) says that every eigenvalue of $A$ is contained in a Ger\v{s}gorin disk.
Its proof is easy,  standard, and  omitted here.
Part (2)  is immediate from Propositions \ref{Prop5} and \ref{Prop6}.
We call a union of some Ger\v{s}gorin disks a {\em Ger\v{s}gorin region}
(which in general need not be connected). In particular, the singletons of  diagonal entries are
degenerate  Ger\v{s}gorin regions. By a {\em curve} we mean the image (range) of
a continuous map from a real closed interval to the complex plane $\gamma:  [a, b] \mapsto {\mathbb C}$.

\begin{proposition}\label{Prop5}
Let $A = (a_{ij}) \in M_n$ and  let $A(t)=A_0 + t(A-A_0)$,
where $t \in [0,1]$ and
$A_0 = {\rm diag}\,(a_{11}, \dots, a_{nn})$. Then each  continuous eigenvalue
curve of
$A(t)$ lies entirely in a connected Ger\v{s}gorin region of $A$.
\end{proposition}
\proof
By Kato's result (Theorem \ref{thm1}),  there exists a selection of
$n$  eigenvalues $\lambda_1(t), \dots, \lambda_n(t)$ of $A(t)$ that are continuous functions in $t$ on the real interval $[0, 1]$. Moreover,   part  (1) of the Ger\v{s}gorin disk theorem ensures that
  $\lambda_1(t), \dots, $ $\lambda_n(t)$ are contained
  in $\cup_{i=1}^k R_i$ for every $t\in [0, 1]$, and each set $\lambda_j([0, 1])$ is connected.

Let $r\in \{1, \dots, k\}$. Since  $R_r$ comprises $m_r$ disks (not necessarily different)  whose centers are $m_r$ elements of
the diagonal matrix $A_0$,  $m_r$ of the continuous eigenvalue curves $\lambda_1(t), \dots, \lambda_n(t)$ are  in $R_r$ at $t=0$. If $\lambda_j(0)\in R_r$, then
the connected set $$\lambda_j([0, 1])= \lambda_j([0, 1])\cap
\cup_{i=1}^k R_i = (\lambda_j([0, 1])\cap R_r) \cup(\lambda_j([0, 1])\cap    \cup_{i\not = r}^k R_i)$$
is the union of two disjoint closed sets, the first of which is nonempty. Therefore, the second set is empty and hence $\lambda_j([0, 1])\subset  R_r$.
\qed

The following proposition  considers the eigenvalues as a whole in a Ger\v{s}gorin region rather than focusing on an individual eigenvalue as a function. That is, we use eigenvalue topological continuity and avoid entirely (the difficult issue of) eigenvalue functional  continuity (which is not needed) to prove the assertion.

\begin{proposition}\label{Prop6}
Let $A = (a_{ij}) \in M_n$ and let $A(t)=A_0 + t(A-A_0)$, where $t \in [0,1]$ and
$A_0 = {\rm diag}\,(a_{11}, \dots, a_{nn})$. Then  a connected Ger\v{s}gorin region of $A$ contains the same number of eigenvalues of $A(t)$ for all  $t\in [0, 1]$.
\end{proposition}

 \proof
 Every entry of $ A(t)$ is a continuous function of $t \in [0,1]$ and
  each Ger\v{s}gorin disk of $A(t)$  ($0\leq t \leq 1$) is contained in a Ger\v{s}gorin disk of $A=A(1)$ with the same corresponding center.  Let $R_r$, $r=1, \dots, k$,  be the connected Ger\v{s}gorin regions
 of $A$. (The number of connected Ger\v{s}gorin regions  for $A(t)$ may vary depending on $t$.)
Suppose that $R_r$ contains $m_r$ diagonal entries of $A$, i.e., $m_r$ eigenvalues of
$A_0=A(0)$ (counted with algebraic multiplicities). We claim that $R_r$ contains $m_r$ eigenvalues of $A(t)$ for all
$t\in [0, 1]$ (that is, the sum of the algebraic multiplicities of the eigenvalues
of $A(t)$ remains constant on each connected Ger\v{s}gorin region of $A$  as $t$ varies from 0 to 1).

Since the eigenvalues are topologically continuous over the compact set $[0, 1]$,
the continuity is uniform. To be precise,
 the map $\varphi: [0, 1]\mapsto {\mathbb C}^n_{\sim}$ defined by $\varphi (t)=\sigma (A(t))$
 is uniformly continuous.

Let $\varepsilon > 0$ be such that $|x-y| > 2 \varepsilon$ for all
$x, y$ lying in any two disjoint Ger\v{s}gorin regions of $A$.  There is $\delta > 0$ (depending only on $\varepsilon $) such that
for any $t_1$ and $t_2$ satisfying  $0 \le t_1<t_2  \le 1$ and $t_2-t_1 < \delta$, the eigenvalues of
$A(t_1)$ and $A(t_2)$ can be labeled as
$\lambda_1,\dots, \lambda_n$ and $\mu_1, \dots, \mu_n$ such that
$|\lambda_j - \mu_j| < \varepsilon$ for  $j=1, \dots, n$.

We divide the interval $[0, 1]$ into $N$ subintervals:
 $0 = t_0 < t_1 < \cdots < t_N = 1$
such that $t_{i}-t_{i-1} < \delta$ for $i = 1, \dots, N$.
We  show   that  on each of the intervals
  $A(t)$ has $m_r$
eigenvalues in $R_r$ for $t\in [t_{i}, t_{i+1}]$, $i=0, 1, \dots, N-1$.

By assumption, $A(t_0)=A_0=A(0)$ has exactly $m_r$ eigenvalues in $R_r$.
For any $t\in [t_0, t_1]$, since   $t-t_0<\delta$,  $A(t)$   has exactly $m_r$ eigenvalues each of which is located in some disk centered at an eigenvalue of $A(t_0)$ with radius $\varepsilon$. By our choice of $\varepsilon$, all the $m_r$ eigenvalues of $A(t)$ are contained in
$R_r$ (i.e., not in other regions) for all $t\in [t_0, t_1]$.

Because $t_2-t_1<\delta$, for any  $t\in [t_1, t_2]$, $A(t)$ has exactly  $m_r$ eigenvalues that are close (with respect to $\varepsilon$)
to the $m_r$ eigenvalues of $A(t_1)$ in $R_r$.
Again, by our choice of  $\varepsilon$, all these
$m_r$ eigenvalues of $A(t)$ are also contained in $R_r$
for all $t\in [t_1, t_2]$.

Repeating the arguments for
$[t_2, t_3],$ $ \dots, $ $ [t_{N-1}, t_N]$,
we see that $A(t)$ has exactly  $m_r$ eigenvalues
in $R_r$ for each $t\in [0, 1]$. Thus,
$A(t_N)=A(1)=A$ has
exactly $m_r$ eigenvalues in the region $R_r$.   \qed

\section{A proof of Ger\v{s}gorin theorem  using the argument principle}\label{ComplexAnalysis}
The Ger\v{s}gorin  disk theorem is a statement about counting eigenvalues according to their algebraic multiplicities;
 it is essentially about counting zeros of a polynomial that depends on a parameter.
Thus,   Rouch\'{e}'s theorem would be a much  more natural and effective tool since it focuses squarely on what the theorem says about numbers of eigenvalues.
This approach does  not require the parameter $t$ to be real and it does not need the concept of any eigenvalue  continuity, functional or topological.

There is a short and neat proof of the second part of the Ger\v{s}gorin disk theorem that uses    the argument principle.  This approach was adopted in the second edition of Horn and Johnson's book {\em Matrix Analysis}
\cite[p.\,389]{HJ1_2nd}
 (see   also \cite[p.\,103]{Ser10}), while the proof by continuity used in the first edition \cite[p.\,345]{HJ185} was abandoned.

Let $\Gamma$ be a simple contour in the complex plane that surrounds the Ger\v{s}gorin region to be considered.
Let $p_{t}(z)$ be the characteristic polynomial of $A(t)$ for each given $t\in [0, 1]$.  By  the argument principle
\cite[p.\,123]{JBC78},
the number of zeros (counted with algebraic multiplicities)  of $p_{t}(z)$ inside $\Gamma$ is
$$m(t)=\frac{1}{2\pi i}
\oint_{\Gamma} \frac{p_{t}'(z)}{p_{t}(z)}dz.$$
On the other hand,
$f(t, z):=\frac{p_{t}'(z)}{p_{t}(z)}$
is a continuous function from $[0, 1]\times \Gamma $ to $\Bbb C$. By Leibniz's rule
\cite[p.\,68]{JBC78}, $m(t)$ is a continuous function on $[0, 1]$. As $m(t)$ is an integer, it has to be a constant. Thus,
$m(0)=m(1)$, which is the number of eigenvalues of $A$ in the Ger\v{s}gorin region.

Similar ideas
  using Rouch\'{e}'s theorem or winding numbers have been employed in the study of localization for
  nonlinear eigenvalue problems \cite{BinH13, BinH15, HoodThesis17}.
Eigenvalues as  functions deserve study and it is
an interesting (and classical) problem.  There is  a well-developed theory on the
smoothness of roots of polynomials
(see  \cite{AKLM98},
\cite[Chap.\,II, \S 4]{Kato95}, \cite{KLM04}, and
\cite{LR07}).
\bigskip

\noindent
{\bf Acknowledgment.}
This work was initiated by a talk given by the second author at the
International Conference on Matrix Theory with Applications
- Joint meeting of \lq\lq International Research Center for Tensor and Matrix Theory (IRCTM)", Shanghai University, China,
and  \lq\lq Applied Algebra and Optimization Research Center (AORC)",  Sungkyunkwan University, South Korea, at the
Shanghai University, December 17-20, 2018. Both authors thank the Centers for hospitality during the meeting and  thank
Roger Horn for  helpful discussions.


Certain Integrals Arising from Ramanujan's Notebooks

Abstract: In his third notebook, Ramanujan claims that $$ \int_0^\infty \frac{\cos(nx)}{x^2+1} \log x \,\mathrm{d} x + \frac{\pi}{2} \int_0^\infty \frac{\sin(nx)}{x^2+1} \mathrm{d} x = 0. $$ In a following cryptic line, which only became visible in a recent reproduction of Ramanujan's notebooks, Ramanujan indicates that a similar relation exists if $\log x$ were replaced by $\log^2x$ in the first integral and $\log x$ were inserted in the integrand of the second integral. One of the goals of the present paper is to prove this claim by contour integration. We further establish general theorems similarly relating large classes of infinite integrals and illustrate these by several examples.

\section{Introduction}

If you attempt to f\/ind the values of the integrals
\begin{gather}\label{1}
\int_0^{\infty}\frac{\cos(nx)}{x^2+1}\log x \,\mathrm{d} x \qquad\text{and}\qquad\int_0^{\infty}\frac{\sin(nx)}{x^2+1}\mathrm{d} x, \qquad n>0,
\end{gather}
by consulting tables such as those of Gradshteyn and Ryzhik \cite{gr} or by
invoking a computer algebra system such as \emph{Mathematica}, you will be
disappointed, if you hoped to evaluate these integrals in closed form, that
is, in terms of elementary functions.  On the other hand, the latter integral
above can be expressed in terms of the exponential integral $\operatorname{Ei}(x)$~\cite[formula~(3.723), no.~1]{gr}.
Similarly, if $1/(x^2+1)$ is replaced by any even rational function with the
degree of the denominator at least one greater than the degree of the
numerator, it does not seem possible to evaluate any such integral in closed
form.

However, in his third notebook, on p.~391 in the pagination of the second
volume of \cite{nb}, Ramanujan claims that the two integrals in \eqref{1} are
simple multiples of each other.  More precisely,
\begin{gather}\label{2}
\int_0^{\infty}\frac{\cos(nx)}{x^2+1}\log x \,
\mathrm{d} x +\frac{\pi}{2}\int_0^{\infty}\frac{\sin(nx)}{x^2+1}\mathrm{d} x =0.
\end{gather}
Moreover, to the left of this entry, Ramanujan writes, ``contour
integration''.  We now might recall a couple of sentences of G.H.~Hardy from
the introduction to Ramanujan's \emph{Collected papers} \cite[p.~xxx]{cp},
``\dots\ he had [before arriving in England] never heard of \dots\ Cauchy's
theorem, and had indeed but the vaguest idea of what a function of a complex
variable was''.  On the following page, Hardy further wrote, ``In a few
years' time he had a very tolerable knowledge of the theory of functions
\dots''.  Generally, the entries in Ramanujan's notebooks were recorded by
him in approximately the years 1904--1914, prior to his departure for
England.  However, there is evidence that some of the entries in his third
notebook were recorded while he was in England.  Indeed, in view of Hardy's
remarks above, almost certainly, \eqref{2}~is such an entry.  A~proof of~\eqref{2} by contour integration was given by the f\/irst author in his book
\cite[pp.~329--330]{IV}.

The identity \eqref{2} is interesting because it relates in a simple way two
integrals that we are unable to individually evaluate in closed form.
On the other hand, the simpler integrals
\begin{gather*
\int_0^{\infty}\frac{\cos(nx)}{x^2+1}
\mathrm{d} x=\frac{\pi e^{-n}}{2} \qquad\text{and}\qquad \int_{-\infty}^{\infty}\frac{\sin(nx)}{x^2+1}\mathrm{d} x =0
\end{gather*}
have well-known and trivial evaluations, respectively.

 With the use of the most up-to-date photographic techniques, a new edition
 of \emph{Ramanujan's Notebooks}~\cite{nb} was published in~2012 to help
 celebrate the 125th anniversary of Ramanujan's birth.  The new reproduction
 is vastly clearer and easier to read than the original edition.  When the
 f\/irst author reexamined~\eqref{2} in the  new edition, he was surprised to
 see that Ramanujan made a further claim concerning~\eqref{2} that was not
 visible in the original edition of~\cite{nb}.  In a~cryptic one line, he
 indicated that a relation similar to~\eqref{2} existed if $\log x$ were
 replaced by $\log^2x$ in the f\/irst integral and $\log x$ were inserted in the
 integrand of the second integral of~\eqref{2}.  One of the goals of the
 present paper is to prove (by contour integration) this unintelligible entry
 in the f\/irst edition of the notebooks~\cite{nb}.   Secondly, we establish
 general theorems relating large classes of inf\/inite integrals for which
 individual evaluations in closed form are not possible by presently known
 methods.  Several further examples are given.

\section{Ramanujan's extension of~(\ref{2})}

We prove the entry on p.~391 of \cite{nb} that resurfaced with the new printing of~\cite{nb}.

\begin{Theorem}\label{theorem1} We have
\begin{gather}\label{4}
\int_0^{\infty}\frac{\sin(nx)}{x^2+1}\mathrm{d} x +\frac{2}{\pi}\int_0^{\infty}\frac{\cos(nx)}{x^2+1}\log x\,\mathrm{d} x =0
\end{gather}
and
\begin{gather}\label{4a}
\int_0^{\infty}\frac{\sin(nx)\log x}{x^2+1}\mathrm{d} x+\frac{1}{\pi}\int_0^{\infty}\frac{\cos(nx)\log^2x}{x^2+1}\mathrm{d} x=\frac{\pi^2e^{-n}}{8}.
\end{gather}
\end{Theorem}

\begin{proof}  Def\/ine a branch of $\log z$ by $-\frac12\pi<\theta=\arg z\leq
  \frac32\pi$.  We integrate
\begin{gather*}
f(z):=\frac{e^{inz}\log^2z}{z^2+1}
\end{gather*}
over the positively oriented closed contour $C_{R,\varepsilon}$  consisting
of the semi-circle $C_{R}$ given by \linebreak \mbox{$z=Re^{i\theta}$},
$0\leq\theta\leq\pi$,
the interval $[-R,-\varepsilon]$, the semi-circle $C_{\varepsilon}$ given by
$z=\varepsilon e^{i\theta}$, $\pi\geq\theta\geq0$, and the interval $[\varepsilon,R]$,
where $0<\varepsilon<1$ and $R>1$. On the interior of  $C_{R,\varepsilon}$
there is a simple pole at~$z=i$, and so by the residue theorem,
\begin{gather}\label{5}
\int_{C_{R,\varepsilon}}f(z)\mathrm{d} z=2\pi i\frac{e^{-n} \cdot\big({-}\frac14\pi^2\big)}{2i}=-\frac{e^{-n}\pi^3}{4}.
\end{gather}
Parameterizing the respective semi-circles, we can readily show that
\begin{gather}\label{6}
\int_{C_{\varepsilon}}f(z)\mathrm{d} z=o(1),
\end{gather}
as $\varepsilon\to0$, and
\begin{gather}\label{7}
\int_{C_{R}}f(z)\mathrm{d} z=o(1),
\end{gather}
as $R\to\infty$.
Hence, letting $\varepsilon\to0$ and $R\to\infty$ and combining \eqref{5}--\eqref{7}, we conclude that
 \begin{gather}\label{8}
 - \frac{e^{-n}\pi^3}{4}=\int_{-\infty}^0\frac{e^{inx}(\log|x|+i\pi)^2}{x^2+1}\mathrm{d} x+\int_0^{\infty}\frac{e^{inx}\log^2x}{x^2+1}\mathrm{d} x\\
 \hphantom{- \frac{e^{-n}\pi^3}{4}}{}
 =\int_0^{\infty}\!\frac{(\cos(nx)-i\sin(n x))(\log x+i\pi)^2}{x^2+1}\mathrm{d} x+\int_0^{\infty}\!\frac{(\cos(nx)+i\sin(nx))\log^2x}{x^2+1}\mathrm{d} x.\nonumber
 \end{gather}
If we equate real parts in \eqref{8}, we f\/ind that
\begin{gather}\label{boo}
-\frac{e^{-n}\pi^3}{4} =\int_0^{\infty}\frac{\cos(nx)\big(2\log^2x-\pi^2\big)+2\pi\sin(nx)\log x}{x^2+1}\mathrm{d} x.
\end{gather}
It is easy to show, e.g., by contour integration, that
\begin{gather}\label{easy}
\int_0^{\infty}\frac{\cos(nx)}{x^2+1}\mathrm{d} x=\frac{\pi e^{-n}}{2}.
\end{gather}
(In his quarterly reports, Ramanujan derived~\eqref{easy} by a~dif\/ferent method \cite[p.~322]{I}.)
Putting this evaluation in~\eqref{boo}, we readily deduce~\eqref{4a}.
If we equate imaginary parts in~\eqref{8}, we deduce that
\begin{gather*}
0=\int_0^{\infty}\frac{\pi^2\sin(nx)+2\pi\cos(nx)\log x}{x^2+1}\mathrm{d} x,
\end{gather*}
from which the identity \eqref{4} follows.
\end{proof}

\section{A second approach to the entry at the top of p.~391}

\begin{Theorem} \label{thm:int:s}
For $s \in (- 1, 2)$ and $n \geq 0$,
  \begin{gather}
    \frac{\pi}{2} e^{- n} = \int_0^{\infty} \frac{\cos (n x - \pi s / 2)}{x^2
    + 1} x^s \mathrm{d} x. \label{eq:int:s}
  \end{gather}
\end{Theorem}

Before indicating a proof of Theorem~\ref{thm:int:s}, let us see how the
integral~\eqref{eq:int:s} implies Ramanujan's integral relations~\eqref{4} and~\eqref{4a}. Essentially,
all we have to do is to take derivatives of \eqref{eq:int:s} with respect to~$s$ (and interchange the order of dif\/ferentiation and integration); then, upon
setting $s = 0$, we deduce~\eqref{4} and~\eqref{4a}.

First, note that upon setting $s = 0$ in \eqref{eq:int:s}, we obtain  \eqref{easy}.
On the other hand, taking a~derivative of~\eqref{eq:int:s} with respect to
$s$, and then setting $s = 0$, we f\/ind that
\begin{gather}
  0 = \int_0^{\infty} \frac{\cos (n x)}{x^2 + 1} \log x \,\mathrm{d} x +
  \frac{\pi}{2} \int_0^{\infty} \frac{\sin (n x)}{x^2 + 1} \mathrm{d} x,
  \label{eq:int:rama}
\end{gather}
which is the formula~\eqref{4} that Ramanujan recorded on p.~391. Similarly, taking
two derivatives of~\eqref{eq:int:s} and then putting $s=0$, we arrive at
\begin{gather*}
  0 = \int_0^{\infty} \frac{\cos (n x)}{x^2 + 1} \log^2 x\, \mathrm{d} x + \pi
   \int_0^{\infty} \frac{\sin (n x)}{x^2 + 1} \log x \,\mathrm{d} x -
   \frac{\pi^2}{4} \int_0^{\infty} \frac{\cos (n x)}{x^2 + 1} \mathrm{d} x,
\end{gather*}
which, using \eqref{easy}, simplif\/ies to
\begin{gather}\label{eq:int:rama2}
  \frac{\pi^3}{8} e^{- n} = \int_0^{\infty} \frac{\cos (n x)}{x^2 + 1} \log^2
   x \,\mathrm{d} x + \pi \int_0^{\infty} \frac{\sin (n x)}{x^2 + 1} \log x\,
   \mathrm{d} x.
\end{gather}
Note that this is  Ramanujan's previously unintelligible formula~\eqref{4a}. If we
likewise take $m$ derivatives before setting $s = 0$, we obtain the following
general set of relations connecting the integrals
\begin{gather*}
  I_m := \int_0^{\infty} \frac{\cos (n x)}{x^2 + 1} \log^m x \,\mathrm{d} x,
   \qquad J_m := \int_0^{\infty} \frac{\sin (n x)}{x^2 + 1} \log^m  x
   \,\mathrm{d} x.
\end{gather*}

\begin{Corollary}
  For $m \geq 1$,
  \begin{gather*}
    0 = \sum_{k = 0}^m \binom{m}{k} \left( \frac{\pi}{2} \right)^k (- 1)^{[k
     / 2]} \left\{ \begin{matrix}
       I_{m - k}, & \text{if $k$ is even}\\
       J_{m - k}, & \text{if $k$ is odd}
     \end{matrix} \right\} .
  \end{gather*}
\end{Corollary}

We now provide a proof of Theorem \ref{thm:int:s}.

\begin{proof}
  In analogy with our previous proof, we integrate
  \begin{gather*}
    f_s (z) := \frac{e^{i n z} z^s}{z^2 + 1}
  \end{gather*}
  over the contour $C_{R, \varepsilon}$ and let $\varepsilon \rightarrow 0$ and
  $R \rightarrow \infty$. Here, $z^s = e^{s \log z}$ with $-\frac12\pi<\arg z \leq \frac32\pi$, as above. By the residue theorem,
  \begin{gather}\label{aa}
    \int_{C_{R, \varepsilon}} f_s (z) \mathrm{d} z = 2 \pi i \frac{e^{- n} e^{\pi
     i s / 2}}{2 i} = \pi e^{- n} e^{\pi i s / 2} .
  \end{gather}
 Letting  $\varepsilon \rightarrow 0$ and $R \rightarrow \infty$, and using
 bounds for the integrand on the semi-circles as we did above, we deduce that
  \begin{gather}\label{bb}
    \lim_{\substack{R\to\infty\\\varepsilon\to0}}\int_{C_{R, \varepsilon}} f_s (z) \mathrm{d} z = \int_{- \infty}^{\infty}
     \frac{e^{i n x} x^s}{x^2 + 1} \mathrm{d} x = \int_0^{\infty} \frac{e^{- i n
     x} x^s e^{\pi i s}}{x^2 + 1} \mathrm{d} x + \int_0^{\infty} \frac{e^{i n x}
     x^s}{x^2 + 1} \mathrm{d} x.
  \end{gather}
  Combining \eqref{aa} and \eqref{bb}, we f\/ind that
  \begin{gather}
    \pi e^{- n} e^{\pi i s / 2} = \int_0^{\infty} \big(e^{i n x} + e^{- i n x} e^{\pi i s}\big)
    \frac{x^s }{x^2 + 1} \mathrm{d} x.\label{eq:int:s:i}
  \end{gather}
  We then divide both sides of \eqref{eq:int:s:i} by $2e^{\pi i s / 2}$ to
  obtain \eqref{eq:int:s}.
  Note that the integrals are absolutely convergent for $s \in ( - 1, 1)$.
  By Dirichlet's test, \eqref{eq:int:s:i} holds for
  $s \in ( - 1, 2)$.
\end{proof}

Replacing $s$ with $s + 1$ in \eqref{eq:int:s}, we obtain the following
companion integral.

\begin{Corollary}
  For $s \in (- 2, 1)$ and $n \geq 0$,
  \begin{gather}
    \frac{\pi}{2} e^{- n} = \int_0^{\infty} \frac{x \sin (n x - \pi s /
    2)}{x^2 + 1} x^s \mathrm{d} x. \label{eq:int:s:sin}
  \end{gather}
\end{Corollary}

\begin{Example}
  Setting $s = 0$ in \eqref{eq:int:s:sin}, we f\/ind that
  \begin{gather}
    \frac{\pi}{2} e^{- n} = \int_0^{\infty} \frac{x \sin (n x)}{x^2 + 1}
    \mathrm{d} x, \label{eq:int:sin}
  \end{gather}
which is well known.  After taking one derivative with respect to $s$ in
\eqref{eq:int:s:sin}
and setting $s=0$, we similarly f\/ind that
  \begin{gather}\label{dd}
    0 = \int_0^{\infty} \frac{x \sin (n x)}{x^2 + 1} \log x\, \mathrm{d} x -
     \frac{\pi}{2} \int_0^{\infty} \frac{x \cos (n x)}{x^2 + 1} \mathrm{d} x,
  \end{gather}
  which may be compared with Ramanujan's formula \eqref{4}. As a
  second example, after taking two derivatives of \eqref{eq:int:s:sin} with
  respect to $s$, setting $s=0$, and using
  \eqref{eq:int:sin}, we arrive at the identity
  \begin{gather}\label{cc}
    \frac{\pi^3}{8} e^{- n} = \int_0^{\infty} \frac{x \sin (n x)}{x^2 + 1}
     \log^2 x\, \mathrm{d} x - \pi \int_0^{\infty} \frac{x \cos (n x)}{x^2 + 1}
     \log  x \,\mathrm{d} x.
  \end{gather}
\end{Example}

  We of\/fer a few additional remarks before generalizing our ideas in the
  next section.  Equating real
  parts in the identity~\eqref{eq:int:s:i} from the proof of
  Theorem~\ref{thm:int:s}, we f\/ind that
  \begin{gather}
    \pi e^{- n} \cos (\pi s / 2) = \int_0^{\infty} \big( \cos (n x) (1 + \cos (\pi
    s)) + \sin (n x) \sin (\pi s)\big) \frac{x^s }{x^2 + 1}\mathrm{d} x.
    \label{eq:int:s:re}
  \end{gather}
  Setting $s = 0$ in \eqref{eq:int:s:re}, we again obtain  \eqref{easy}.
  On the other hand, note that
  \begin{gather*}
    \left[ \frac{\mathrm{d}}{\mathrm{d} s} \big( \cos (n x) (1 + \cos (\pi s)) + \sin (n
     x) \sin (\pi s)\big) \right]_{s = 0} = \pi \sin (n x) .
  \end{gather*}
  Hence, taking a derivative of \eqref{eq:int:s:re} with respect to $s$, and
  then setting $s = 0$, we f\/ind that
  \begin{gather*}
    0 = \pi \int_0^{\infty} \frac{\sin (n x)}{x^2 + 1} \mathrm{d} x + 2
     \int_0^{\infty} \frac{\cos (n x)}{x^2 + 1} \log x\, \mathrm{d} x,
  \end{gather*}
  which is the formula \eqref{4} that Ramanujan recorded on p.~391. Similarly, taking
  two derivatives of \eqref{eq:int:s:re} and letting $s=0$, we deduce that
  \begin{gather*}
    - \frac{\pi^3}{4} e^{- n} = - \pi^2 \int_0^{\infty} \frac{\cos (n x)}{x^2
     + 1} \mathrm{d} x + 2 \pi \int_0^{\infty} \frac{\sin (n x)}{x^2 + 1} \log x\,
     \mathrm{d} x + 2 \int_0^{\infty} \frac{\cos (n x)}{x^2 + 1} \log^2x\, \mathrm{d}
     x,
  \end{gather*}
  which, using \eqref{easy}, simplif\/ies to
  \begin{gather*}
    \frac{\pi^3}{8} e^{- n} = \pi \int_0^{\infty} \frac{\sin (n x)}{x^2 + 1}
     \log x \, \mathrm{d} x + \int_0^{\infty} \frac{\cos (n x)}{x^2 + 1} \log^2x\,
     \mathrm{d} x
  \end{gather*}
  which is the formula \eqref{4a} arising from Ramanujan's unintelligible remark in the initial edition of~\cite{nb}.

  The integral \eqref{eq:int:s:re} has the companion
  \begin{gather}
    \pi e^{- n} \sin (\pi s / 2) = \int_0^{\infty} \big( \cos (n x) \sin (\pi s) +
    \sin (n x) (1 - \cos (\pi s))\big) \frac{x^s }{x^2 + 1}\mathrm{d} x,
    \label{eq:int:s:im}
  \end{gather}
  which is obtained by equating imaginary parts in~\eqref{eq:int:s:i}.
  However, taking derivatives of~\eqref{eq:int:s:im} with respect to~$s$, and
  then setting $s = 0$, does not generate new identities. Instead, we recover
  precisely the previous results. For instance, taking a derivative of~\eqref{eq:int:s:im} with respect to~$s$, and then setting $s = 0$, we again
  deduce~\eqref{easy}.
  Taking two derivatives of~\eqref{eq:int:s:im} with
  respect to~$s$, and then setting $s = 0$, we obtain
  \begin{gather*}
    0 = \pi^2 \int_0^{\infty} \frac{\sin (n x)}{x^2 + 1} \mathrm{d} x + 2 \pi
     \int_0^{\infty} \frac{\cos (n x)}{x^2 + 1} \log x\, \mathrm{d} x,
  \end{gather*}
  which is again Ramanujan's formula~\eqref{4}.

\section{General theorems}

The phenomenon observed by Ramanujan in \eqref{2}
can be generalized by replacing the rational function $1/(z^2+1)$ by a
general rational function $f(z)$ in which the denominator has degree at least
one greater than the degree of the numerator.  We shall also assume that
$f(z)$ does not have any poles on the real axis.  We could prove a theorem
allowing for poles on the real axis, but in such instances we would need to
consider the principal values of the resulting integrals on the real axis.
In our arguments above, we used the fact that $1/(z^2+1)$ is an even
function.  For our general theorem, we require that $f(z)$ be either even or
odd.  For brevity, we let $\text{Res}(F(z);z_0)$ denote the residue of a~function~$F(z)$ at a pole~$z_0$.  As above, we def\/ine  a branch of~$\log z$
by $-\frac12\pi<\theta=\arg z\leq \frac32\pi$.

For a rational function $f(z)$ as prescribed above and each
nonnegative integer $m$, def\/ine
\begin{gather}\label{IJ}
I_m:=\int_0^{\infty}f(x) \cos x \log^mx\,\mathrm{d} x \qquad\text{and}\qquad J_m:=\int_0^{\infty}f(x) \sin x \log^mx\,
\mathrm{d} x.
\end{gather}

\begin{Theorem}\label{theorem2} Let $f(z)$ denote a rational function in $z$, as described above, and let $I_m$ and $J_m$ be defined by~\eqref{IJ}.  Let
\begin{gather}\label{S}
 S:=2\pi i\sum_U\textup{Res}(e^{iz}f(z)\log^mz,z_j),
\end{gather}
where the sum is over all poles $z_j$ of $e^{iz}f(z)\log^mz$ lying in the upper half-plane~$U$.  Suppose that~$f(z)$ is even.  Then
\begin{gather}\label{S1}
S=\sum_{k=0}^m\binom{m}{k}(i\pi)^{m-k}(I_k-iJ_k)+(I_m+iJ_m).
\end{gather}
Suppose that $f(z)$ is odd.  Then
\begin{gather}\label{S2}
S=-\sum_{k=0}^m\binom{m}{k}(i\pi)^{m-k}(I_k-iJ_k)+(I_m+iJ_m).
\end{gather}
\end{Theorem}

Observe that \eqref{S1} and \eqref{S2} are recurrence relations that enable
us to successively calculate~$I_m$ and~$J_m$.  With each succeeding value of~$m$, we see that two previously non-appearing integrals arise.  If~$f(z)$ is
even, then these integrals are $I_m$ and $J_{m-1}$, while if $f(z)$ is odd,
these integrals are $J_m$ and $I_{m-1}$.  The previously non-appearing
integrals appear in either the real part or the imaginary part of the
right-hand sides of~\eqref{S1} and~\eqref{S2}, but not both real and
imaginary parts.  This fact therefore does not enable us to explicitly
determine either of the two integrals.  We must be satisf\/ied with obtaining
recurrence relations with increasingly more terms.

\begin{proof}
We commence as in the proof of Theorem~\ref{theorem1}.  Let
  $C_{R,\varepsilon}$ denote the positively oriented contour consisting of
  the semi-circle~$C_{R}$ given by  $z=Re^{i\theta}$, $0\leq\theta\leq\pi$,
  $[-R,-\epsilon]$, the semi-circle~$C_{\varepsilon}$ given by $z=\varepsilon
  e^{i\theta}$, $\pi\geq\theta\geq0$, and $[\varepsilon,R]$, where
  $0<\varepsilon<d$, where~$d$ is the smallest modulus of the poles of~$f(z)$
  in~$U$.  We also choose~$R$ larger than the moduli  of all the poles of~$f(z)$ in~$U$. By the residue theorem,
\begin{gather}\label{1a}
\int_{C_{R,\varepsilon}}e^{iz}f(z)\log^mz\,\mathrm{d} z=S,
\end{gather}
where $S$ is def\/ined in~\eqref{S}.

We next directly evaluate the integral on the left-hand side of~\eqref{1a}.
As in the proof of Theorem~\ref{theorem1}, we can easily show that
\begin{gather}\label{2a}
\int_{C_{\varepsilon}}e^{iz}f(z)\log^mz\,\mathrm{d} z=o(1),
\end{gather}
as $\varepsilon$ tends to $0$.
Secondly, we estimate the integral over $C_R$.  By hypothesis, there exist a~positive constant $A$ and a~positive number~$R_0$, such that for $R\geq R_0$,
$|f(Re^{i\theta})|\leq A/R$.  Hence, for $R\geq R_0$,
\begin{gather}
\left|\int_{C_{R}}e^{iz}f(z)\log^mz\,\mathrm{d} z\right| =
\left|\int_0^\pi
  e^{iRe^{i\theta}}f(Re^{i\theta})\log^m(Re^{i\theta})iRe^{i\theta}\mathrm{d}\theta\right|
\nonumber\\
\hphantom{\left|\int_{C_{R}}e^{iz}f(z)\log^mz\,\mathrm{d} z\right|}{}
\leq\int_0^\pi e^{-R\sin\theta}|f(Re^{i\theta})|(\log R+\pi)^mR\,\mathrm{d}\theta\nonumber\\
\hphantom{\left|\int_{C_{R}}e^{iz}f(z)\log^mz\,\mathrm{d} z\right|}{}
 \leq A(\log R+\pi)^m\left(\int_0^{\pi/2}+\int_{\pi/2}^{\pi}\right)e^{-R\sin\theta}\mathrm{d}\theta.\label{3a}
\end{gather}
Since $\sin\theta\geq2\theta/\pi$, $0\leq\theta\leq\pi/2$, upon replacing $\theta$ by $\pi-\theta$, we f\/ind that
\begin{align}\label{4ab}
\int_{\pi/2}^{\pi}e^{-R\sin\theta}\mathrm{d}\theta&=\int_0^{\pi/2}e^{-R\sin\theta}\mathrm{d}\theta
\leq\int_0^{\pi/2}e^{-2R\theta/\pi}\mathrm{d}\theta
=\frac{\pi}{2R}\left(1-e^{-R}\right).
\end{align}
The bound~\eqref{4ab} also holds for the f\/irst integral on the far right-hand side of~\eqref{3a}.  Hence, from~\eqref{3a},
\begin{gather}\label{5a}
\left|\int_{C_{R}}e^{iz}f(z)\log^mz\,\mathrm{d} z\right|\leq A(\log R+\pi)^m\frac{\pi}{R}\left(1-e^{-R}\right)=o(1),
\end{gather}
as $R$ tends to inf\/inity.

Hence, so far, by \eqref{1a}, \eqref{2a}, and \eqref{5a}, we have shown that
\begin{gather}
S=\int_{-\infty}^0e^{ix}f(x)(\log|x|+i\pi)^m\mathrm{d} x+\int_0^{\infty}e^{ix}f(x)\log^mx\,\mathrm{d} x\nonumber\\
\hphantom{S}{}=\int_0^{\infty}\left\{e^{-ix}f(-x)(\log x+i\pi)^m+e^{ix}f(x)\log^mx\right\}\,\mathrm{d} x.\label{6a}
\end{gather}
Suppose f\/irst that $f(x)$ is even.  Then \eqref{6a} takes the form
\begin{gather*}
S =\int_0^{\infty}f(x)\left\{e^{-ix}(\log x+i\pi)^m+e^{ix}\log^mx\right\}\mathrm{d} x\nonumber\\
\hphantom{S}{} =\int_0^{\infty}f(x)\left\{e^{-ix}\sum_{k=0}^m\binom{m}{k}\log^kx(i\pi)^{m-k}+e^{ix}\log^mx\right\}\mathrm{d} x\nonumber\\
\hphantom{S}{} =\sum_{k=0}^m\binom{m}{k}(i\pi)^{m-k}(I_k-iJ_k)+(I_m+iJ_m)
\end{gather*}
which establishes \eqref{S1}.  Secondly, suppose that~$f(z)$ is odd.  Then, \eqref{6a} takes the form
\begin{gather}
S =\int_0^{\infty}f(x)\left\{-e^{-ix}(\log x+i\pi)^m+e^{ix}\log^mx\right\}\mathrm{d} x\nonumber\\
\hphantom{S}{} =\int_0^{\infty}f(x)\left\{-e^{-ix}\sum_{k=0}^m\binom{m}{k}\log^kx(i\pi)^{m-k}+e^{ix}\log^mx\right\}\mathrm{d} x\nonumber\\
\hphantom{S}{}=-\sum_{k=0}^m\binom{m}{k}(i\pi)^{m-k}(I_k-iJ_k)+(I_m+iJ_m),\label{8a}
\end{gather}
from which \eqref{S2} follows.
\end{proof}

\begin{Example}  Let $f(z)=z/(z^2+1)$. Then
\begin{gather*
2\pi i\,\textup{Res}\left(\frac{e^{iz}z\log^mz}{z^2+1},i\right)=\frac{\pi i}{e}\left(\frac{i\pi}{2}\right)^m,
\end{gather*}
and so we are led by \eqref{S2} to the recurrence relation
\begin{gather}\label{e2}
\frac{\pi
  i}{e}\left(\frac{i\pi}{2}\right)^m=-\sum_{k=0}^m\binom{m}{k}(i\pi)^{m-k}(I_k-iJ_k)+(I_m+iJ_m),
\end{gather}
where
\begin{gather*}
I_m:=\int_0^{\infty}\frac{x \cos x \log^mx}{x^2+1}\mathrm{d} x \quad\text{and}\quad J_m:=\int_0^{\infty}\frac{x \sin x \log^mx}{x^2+1}
\mathrm{d} x.
\end{gather*}
(In the sequel, it is understood that we are assuming that $n=1$ in Theorem~\ref{theorem1} and in all our deliberations of the two preceding sections.)
If $m=0$, \eqref{e2} reduces to
 \begin{gather}\label{e3}
 J_0=\frac{\pi}{2e},
 \end{gather}
 which is \eqref{easy}. After simplif\/ication, if $m=1$, \eqref{e2} yields
 \begin{gather}\label{e4}
 -\frac{\pi^2}{2e}=-i\pi I_0-\pi J_0+2iJ_1.
 \end{gather}
 If we equate real parts in \eqref{e4}, we once again deduce~\eqref{e3}.  If we equate imaginary parts in~\eqref{e4}, we f\/ind that
 \begin{gather}\label{e5}
 J_1-\frac{\pi}{2}I_0=0,
 \end{gather}
 which is identical with~\eqref{dd}.  Setting $m=2$ in~\eqref{e2}, we f\/ind that
 \begin{gather}\label{e6}
 -\frac{i\pi^3}{4e}=\pi^2(I_0-iJ_0)-2i\pi(I_1-iJ_1)+2iJ_2.
 \end{gather}
 Equating real parts on both sides of~\eqref{e6}, we once again deduce~\eqref{e5}. If we equate imaginary parts in~\eqref{e6} and employ~\eqref{e3}, we arrive at
 \begin{gather}\label{e7}
 J_2-\pi I_1=\frac{\pi^3}{8e},
 \end{gather}
 which is the same as~\eqref{cc}.
 Lastly, we set $m=3$ in~\eqref{e2} to f\/ind that
 \begin{gather}\label{e8}
 \frac{\pi^4}{8e}=i\pi^3(I_0-iJ_0)+3\pi^2(I_1-iJ_1)-3i\pi(I_2-iJ_2)+2iJ_3.
 \end{gather}
 If we equate real parts on both sides of~\eqref{e8} and simplify, we deduce~\eqref{e7} once again. On the other hand, when we equate imaginary parts on
 both sides of~\eqref{e8}, we deduce that
 \begin{gather}\label{e9}
 2J_3-3\pi I_2-3\pi^2J_1+\pi^3I_0=0.
 \end{gather}
 A slight simplif\/ication of~\eqref{e9} can be rendered with the use of~\eqref{e5}.
\end{Example}

 We can replace the rational function $1 / ( x^2 +
1)$ in Theorem~\ref{thm:int:s} by other even rational functions~$f ( x)$ to
obtain the following
generalization of Theorem~\ref{thm:int:s}.  Its proof is in the same spirit
as that of Theorem~\ref{theorem2}.

\begin{Theorem}
  \label{thm:int:f:s}Suppose that~$f (z)$ is an even rational function with
  no real poles and with the degree of the denominator exceeding the degree
  of the numerator by at least~$2$. Then,
  \begin{gather*}
    \frac{\pi i}{e^{\pi i s / 2}}  \sum_U \operatorname{Res} ( e^{i n z} f ( z) z^s,
     z_j) = \int_0^{\infty} \cos (n x - \pi s / 2) f ( x) x^s \mathrm{d} x,
  \end{gather*}
  where the sum is over all poles~$z_j$ of~$f ( z)$ lying in the upper
  half-plane~$U$.
\end{Theorem}

Note that, as we did for~\eqref{eq:int:s:sin}, we can replace~$s$ with $s + 1$
in Theorem~\ref{thm:int:f:s} to obtain a~corresponding result for odd rational
functions~$x f (x)$. This is illustrated in Example~\ref{eg:odd} below.

As an application, we derive from Theorem~\ref{thm:int:f:s} the following
explicit integral evaluation, which reduces to Theorem~\ref{thm:int:s} when $r
= 0$.

\begin{Theorem}
  \label{thm:int:sr}Let $r \geq 0$ be an integer. For $s \in (- 1, 2 ( r
  + 1))$ and $n \geq 0$,
  \begin{gather*}
    \int_0^{\infty} \frac{\cos (n x - \pi s / 2)}{( x^2 + 1)^{r + 1}} x^s
     \mathrm{d} x = \frac{\pi}{2} e^{- n} \sum_{k = 0}^r \frac{1}{2^{r + k}}
     \binom{r + k}{k} \sum_{j = 0}^{r - k} ( - 1)^j \binom{s}{j} \frac{n^{r -
     k - j}}{( r - k - j) !} .
  \end{gather*}
\end{Theorem}

\begin{proof}
  Setting $f ( z) = 1 / ( z^2 + 1)^r$ in Theorem~\ref{thm:int:f:s}, we see that we need  to
  calculate the residue
  \begin{gather*}
    \operatorname{Res} \left( \frac{e^{i n z} z^s}{( z^2 + 1)^{r + 1}}, i \right) =
     \operatorname{Res} \left( \frac{\alpha (z)}{( z - i)^{r + 1}}, i \right),
  \end{gather*}
  where
  \begin{gather*}
    \alpha (z) = \frac{e^{i n z} z^s}{(z + i)^{r + 1}}
  \end{gather*}
  is analytic in a neighborhood of $z = i$. Equivalently, we calculate the
  coef\/f\/icient of $x^r$ in the Taylor expansion of $\alpha (x + i)$ around $x =
  0$. Using the binomial series
  \begin{gather*}
    \frac{1}{( x + a)^{r + 1}} = \sum_{k \geq 0} ( - 1)^k \binom{r +
     k}{k} x^k a^{- r - k - 1}
  \end{gather*}
  with $a = 2 i$, we f\/ind that
  \begin{gather*}
    \alpha (x + i)   =  e^{- n}  \frac{e^{i n x} (x + i)^s}{(x + 2 i)^{r +
    1}} \\
    \hphantom{\alpha (x + i)}{}
      =  e^{- n} \sum_{k \geq 0} ( - 1)^k \binom{r + k}{k} x^k (2 i)^{-
    r - k - 1} \sum_{j \geq 0} \binom{s}{j} x^j i^{s - j} \sum_{l
    \geq 0} \frac{(i n x)^l}{l!} .
  \end{gather*}
  Extracting the coef\/f\/icient of $x^r$, we conclude that
  \begin{gather*}
    \operatorname{Res} \left( \frac{e^{i n z} z^s}{( z^2 + 1)^{r + 1}}, i \right)   =
     \frac{e^{- n}}{( 2 i)^{r + 1}} \sum_{k = 0}^r \frac{( - 1)^k}{( 2 i)^k}
    \binom{r + k}{k} \sum_{j = 0}^{r - k} \binom{s}{j} i^{s - j} \frac{( i
    n)^{r - k - j}}{( r - k - j) !}\\
  \hphantom{\operatorname{Res} \left( \frac{e^{i n z} z^s}{( z^2 + 1)^{r + 1}}, i \right)}{}
    =  \frac{e^{- n} e^{\pi i s / 2}}{2 i} \sum_{k = 0}^r \frac{1}{2^{r +
    k}} \binom{r + k}{k} \sum_{j = 0}^{r - k} ( - 1)^j \binom{s}{j} \frac{n^{r
    - k - j}}{( r - k - j) !}.
  \end{gather*}
  Theorem \ref{thm:int:sr} now follows from Theorem~\ref{thm:int:f:s}.
\end{proof}

\begin{Example}
  In particular, in the case $s = 0$,
  \begin{gather}\label{ab}
    \int_0^{\infty} \frac{\cos (n x)}{( x^2 + 1)^{r + 1}} \mathrm{d} x =
     \frac{\pi}{2} e^{- n} \sum_{k = 0}^r \frac{1}{2^{r + k}} \binom{r + k}{k}
     \frac{n^{r - k}}{( r - k) !}.
  \end{gather}
  We note that, more generally, this integral can be expressed in terms of the modif\/ied Bessel function $K_{r+1/2}(z)$ of order $r+1/2$.
   Namely, we have \cite[formula~(3.773), no.~6]{gr}
   \begin{gather}\label{ab2}
    \int_0^{\infty} \frac{\cos (n x)}{( x^2 + 1)^{r + 1}} \mathrm{d} x = \left(
     \frac{n}{2} \right)^{r+1/2}  \frac{\sqrt{\pi}}{\Gamma(r+1)} K_{r+1/2} (n) .
  \end{gather}
  When $r\ge0$ is an integer, the Bessel function $K_{r+1/2}(z)$ is elementary and the right-hand side of~\eqref{ab2} evaluates to the right-hand side of~\eqref{ab}.
\end{Example}

On the other hand, taking a derivative with respect to $s$ before setting $s =
0$, and observing that, for $j \geq 1$,
\begin{gather*}
  \left[ \frac{\mathrm{d}}{\mathrm{d} s} \binom{s}{j} \right]_{s = 0} = \frac{(-
   1)^{j - 1}}{j},
\end{gather*}
we arrive at the following generalization of Ramanujan's formula
\eqref{4}.

\begin{Corollary}
  We have
  \begin{gather*}
      \int_0^{\infty} \frac{\sin (n x)}{( x^2 + 1)^{r + 1}} \mathrm{d} x
    + \frac{2}{\pi} \int_0^{\infty} \frac{\cos (n x)}{( x^2 + 1)^{r + 1}} \log  x\, \mathrm{d} x\\
    \qquad{} =   - e^{- n} \sum_{k = 0}^r \frac{1}{2^{r + k}} \binom{r
    + k}{k} \sum_{j = 1}^{r - k} \frac{1}{j}  \frac{n^{r - k - j}}{( r - k -
    j) !} .
  \end{gather*}
\end{Corollary}

We leave it to the interested reader to make explicit the corresponding
generalization of~\eqref{eq:int:rama2}.

\begin{Example}  \label{eg:odd}
  As a direct extension of~\eqref{eq:int:s:sin},  replacing
  $s$ with $s + 1$ in Theorem~\ref{thm:int:sr}, we obtain the following
  companion integral. For integers $r \geq 0$, and any $s \in (- 2, 2 r +
  1)$ and $n \geq 0$,
  \begin{gather*}
    \int_0^{\infty} \frac{x \sin (n x - \pi s / 2)}{( x^2 + 1)^{r + 1}} x^s
     \mathrm{d} x = \frac{\pi}{2} e^{- n} \sum_{k = 0}^r \frac{1}{2^{r + k}}
     \binom{r + k}{k} \sum_{j = 0}^{r - k} ( - 1)^j \binom{s + 1}{j}
     \frac{n^{r - k - j}}{( r - k - j) !} .
  \end{gather*}
  In particular, setting $s = 0$, we f\/ind that
  \begin{gather}\label{abc}
    \int_0^{\infty} \frac{x \sin (n x)}{( x^2 + 1)^{r + 1}} \mathrm{d} x =
     \frac{\pi}{2} e^{- n} \sum_{k = 0}^r \frac{1}{2^{r + k}} \binom{r + k}{k}
     \left\{ \frac{n^{r - k}}{( r - k) !} - \frac{n^{r - k - 1}}{( r - k - 1)
     !} \right\},
  \end{gather}
  while taking a derivative with respect to $s$ before setting $s = 0$ and
  observing that, for~$j \geq 2$,
  \begin{gather*}
    \left[ \frac{\mathrm{d}}{\mathrm{d} s} \binom{s + 1}{j} \right]_{s = 0} =
     \frac{(- 1)^j}{j (j - 1)},
  \end{gather*}
  we f\/ind that{\samepage
  \begin{gather*}
      \int_0^{\infty} \frac{x \cos (n x)}{( x^2 + 1)^{r + 1}} \mathrm{d} x
    - \frac{2}{\pi} \int_0^{\infty} \frac{x \sin (n x)}{( x^2 + 1)^{r + 1}} \log x \, \mathrm{d} x\\
   \qquad{} =   e^{- n} \sum_{k = 0}^r \frac{1}{2^{r + k}} \binom{r +
    k}{k} \left[ \frac{n^{r - k - 1}}{( r - k - 1) !} - \sum_{j = 2}^{r - k}
    \frac{1}{j (j - 1)} \frac{n^{r - k - j}}{( r - k - j) !} \right]\\
   \qquad{} =   \frac{2}{\pi} \int_0^{\infty} \frac{\cos (n x)}{( x^2 + 1)^{r + 1}} \mathrm{d} x
    - \frac{2}{\pi} \int_0^{\infty} \frac{x \sin (n x)}{( x^2 + 1)^{r + 1}} \mathrm{d} x\\
    \qquad\quad{} - e^{- n} \sum_{k = 0}^r \frac{1}{2^{r + k}} \binom{r + k}{k} \sum_{j = 2}^{r - k} \frac{1}{j (j - 1)} \frac{n^{r - k - j}}{( r - k - j) !},
  \end{gather*}
upon the employment of \eqref{ab}} and~\eqref{abc}.
\end{Example}

\subsection*{Acknowledgements}

We wish to thank Khristo Boyadzhiev, Larry Glasser and the referees for their careful and helpful suggestions.

\pdfbookmark[1]{References}{ref}