I'm trying to solve this problem:
Let $\left(X_n\right)_{n\geq 1}$ be independent such that $\mathbb E\left(X_i\right)=m_i$ and $\mathrm{Var}(X_i)=\sigma_{i}^{2}$ for $i\geq 1$. Let $\displaystyle S_{n}=\sum_{i=1}^{n}X_i$ and $\mathcal F=\sigma\left(X_i,1\leq i \leq n\right)$. Find sequences $\left(b_n\right)_{n\geq 1}$, $(c_{n})_{n\geq 1}$ of real numbers such that $$\left(S_n^2+b_nS_n+c_n\right)_{n\geq 1}$$ is a $(\mathcal F_{n})_{n\geq 1}$martingale.
The first step should be to calculate the conditional expectation of $S_{n+1}^2+b_{n+1}S_{n+1}+c_{n+1}$ with respect to $\mathcal{F}$, is this the correct calculation:
$$\mathbb E\left[S_{n+1}^2+b_{n+1}S_{n+1}+c_{n+1}|\mathcal{F}_{n}\right]=$$
$$\mathbb E\left[\left(\sum_{i=1}^{n+1}X_i\right)^2+b_{n+1}\left(\sum_{i=1}^{n+1}X_i\right)+c_{n+1}\left\vert\vphantom{\frac{1}{1}}\right.\mathcal{F}_{n}\right]=$$
$$(n+1)\mathrm{Var}\left[X_i\right]+((n+1)\mathbb E[X_i])^2+b_{n+1}(n+1)\mathbb E[X_i]+c_{n+1}=$$
$$(n+1)\sigma_{i}^2+((n+1)m_i)^2+b_{n+1}(n+1)m_i+c_{n+1}$$
And what should the next step be? Thanks!
Hint Note that $S_n$ and $X_n$ are $\mathcal{F}_n$-measurable, hence
$$\mathbb{E}(S_n^2 \mid \mathcal{F}_n) = S_n^2 \qquad \mathbb{E}(X_n \mid \mathcal{F}_n)=X_n$$
Moreover,
$$S_{n+1}^2 = (S_{n+1}-S_n+S_n)^2 = \underbrace{(S_{n+1}-S_n)^2}_{X_{n+1}^2} + 2\underbrace{(S_{n+1}-S_n)}_{X_{n+1}} \cdot S_n + S_n^2$$
thus
$$\mathbb{E}(S_{n+1}^2 \mid \mathcal{F}_n) = \mathbb{E}(X_{n+1}^2 \mid \mathcal{F}_n) + 2 S_n \cdot \mathbb{E}(X_{n+1} \mid \mathcal{F}_n) + S_n^2$$
Using the independence of $(X_n)_n$, one can compute the remaining conditional expectations.
Similar calculations yield an expression for the conditional expectation of $\mathbb{E}(S_{n+1} \mid \mathcal{F}_n)$.