I am trying to derive the expression for fugacity for a Van der Waals gas using the fundamental thermodynamic equations. I have encountered a problem in trying to calculate the partial derivative of a double summation mixing rule as follows:
$$
an^2 = \sum_i\sum_j n_in_j(1-k_{ij})\sqrt{a_ia_j}
$$
I know from the Prausnitz molecular thermodynamics text that the derivative for a simpler expression is as follows:
$$
an^2 = \sum_i\sum_j n_in_j\sqrt{a_ia_j}
$$
$$
\frac{\partial{(an^2)}}{\partial{n_i}} = 2\sqrt a_i\sum_jn_j\sqrt a_j
$$
However, when I take the derivative of the expression involving the constant $k_{ij}$ I get the following:
$$
\frac{\partial{an^2}}{\partial{n_i}} = 2an_i(1-k_{ii})\sum_jn_j(1-k_{ij})\sqrt{a_j}
$$
Wondering if anyone has insight into a more clear, systematic way to take a partial derivative of a double sum. NOTE: $a_i,a_j,k_{ij}$ are all considered to be constants and $n$ is the total number of moles and therefore also a constant.
Best Answer
Let's consider the partial derivative of $an^2$ with respect to the variable $n_{i_0}$.
\begin{align*} \frac{\partial\left(an^2\right)}{\partial n_{i_0}} =\frac{\partial}{\partial n_{i_0}}\sum_{i}\sum_{j}n_in_j(1-k_{ij})\sqrt{a_ia_j}\tag{1} \end{align*}
Note: We should avoid using the same variable name for different purposes. Since $i$ is used as bounded index variable on the RHS, we should not use $n_i$ as variable for the partial derivative on the LHS.
Comment:
In (1) we split the double sum in portions according to $i_0$ equal to $i,j$ resp. not equal to $i,j$.
In (2) we do some simplification. In fact (1) is only written for demonstration and we could start the apportionment with (2) instead.
In (3) we do the partial differentiation and rearrange the terms in (4)
Note: If $k_{i,j}=0$ for all $i,j$ we obtain from (5) in accordance with OPs example \begin{align*} 2\sqrt{a_{i_0}}\sum_{j}n_j\sqrt{a_j} \end{align*}