Consider the quadratic function $\mathbf{\frac{1}{2}x^TGx+b^Tx}$ in four variables where $$\mathbf{G}= \begin{bmatrix} 2 & -1 & 0 & 0 \\ -1 & 2 & -1 & 0 \\ 0 & -1 & 2 & -1 \\ 0 & 0 & -1 & 2 \end{bmatrix}$$ and $\mathbf{b}=(-1,0,2,\sqrt{5})^T$. Apply the conjugate gradient method to this problem from $\mathbf{x_0=0}$ and show that it converges in two iterations. Verify that there are just two independent vectors in the sequence $\mathbf{g_0,Gg_0,G^2g_0,\dots}$.
The algorithm I am going by is the following:

If my first step starts from $(0,0,0,0)$ wouldn't the function become $0$. At that point how would I take the second step? I guess I'm not understanding how to iterate. My suspicion is that I need to calculate the step-length, $\alpha$. Is $\alpha$ same for quadratic and linear functions? I.e., $$\alpha=\frac{\mathbf{r_0^Tr_0}}{\mathbf{p_0^TGp_0}}$$ where $\mathbf{r_0=b-Gx_0}$? I am not sure if $\mathbf{p_0}$ is $\mathbf{r_0}$ or $\mathbf{-r_0}$.
Edit: My reference is Numerical Optimization by Jorge Nocedal (source)