Please help me understand the differentiation of this function.
$$P_L = \sum_{i=1}^{n_g}\sum_{j=1}^{n_g} P_iB_{ij}P_j~+~\sum_{i=1}^{n_g}B_{0i}P_i~+~B_{00}$$
What would the partial differentiation $\frac{\partial P_L}{\partial P_i}$ be?
My understanding is that it should be
$$\frac{\partial P_L}{\partial P_i} = \sum_{i=1}^{n_g}\sum_{j=1}^{n_g} B_{ij}P_j~+~\sum_{i=1}^{n_g}B_{0i}$$
However, the book says
$$\frac{\partial P_L}{\partial P_i} = 2\sum_{j=1}^{n_g} B_{ij}P_j~+~B_{0i}$$
What am I missing please?
Any help would be appreciated. Thanks