Calculating scalar curvature of a warped product $I \times N^n(k)$ I'm trying to work out the details of this example by R. Bryant. He considers a Riemannian manifold $(N ^n, h)$ of constant sectional curvature $k$ and constructs the following quadratic form on $\mathbb{R}^+ \times N$:
$$
g = \frac{\mathrm{d}u^2}{k-a\,u^2+ b\,u^{1-n}} + u^2\,h
$$
on $M^{n+1} = \mathbb{R}^+\times N$, where $a$ and $b$ are constants and $u>0$ is the coordinate on $\mathbb{R}^+$. It is clear that If $I\subset\mathbb{R}^+$ is an interval on the $u$-line on which $k-a\,u^2+ b\,u^{1-n} >0$, then $g$ is a Riemannian metric on $I\times N$. There are several claims of his that I thought would follow from straightforward calculations that I'm having a hard time verifying, though. One of them is the following: according to Bryant, the scalar curvature of this metric ($g$) is constant and equal to $$S = n(n{+}1)a$$
Here's how I tried to calculate the scalar curvature: letting $\psi(u) = (k-a\,u^2+ b\,u^{1-n})^{-1}$, we can define a metric $\widetilde{g}$ on $I$ by setting $\widetilde{g} = \psi \cdot \mathrm{d} u^2$. This allows us to see $g$ as a warped product $g = \widetilde{g} + u^2 h$. This is useful because the scalar curvature of a warped product has been calculated before several times in the literature. We have the following formula for a general multiply warped product:

Let $M = B \times_{h_1} N_1^{d_1} \times \cdots \times_{h_k} N_{k}^{d_k}$ be a multiply warped product with metric $g = g_{B} \oplus h_1^2 g_{N_1} \oplus \cdots \oplus h_{k}^2 g_{N_k}$. Then the scalar curvature of $M$ is given by
$$
\begin{aligned}
R_{M} = R_{B} &- 2 \sum_{1 \leq i \leq k} d_i \frac{\Delta_B h_i}{h_i} + \sum_{1 \leq i \leq k} \frac{R_{N_i}}{h_i^2} - \sum_{1 \leq i \leq k} d_i(d_i - 1) \frac{\| \text{grad}_B h_i \|_B^2}{h_i^2} \\
&+ \sum_{1 \leq i \leq k} \sum_{\substack{1 \leq \ell \leq k \\
\ell \neq i  \\
}} d_i d_{\ell} \frac{g_B(\text{grad}_B h_i, \text{grad}_B h_{\ell})}{h_i h_{\ell}}
\end{aligned}
$$

So let's use this for our specific example, where $M = I \times N$. Since $B = I$ is one-dimensional, $R_B = 0$. Furthermore, we have the following formula for the Laplacian of a conformal change of metric (which we'll apply to $\widetilde{g} = \psi \cdot \mathrm{d} u^2 = e^{2 \varphi} \cdot \mathrm{d} u^2$, where $\varphi = \frac{\ln(\psi)}{2}$)

$$ \Delta_{\widetilde{g}} = e^{-2 \varphi} \Delta_g + (n-2) e^{-2 \varphi} g^{ij} \frac{\partial \varphi}{\partial x_j} \frac{\partial}{\partial x_i} $$

