The Cox-Ingersoll-Ross Model (1985) Please show me how to solve (2) with computation processes.(1) was the initial question which I solved. I show the answers (1) below.

Consider the equation
\begin{eqnarray}
dr_t=(\alpha - \beta r_t ) dt + \sigma \sqrt{r_t} dB_t
\end{eqnarray}
which models the variations of the short rate process $r_t$, where $\alpha,  \beta, \sigma $ and $r_0$ are positive parameters. $B_t$ is a S.B.M.

(1) Compute $E[r_t | \mathcal{F}_s ]$ , $0 \le s \le t$. 

(2) Compute $E[r_t^2 | \mathcal{F}_s ]$, $0 \le s \le t$. 
(Thank you for your help in advance.)

(1) My answer (Revised the Constant Term for $time=t$)
\begin{eqnarray}
r_t &=& r_0 + \alpha t - \beta \int^t_0 r_u du + \sigma \int^t_0 \sqrt{r_u} dB_u\\
E[r_t | \mathcal{F}_s ] &=& E\left[r_0 + \alpha t - \beta \int^t_0 r_u du + \sigma \int^t_0 \sqrt{r_u} dB_u | \mathcal{F}_s \right] \\
&=& r_0 + \alpha t - \beta \int^t_0 E\left[ r_u | \mathcal{F}_s \right]du  + \sigma \int^s_0 \sqrt{r_u} dB_u + \sigma \int^t_s \sqrt{r_u}  E\left[ dB_u | \mathcal{F}_s \right] \\
&=& \left( r_0 + \sigma \int^s_0 \sqrt{r_u} dB_u \right)+ \alpha t - \beta \int^t_0 E\left[ r_u | \mathcal{F}_s \right]du
\end{eqnarray}


*

*(Revised the Constant Term for $time=t$) Let $u_t = E[r_t | \mathcal{F}_s ]$ with a condition of $u_s=r_s$, namely $u_s = E[r_s | \mathcal{F}_s ]=r_s$. Then, above equations come to below (O.D.E). 


\begin{eqnarray}
E[r_t | \mathcal{F}_s ] &=& \left( r_0 + \sigma \int^s_0 \sqrt{r_u} dB_u \right) + \alpha t - \beta \int^t_0 E\left[ r_u | \mathcal{F}_s \right]du \\
u_t &=& \left( r_0 + \sigma \int^s_0 \sqrt{r_u} dB_u \right)+ \alpha t - \beta \int^t_0 u_u du \\
du_t&=& \alpha dt - \beta u_t dt \\
\frac{du_t}{dt}&=& \alpha - \beta u_t 
\end{eqnarray}


*

*(1st Step) Consider $u_t/dt = 0 - \beta u_t $.
\begin{eqnarray}
\frac{du_t}{dt}&=&  - \beta u_t\\
%\int^t_0 \frac{du_s}{u_s} &=& - \beta \int^t_0 ds\\
%\log \frac{u_t}{u_0} &=& - \beta t\\
%\frac{u_t}{r_0} &=& e^{- \beta t} \\
u_t &=& r_0 e^{- \beta t}
\end{eqnarray}

*(2nd Step) Adjust $u_t$ satisfies the condition of $u_s=r_s$
\begin{eqnarray}
u_t &=& r_0 \left(1 - e^{- \beta (t-s)} \right) + r_s  e^{- \beta (t-s)} 
\end{eqnarray}

*(3rd Step) Consider $u_t/dt = \alpha - \beta u_t $. Adjust $u_t$ as below.


\begin{eqnarray}
u_t &=& \frac{\alpha}{\beta} \left(1 - e^{- \beta (t-s)} \right) + r_s  e^{- \beta (t-s)}
\end{eqnarray}


*

*This satisfies the initial O.D.E. One reaches the solution as below. 


\begin{eqnarray}
E[r_t | \mathcal{F}_s ] &=&u_t \\
&=& \frac{\alpha}{\beta} \left(1 - e^{- \beta (t-s)} \right) + r_s  e^{- \beta (t-s)}
\end{eqnarray}
$\square$
(2) Thank you for your help in advance.
 A: I agree with you on the main lines with the answers 1). 
