The marginal risk contribution of asset $i$ is defined by Roncalli in his paper on ERC as follows:
$$\frac{\partial \sigma(x)}{\partial x_i} = \frac{1}{\sigma(x)} \left( w_i \sigma_i^2 + \sum_{\substack{j=1 \\ i \neq j}}^n w_j \sigma_{i,j} \right)$$
I was thinking about computing the value for a fully invested portfolio with $n=2$ assets, i.e. $x=\{w,1-w\}$.
With $n=2$, we know that:
$$\sigma(x)=\sqrt{w^2 \sigma_1^2 + (1-w)^2 \sigma_2^2 + 2 w (1-w) \sigma_{1,2}}$$
So, we can compute the marginal contribution of asset 1 (with $x_1=w$) as:
$$\frac{d \sigma(x)}{dw} = \frac{1}{2} \frac{1}{\sigma(x)} \left[ 2w \sigma_1^2 + 2(1-w)(-1) \sigma_2^2 + 2 \sigma_{1,2} (1-2w) \right] $$
$$\frac{d \sigma(x)}{dw} = \frac{1}{\sigma(x)} \left[ w \sigma_1^2 - (1-w) \sigma_2^2 + \sigma_{1,2} (1-2w) \right] $$
If I use Roncalli's definition, I get:
$$\frac{d \sigma(x)}{dw} = \frac{1}{\sigma(x)} \left[ w \sigma_1^2 + (1-w) \sigma_{1,2} \right] $$
The two results are not the same, and I'm trying to understand why. So far, I came up with the fact that Roncalli's definition is not taking into account the fact that the portfolio is fully invested. Is that correct?