In looking at linear transformations of the expectation of a random varaible $E(X)$, the following is given, but I'm not seeing how it is derived:
The linear transform: $Y=aX+b$
The result on expectations: $E(Y)=aE(X)+b$
However, when deriving this mathematically, isn't the following true (looking at continuous distributions for X and Y)?
$$\int_{}^{}{yf(y)dy}=\int_{}^{}{(axf(x)+b)dx}=a\int_{}^{}{xf(x)}dx+\int_{}^{}{b}dx=a\int_{}^{}{xf(x)}dx+bx$$
In this case, the expectations would be: $E(Y)=aE(X)+bx$
...of course this isnt making sense, and clearly the given equation is the correct one, but I'm not sure how it's being derived (likely my calculus is wrong somewhere).
Not like this: $$\int_{}^{}{yf(y)dy}=\int_{}^{}{(ax \color{red}{f(x)}+b)dx}=\color{red}{a\int_{}^{}{xf(x)}dx+\int_{}^{}{b}dx=a\int_{}^{}{xf(x)}dx+bx}$$
But like this:
$$E[Y]=\int(ax+b)f_X(x)dx\color{green}=\color{green}{a\int_{}^{}{xf(x)}dx+{b}\int_{}^{}f(x)dx=aE[X]+b}.$$