# Cournot oligopoly - first-order condition

I am reading an article that has this description of the first-order condition for a Cournot n-firm game:

Take $$P(Q) = Q^{-1}$$, $$\pi_i(q_i, Q) = (Q^{-1} - c_i)q_i$$.

Then the first-order condition for an interior profit-maximizing choice of $$q_i$$ requires that

$$\frac{\partial \pi_i}{\partial q_i} + \frac{\partial \pi_i}{\partial Q} = Q^{-1} - c_i - q_iQ^{-2} = 0.$$

I am trying to understand why it is OK to simply take $$\frac{\partial \pi_i}{\partial Q}$$ ignoring the fact that $$Q$$ is actually a function of $$q_i$$. If I expand the term so that $$Q = q_i + q_{-i}$$ and take the partial derivatives $$\frac{\partial \pi_i}{\partial q_i} + \frac{\partial \pi_i}{\partial q_{-i}}$$, the solution is not the same as the one that is written in the article. Would appreciate any explanation.

Note :$$Q = \sum_{i=1}^n q_i$$.
Thus the optimisation problem of firm $$i$$ is: \begin{align} max_{x_i\in\mathbb{R}_+}\pi_i(q_i,Q) \end{align} where $$\pi_i(q_i,Q) = \big(Q^{-1}(q_i;q_{-i}) -c_i\big)q_i$$. Assuming interior solution, the first order condition is \begin{align} \frac{\partial\pi_i}{\partial q_i} + \frac{\partial \pi_i}{\partial Q}\frac{\partial Q}{\partial q_i} &= 0\\ \implies (Q^{-1} - c_i) + (-1)Q^{-2}q^*_i* 1 &= 0\\ \implies q^*_i &= Q(1-Qc_i) \end{align}
In the context where $$Q = \sum_i q_i$$ the equation $$\frac{\partial \pi_i}{\partial q_i} + \frac{\partial \pi_i}{\partial Q} = \frac{\partial \pi_i}{\partial q_i} + \frac{\partial Q}{\partial q_i}\frac{\partial \pi_i}{\partial Q}$$ holds as $$\frac{\partial Q}{\partial q_i} = 1.$$