In our case, we have $\Delta_{ \mathrm{d} u^2} u = 0$, which leads to
$$\Delta_{\widetilde{g}} u = - \psi^{-1} \widetilde{g}^{11} (\partial_{1} \varphi) = - \psi^{-1} \cdot \left(au + \frac{1}{2} b (n-1) u^{-n} \right)$$
Therefore:
$$- 2 \frac{n}{u} \Delta_{\widetilde{g}} u = \psi^{-1} \cdot \left( 2 n a + bn(n-1)u^{-n-1} \right)$$
It is also trivial that $\|\nabla u \|^2_{\widetilde{g}} = \psi$, and since $N$ has constant sectional curvature $k$, it is in particular an Einstein manifold with $R_{N} = n(n-1)k$. So we get:
$$R_{M} =\psi^{-1} \cdot \left( 2 n a + bn(n-1)u^{-n-1} \right) + \frac{n(n-1)k}{u^2}- \frac{n(n-1) \psi}{u^2}$$
instead of $R_M = n(n+1) a$, as Bryant states. So I probably made a mistake in my calculations, but despite having tried really hard several times now, I fail to see where such a mistake could have occurred. Can anyone spot any mistakes in my calculations? I'd really appreciate any help (if anyone can think of an easier way to calculate the scalar curvature, please let me know!). Thanks in advance!
EDIT: My mistake was in claiming "It is also trivial that $\|\nabla u \|^2_{\widetilde{g}} = \psi$". It is most definitely not trivial. It is in fact wrong. While $\mathrm{d} f$ does not depend on the metric $g$, the vector field $\nabla f$ DOES depend on the metric. Moreover, doing the calculations via the moving frame method (as per Deane's answer) is a lot better.
 A: My answer is below, but I wanted to make several comments.
First, regarding the ODE you found, the first two terms are
$$
\frac{n}{u}\left(\frac{f'}{f} - ff'\right).
$$
This is an immediate sign that you might have made an error, because it is unlikely you would get two terms that depend only $f$ and $f'$ but scale differently if you rescale $f$ by a constant factor. This is a hint to check particularly carefully the calculations that led to these two terms.
Second, I don't know if you tried rescaling the metric $g$. The observation is that, given $\alpha > 0$, if you set
\begin{align*}
f_\alpha &= \alpha^{-1}f\\
h_\alpha &= \alpha^2h\\
g_\alpha &= \frac{du^2}{f_\alpha^2} + u^2h_\alpha,
\end{align*}
then $g_\alpha = \alpha^2 g$. Therefore, if $S$ is the scalar curvature of $g$, then the scalar curvature of $g_\alpha$ is
$$
S_\alpha = \alpha^{-2}S.
$$
This means that if $f, h, S$ satisfy the ODE, then $f_\alpha, h_\alpha, S_\alpha$ had better satisfy the ODE, too. In your ODE, the second term scales properly, but the first and third do not. So that tells you not only that there is definitely an error but also where to focus your attention when searching for your error.
I know that error checking methods like this are rarely taught explicitly, especially not in textbooks, but developing such skills is quite important when doing differential geometric calculations.
The calculation below assumes you are familiar with using the moving frames method with differential forms. There are at least 3 ways to do calculations in differential geometry: 1) Using vector fields; 2) Using local coordinates; 3) Using moving frames. I recommend practicing and trying to develop facility with all 3. I find that depending on the calculation, often one way is easier than the other two. Even if you did not use moving frames, you can compare your formulas for the Riemann curvature, Ricci curvature, and scalar curvature against mine.
In general, I prefer to break down a calculation into natural pieces like this and do each calculation myself, instead of using a single formula that someone else has written down. There are a few reasons for this. That person might have made a mistake in their calculation or, even if they have the correct formula, copied it incorrectly. Or they are using different conventions than you are for the definitions and notation. Also, if I make a mistake using the formula, it is harder to identify where the error is than a calculation that is broken down into conceptually natural pieces.
Finally, here is my calculation, which I had to redo about 4 or 5 times. My final answer agrees with Robert's. That does not guarantee it is right, but it makes the probability high, especially since Robert is very reliable.
Let $\theta^1, \dots, \theta^n$ be an orthonormal frame of $1$-forms for the metric $h$ that has constant sectional curvature $\kappa$. Let $\theta^i_j$, $1 \le i,j \le n$, the corresponding connection $1$-forms. Therefore,
\begin{align*}
  d\theta^i + \theta^i_j\wedge\theta^j &= 0\\
  d\theta^i_j + \theta^i_p\wedge\theta^p_j &= \kappa\,\theta^i\wedge\theta^j.
