TITLE: justification of $\operatorname {E} \left[2X\operatorname {E} [X]\right] = 2\operatorname {E} [X]\operatorname {E} [X]$
QUESTION [5 upvotes]: I am learning Variance.
$${\displaystyle {\begin{aligned}\operatorname {Var} (X)&=\operatorname {E} \left[(X-\operatorname {E} [X])^{2}\right]\\[4pt]&=\operatorname {E} \left[X^{2}-2X\operatorname {E} [X]+\operatorname {E} [X]^{2}\right]\\[4pt]&=\operatorname {E} \left[X^{2}\right]-2\operatorname {E} [X]\operatorname {E} [X]+\operatorname {E} [X]^{2}\\[4pt]&=\operatorname {E} \left[X^{2}\right]-\operatorname {E} [X]^{2}\end{aligned}}}
$$
where, the part
$$\operatorname {E} \left[2X\operatorname {E} [X]\right] = 2\operatorname {E} [X]\operatorname {E} [X]
$$
is a little bit difficult to justify, can anyone give a hint? which rule can apply this.

REPLY [5 votes]: Linearity of Expected value applys this.
let $a = \operatorname{E}[X]$, which is a constant
your formula is now $\operatorname{E} \left[ 2X a \right] = 2\operatorname{E}[X] a  = 2\operatorname {E} [X]\operatorname {E} [X]$