To be more rigorous, I would say :
\begin{align}
E[r_t | \mathcal{F}_s ] = r_0 + \alpha t - \beta \int^t_0 E\left[ r_u | \mathcal{F}_s \right]du + \sigma E\left[\int^t_0 \sqrt{r_u}   dB_u | \mathcal{F}_s \right] \tag{A}
\end{align}
But $\int^t_0 \sqrt{r_u}   dB_u $ is a martingale, therefore $E\left[\int^t_0 \sqrt{r_u}   dB_u | \mathcal{F}_s \right]= \int^s_0 \sqrt{r_u}   dB_u$. Hence, $(A)$ becomes:
\begin{align}
E[r_t | \mathcal{F}_s ] = r_0 + \alpha t - \beta \int^t_0 E\left[ r_u | \mathcal{F}_s \right]du + \sigma  \int^s_0 \sqrt{r_u}   dB_u
\end{align}
Denoting $u(t)=E[r_t | \mathcal{F}_s ]$, we have the following ODE:
\begin{align}
u'(t) &= \alpha - \beta u(t) \quad \text{for }0\leq s\leq t\ \\
u(s) &= r_s 
\end{align}
For the question $(2)$, we apply first the Ito's lemma to the function $\phi(x) = x^2$ (which is $C^2$ and the process $r$ meets the conditions of an Ito process.)
\begin{align}
dX_t = d(r_t^2) &= 2r_tdr_t +d\langle r\rangle_t\\
&= 2\left[(\alpha r_t - \beta r_t^2)dt - \sigma r_t^{3/2}dB_t\right] + \sigma^2 r_tdt \\
&= 2\left[(\alpha \sqrt{X_t} - \beta X_t)dt - \sigma X_t^{3/4}dB_t\right] + \sigma^2 \sqrt{X_t}dt \\
&= (2\alpha +\sigma^2)\sqrt{X_t}dt - 2\beta X_tdt - 2\sigma X_t^{3/4}dB_t]
\end{align} 
Therefore,
\begin{align}
X_t = X_0 + (2\alpha +\sigma^2)\int_0^t\sqrt{X_u}du- \int_0^t 2\beta X_udu - \int_0^t 2\sigma X_u^{3/4}dB_u]
\end{align} 
Taking the conditional expectation, we have:
\begin{align}
E[X_t | \mathcal{F}_s ]  = X_0 + (2\alpha +\sigma^2)\int_0^tE[\sqrt{X_u}| \mathcal{F}_s ]du- \int_0^t 2\beta  E[X_u| \mathcal{F}_s]du - E[\underbrace{\int_0^t 2\sigma X_u^{3/4}dB_u}_{martingale}|\mathcal{F}_s]
\end{align} 
Denoting $v(t) = E[X_t | \mathcal{F}_s ]$ and taking the derivative, we have the following ODE:
\begin{align}
v'(t) &= (2\alpha + \sigma^2)u(t) - 2\beta v(t)\quad \text{for }0\leq s\leq t\ \\
v(s) &= r_s^2
\end{align} 
Note that I used the Fubini theorem to switch between the integral and expectation.
A: The ODE approach is fine, but is more involved. There is a more convenient way to derive the results, especially so for $E_s[r_t^2]$.
The trick is to work with $x_t=e^{\beta t}r_t$ and its corresponding sde is simply,
$$dx_t=e^{\beta t}(\alpha dt +\sigma r_t^{\frac{1}{2}}  dB_t) $$
Its solution in terms of $x_s$ can then be written as,
$$x_t= x_s + \alpha \int_s^t e^{\beta \tau} d\tau + z_{s,t}  $$
where $E_s[z_{s,t}]=0 $. Therefore,
$$E_s[x_t]= x_s + \frac{\alpha}{\beta}(e^{\beta t}-e^{\beta s} ). \tag{1} $$
The process for $x_t^2$ according to Ito's formula is,
$$dx_t^2=e^{\beta t}x_t(2\alpha + \sigma^2) dt + 2\sigma e^{2\beta t} r_t^{\frac{3}{2}} dB_t $$
It's solution in terms of $x_s$ is,
$$x_t^2= x_s^2 + (2\alpha + \sigma^2) \int_s^t e^{\beta \tau}x_{\tau} d\tau + zz_{s,t} $$
where, again, $E_s[zz_{s,t}]=0 $. Then, its expectation becomes,
$$E_s[x_t^2]= x_s^2 + (2\alpha + \sigma^2) \int_s^t e^{\beta \tau}E_s[x_{\tau}] d\tau . $$
Plugging the result (1) to obtain,
$$E_s[x_t^2]= x_s^2 + (2\alpha + \sigma^2) \int_s^t e^{\beta \tau}
\left[ x_s + \frac{\alpha}{\beta}(e^{\beta \tau}-e^{\beta s} )\right] d\tau . $$
Carrying out the integration to get,
$$E_s[x_t^2]= x_s^2 + (2\alpha + \sigma^2) \left[ \frac{1}{\beta}(e^{\beta t}-e^{\beta s} )x_s + \frac{\alpha}{2\beta^2}(e^{\beta t}-e^{\beta s} )^2  \right] \tag{2}$$
In the end, rewrite {1} and {2} in terms of the original variable $r_t$ to get the final results,
$$E_s[r_t]= e^{-\beta (t-s)}r_s + \frac{\alpha}{\beta} \left[1-e^{-\beta (t- s)} \right]$$
$$E_s[r_t^2]= e^{-2\beta (t-s)}r_s^2 + (2\alpha + \sigma^2) \left[ \frac{1}{\beta}(e^{-\beta (t-s)}-e^{-2\beta (t-s)} )r_s + \frac{\alpha}{2\beta^2}(1-e^{-\beta(t-s)} )^2  \right].$$
