# Math Help - Differentiating the variance.

1. ## Differentiating the variance.

I have a problem that involves differentiating the variance of a function in a lagrange multiplier problem!

I know that there are Summation terms in the variance....

what i don't know is what happens after you differentiate this with respect to ai??

It will still have summations and im wondering how you can get the value of what ai is equal to in the equation.....i.e something that would resemble an inner product.....

Any help would be greatly appreciated!!

2. Originally Posted by frog
I have a problem that involves differentiating the variance of a function in a lagrange multiplier problem!

I know that there are Summation terms in the variance....

what i don't know is what happens after you differentiate this with respect to ai??
Well, you can't differentiate with respect to $a_i$ because $i$ is a dummy index of summation, you have to differentiate with respect to a specific $a_k$, and you might as well make it $a_1$ to be specific.

CB

3. Ok so if i set i = 1 am I also able to set j = 1?

So in the second summation i would effectively have 2a*the covariance?

which when differentiated would give me 2*the covariance?

Thanks so far

4. Originally Posted by frog
Ok so if i set i = 1 am I also able to set j = 1?

So in the second summation i would effectively have 2a*the covariance?

which when differentiated would give me 2*the covariance?

Thanks so far
$\displaystyle \text{Var}\left( \sum_{i=1}^n a_iX_i \right)= \sum_{i=1}^n a_i^2 \text{Var}(X_i)+2 \sum_{j\ne 1} a_1a_j\text{Cov}(X_1,X_j) +\text{terms independent of}\ a_1$

so differentiating wrt $a_1$:

$\displaystyle \dfrac{\partial}{\partial a_1}\text{Var}\left( \sum_{i=1}^n a_iX_i \right)=2a_1\text{Var}(X_1)+2 \sum_{j\ne 1} a_j\text{Cov}(X_1,X_j)
$

so appealing to symmetry we can conclude:

$\displaystyle \dfrac{\partial}{\partial a_k}\text{Var}\left( \sum_{i=1}^n a_iX_i \right)=2a_k\text{Var}(X_k)+2 \sum_{j\ne k} a_j\text{Cov}(X_k,X_j)
$

CB