\end{align*}
Given a function $f(u)$, consider the metric
$$
g = \frac{du^2}{f^2} + u^2h.
$$
An orthonormal frame of $1$-forms for $g$ is given by
\begin{align*}
\omega^0 &= \frac{du}{f}\\
\omega^i &= u\,\theta^i.
\end{align*}
Differentiating,
\begin{align*}
d\omega^0 &= 0\\
d\omega^i &= du\wedge\theta^i + u\,d\theta^i\\
&= -f\theta^i\wedge\omega^0 - \theta^i_j\wedge\omega^j
\end{align*}
This implies that the connection $1$-forms for $g$ with respect to the frame $(\omega^0, \dots, \omega^n)$ are
\begin{align*}
\omega^i_0 &= f\theta^i\\
\omega^i_j &= \theta^i_j.
\end{align*}
The curvature $2$-forms are therefore
\begin{align*}
\Omega^i_0 &= d\omega^i_0 + \omega^i_j\wedge\omega^j_0\\
&= f'\,du\wedge\theta^i + f\,d\theta^i + f\theta^i_j\wedge\theta^j\\
&= \frac{-ff'}{u}\,\omega^i\wedge\omega^0\\
\Omega^i_j &= d\omega^i_j + \omega^i_0\wedge\omega^0_j + \omega^i_p\wedge\omega^p_j\\
&= d\theta^i_j + \theta^i_p\wedge\theta^p_j - f^2\theta^i\wedge\theta^j\\
&= \frac{\kappa^2-f^2}{u^2}\omega^i\wedge\omega^j.
\end{align*}
This implies that
\begin{align*}
R_{i0i0} &= \frac{-ff'}{u}\\
R_{ijij} &= \frac{\kappa-f^2}{u^2},
\end{align*}
where $1 \le i,j\le n$ and $i \ne j$, and all other components are zero. It follows that the only possible nonzero components of the Ricci curvature tensor are
\begin{align*}
R_{00} &= \sum_{i=1}^n R_{i0i0} = \frac{-nff'}{u}\\
R_{ii} &= R_{i0i0} + \sum_{j\ne i} R_{ijij}\\
&= -\frac{ff'}{u} + \frac{(n-1)(\kappa-f^2)}{u^2}.
\end{align*}
This implies that the scalar curvature is
\begin{align*}
  S &= R_{00} + \sum_{i=1}^n R_{ii}\\
  &= \frac{-nff'}{u} + n\left(-\frac{ff'}{u} + \frac{(n-1)(\kappa-f^2)}{u^2}\right)\\
    &= \frac{-2nff'}{u} + \frac{n(n-1)(\kappa-f^2)}{u^2}\\
    &= \frac{n}{u^2}(-2ff'u + (n-1)(\kappa-f^2)).
\end{align*}
As written, it is not clear how to solve this ODE. However, it is easy to see that since $2ff' = (f^2)'$, you can rewrite the equation in terms of
$$\
\phi = \kappa-f^2.
$$
The equation can be rewritten as
$$
u\phi' + (n-1)\phi = \frac{S}{n}u^2
$$
If we now multiply by $u^{n-2}$, then we get
$$
u^{n-1}\phi' + (n-1)u^{n-2}\phi = \frac{S}{n}u^{n},
$$
which implies
$$
(u^{n-1}\phi)' = \frac{S}{n}u^{n}
$$
If we assume that $S$ is constant and
$$
\lim_{u\rightarrow 0} u^{n-1}\phi(u) = c,
$$
then the fundamental theorem of calculus implies that
$$
u^{n-1}\phi = \frac{S}{n(n+1)}u^{n+1} + c.
$$
Solving for $\phi$, we get
$$
\phi = \frac{S}{n(n-1)}u^2 + cu^{1-n}.
$$
Therefore,
\begin{align*}
  f^2 &= \kappa - \phi\\
      &= \kappa - \frac{S}{n(n+1)}u^2 - cu^{1-n}.
\end{align*}
It follows that the metric
$$
g = \frac{du^2}{\kappa- \frac{S}{n(n+1)}u^2 - cu^{1-n}}
$$
has constant scalar curvature $S$.
