[guided]Let $\mathcal{L}^n$ denote $n$-dimensional Lebesgue measure on $\mathbb{R}^n$, and let $\mathcal{B}(U)$ denote the Borel $\sigma$-algebra of $U$. For $1 \leq p < \infty$, let $L^p(U)$ denote $L^p(U, \mathcal{B}(U), \mathcal{L}^n)$. Let $C_c^\infty(U)$ denote the real vector space of smooth functions $\psi: U \to \mathbb{R}$ with compact support in $U$. Let $H^1(U)$ denote the real Sobolev space of functions in $L^2(U)$ whose first weak partial derivatives belong to $L^2(U)$. Let $H_0^1(U)$ denote the closure of $C_c^\infty(U)$ in $H^1(U)$. Let $E_{\lambda_1}$ denote the real first Dirichlet eigenspace in $H_0^1(U)$, that is, the real vector space of weak solutions $\phi \in H_0^1(U) \setminus \{0\}$ of the eigenvalue equation with eigenvalue $\lambda_1$, together with the zero function. Let $u, v \in E_{\lambda_1}$ be nonzero real-valued eigenfunctions. The key input is the positivity hypothesis in the statement. It applies to both $u$ and $v$ because they are nonzero elements of $E_{\lambda_1}$. Its content is that every nonzero real first Dirichlet eigenfunction has a fixed sign $\mathcal{L}^n$-a.e. in $U$, and after choosing the nonnegative sign it is positive on a set of positive $\mathcal{L}^n$-measure. Therefore, after replacing an eigenfunction by its negative if needed, we may arrange that
\begin{align*}
u(x) \geq 0 \text{ for } \mathcal{L}^n\text{-a.e. } x \in U
\end{align*}
and
\begin{align*}
v(x) \geq 0 \text{ for } \mathcal{L}^n\text{-a.e. } x \in U.
\end{align*}
Since $u$ and $v$ are nonzero as elements of $L^2(U)$, each is positive on a set of positive $\mathcal{L}^n$-measure after this choice of sign.
We want to subtract a multiple of $v$ from $u$ so that the result has zero integral. This requires the integrals of $u$ and $v$ to be finite and the integral of $v$ to be nonzero. Since the hypotheses on $U$ include boundedness, $\mathcal{L}^n(U) < \infty$. Since $u, v \in H_0^1(U)$, in particular $u, v \in L^2(U)$. Applying the [Cauchy-Schwarz Inequality](/theorems/432) to $|u| \cdot 1$ and $|v| \cdot 1$ on the [measure space](/page/Measure%20Space) $(U,\mathcal{B}(U),\mathcal{L}^n)$ gives $u, v \in L^1(U)$. Because $v \geq 0$ $\mathcal{L}^n$-a.e., $v$ is positive on a set of positive $\mathcal{L}^n$-measure, and $v \in L^1(U)$, its integral is strictly positive:
\begin{align*}
\int_U v \, d\mathcal{L}^n(x) > 0.
\end{align*}
Hence we may define
\begin{align*}
a := \frac{\int_U u \, d\mathcal{L}^n(x)}{\int_U v \, d\mathcal{L}^n(x)}.
\end{align*}
The numerator and denominator are both positive, so $a > 0$.[/guided]