# Expectation of a function of random variables

I'm trying to simplify the following expectation so that I can later solve a maximization problem: $$max_k E[(A - kB)^2]$$, where $$A$$ ~ $$N(0,\sigma^2_1)$$, $$B = A+ \epsilon$$ and $$\epsilon$$ ~ $$N(0,\sigma^2_2)$$.

I thought I could linearize the expectation by expanding the square, and then plugging in $$B$$ in terms $$A + \epsilon$$, but each term I get depends on $$A$$ in this case, which has an expected value of 0, so I feel that I'm thinking about this the wrong way. What's the best way to simplify? Am I solving a conditional expectation here, since $$B$$ depends on $$A$$?

$$f(k)=E[(A-kB)^2]=E[((1-k)A-k\epsilon)^2]=(1-k)^2E[A^2]+k^2E[\epsilon^2]-2k(1-k)E[A\epsilon]$$
Here, if $$A$$ and $$\epsilon$$ are independent, $$E[A\epsilon]=E[A]E[\epsilon]=0$$, and we'll have $$f(k)=(1-k)^2\sigma_1^2+k^2\sigma_2^2$$. We just take derivative wrt $$k$$ and have $$f'(k)=-2(1-k)\sigma_1^2+2k\sigma_2^2=0\rightarrow k=\frac{\sigma_1^2}{\sigma_2^2-\sigma_1^2}$$
• Ah I think the step I was missing was that the expected of $A^2$ and such is the variance. Thanks! – John Alperto Mar 14 at 12:25