The Maximal Diameter Theorem 
I am doing some theory concerning one of my courses which is, Selected Topic in Differential Geometry and I have two questions regarding The Maximal Diameter Theorem, from the Xia book.
My first question is, why can we pick such an $a$ and $b$, as written in the proof?
The second would be, how to compute that the first eigenvalue of an $n$-dimensional hemisphere is equal to $n$.
Thanks in advance for any help.
 A: I added my comments below for completeness.
First note that the integral of $f$ and $g$ are finite since by elliptic regularity they are smooth, and the domain is finite. Alternatively, to see that these are finite note that since the first eigenvalue is determined as the minimizer of the Rayleigh-Ritz quotient, we have that $$\int_{B(p)} f^2~d\mathrm{vol} < +\infty,$$ where $f$ is the first Dirichlet eigenfunction of the ball $B(p):=B(p,\pi/2).$ Again, since the domain is bounded, we can use Holder's inequality to deduce that $f\in L^1(B(p);d\mathrm{vol})$, and so in particular $\int_{B(p)} f~d\mathrm{vol} < +\infty$. 
I think there is a slight mistake in the proof as stated. Working through the proof you see that you only need that either $a$ or $b$ is nonzero. If $\int_M f~d\mathrm{vol}=\int_Mg~d\mathrm{vol}=0$ then any choice of $a$ and $b$ suffices. If only one of these integrate to zero, say $\int_M f~d\mathrm{vol}=0$ but $\int_M g~d\mathrm{vol}\neq 0$ then you can take $a=1$ and $b=0$. In the last case when they are both nonzero, you can easily choose $a$ and $b$, since you have an overdetermined linear system. This addresses your first question.
Now to address your second question. Let $$\mathbf{S}^n_+:=\{\vec{x}\in\mathbf{S}^{n}~:~x_{n+2} \geq 0\}\subseteq\mathbf{R}^{n+2}$$ be the $n$-dimensional hemisphere. Note that if we parameterize this surface by polar coordinates $(\xi,\phi)\in\mathbf{S}^{n-1}\times[0,\pi]$ where $\phi$ is the latitude, i.e. $x_{n+2}=\cos\phi$, we can show that the Laplace-Beltrami operator in coordinates is given by
$$\Delta u = \frac{1}{(\sin\phi)^{n-1}}\frac{\partial}{\partial\phi}\left((\sin\phi)^{n-1}\frac{\partial u}{\partial\phi}\right)+(\sin\phi)^{n-1}\Delta_{\mathbf{S}^{n-1},\xi}u,$$
where $\Delta_{\mathbf{S}^{n-1},\xi}$ is the Laplace-Beltrami operator on the $(n-1)$-dimensional sphere in the $\xi$-coordinates (this decomposition can easily be shown by a direct computation). Now consider the real valued function $u:\mathbf{S}^{n}_+\to\mathbf{R}$ given by
$$u(\vec{x})=x_{n+2}=\cos\phi.$$
A direct computation shows $$\Delta u = n\cos\phi = nu,\qquad\text{and}\qquad u|_{\partial\mathbf{S}^n_+}\equiv 0$$ So we know that $\lambda_1(\mathbf{S}^n_+)\leq n$. On the other hand, recall that the Ricci curvature of the sphere is given by $$\mathrm{Ric}_{\mathbf{S}^n_+}(Y,Z)=(n-1)\langle Y,Z\rangle,$$ and so by the Lichnerowicz formula we deduce that $\lambda_1(\mathbf{S}^n_+)\geq n$. The Lichnerowicz formula is usually stated for compact manifolds without boundary, but since we are considering the Dirichlet eigenvalue problem the proof still carries though (we pick up nothing from the boundary when we apply integration by parts). So we have shown $\lambda_1(\mathbf{S}^n_+)=n$.
