# Expectation of Linear Transformation of Random Variable

## Theorem

Let $X$ be a random variable.

Let $a, b$ be real numbers.

Then we have:

$\expect {a X + b} = a \expect X + b$

where $\expect X$ denotes the expectation of $X$.

## Proof

### Discrete Random Variable

Let $\map {\operatorname {supp} } X$ be the support of $X$.

Then:

 $\ds \expect {a X + b}$ $=$ $\ds \sum_{x \mathop \in \map {\operatorname {supp} } X} \paren {a x + b} \map \Pr {X = x}$ Expectation of Function of Discrete Random Variable $\ds$ $=$ $\ds a \sum_{x \mathop \in \map {\operatorname {supp} } X} x \map \Pr {X = x} + b \sum_{x \mathop \in \map {\operatorname {supp} } X} \map \Pr {X = x}$ $\ds$ $=$ $\ds a \expect X + b \times 1$ Definition of Expectation of Discrete Random Variable, Definition of Probability Mass Function $\ds$ $=$ $\ds a \expect X + b$

$\blacksquare$

### Continuous Random Variable

Let $\map {\operatorname {supp} } X$ be the support of $X$.

Let $f_X : \map {\operatorname {supp} } X \to \R$ be the probability density function of $X$.

Then:

 $\ds \expect {a X + b}$ $=$ $\ds \int_{x \in \map {\operatorname {supp} } X} \paren {a x + b} \map {f_X} x \rd x$ Expectation of Function of Continuous Random Variable $\ds$ $=$ $\ds a \int_{x \in \map {\operatorname {supp} } X} x \map {f_X} x \rd x + b \int_{x \in \map {\operatorname {supp} } X} \map {f_X} x \rd x$ Linear Combination of Definite Integrals $\ds$ $=$ $\ds a \expect X + b \times 1$ Definition of Expectation of Continuous Random Variable $\ds$ $=$ $\ds a \expect X + b$

$\blacksquare$