Find sequence for a martingale. Let $(X_n)_{n\geq 1}$ be independent such that $E(X_i)=m_i$, ${\rm var}(X_i)=\sigma_i^2$, $i\geq 1$. Let $S_n=\sum_{i=1}^n X_i$ and $\mathcal{F}_n=\sigma(X_i,1\leq i\leq n)$.
Find sequences $(b_n)_{n\geq 1}$, $(c_n)_{n\geq 1}$ of real numbers such that $(S_n^2+b_n S_n +c_n)_{n\geq 1}$ is a $(\mathcal{F}_n)_{n\geq 1}$-martingale.
I start from the definition of martingale and stuck when expanding the squre of $S_n$. Can someone figure out how to finish the computation.
 A: First, for any choice of $b_n$ and $c_n$, the random variable $Y_n:=S_n^2+b_n S_n +c_n$ is integrable and $\mathcal F_n$-measurable. Therefore, we are reduced to find $b_n$ and $c_n$ such that $E[Y_{n+1}\mid\mathcal F_n]=Y_n$. To this aim, we write $Y_{n+1}$ as 
$$
Y_{n+1}=(S_n+X_{n+1})^2+b_{n+1}S_n+b_{n+1}X_{n+1}+c_{n+1}
$$
and expanding the square gives 
$$
Y_{n+1}= S_n^2+2S_nX_{n+1}+X_{n+1}^2+b_{n+1}S_n+b_{n+1}X_{n+1}+c_{n+1}
$$
and reordering the term according to their $\mathcal F_n$-measurability or independence with respect to $\mathcal F_n$ givves 
$$
Y_{n+1}= S_n^2+b_{n+1}S_n+2S_nX_{n+1}+X_{n+1}^2+b_{n+1}X_{n+1}+c_{n+1}.
$$
Taking the conditional expectation with respect to $\mathcal F_n$ gives 
$$
E[Y_{n+1}\mid\mathcal F_n]=S_n^2+b_{n+1}S_n+2S_nm_{n+1}+\sigma_{n+1}^2+m_{n+1}^2
+b_{n+1}m_{n+1}+c_{n+1},
$$
where we used 
$$
E[S_nX_{n+1}\mid\mathcal F_n]=S_nE[ X_{n+1}\mid\mathcal F_n]=S_nE[ X_{n+1} ].
$$
We thus need 
$$
b_{n+1}+2m_{n+1}=b_n\mbox{ and }\sigma_{n+1}^2+m_{n+1}^2
+b_{n+1}m_{n+1}+c_{n+1}=c_n
$$
and an expression for $b_n$ and $c_n$ can be found by induction.
