In Gregory's Classical Mechanics there's a proof that when a standard system is conservative, the generalized forces $Q_j$ can be written as a potential. But I can't seem to explain some steps in the proof. It goes like this:
Let $q^A$ and $q^B$ be two points of the configuration space that can be joined by a straight line parallel to the $q_j$-axis (why is this necessary?). Then
$\int_{q_A}^{q_B} Q_jdq_j = \int_{q_A}^{q_B} (\sum_i F^S_i \cdot \frac{\partial r_i}{\partial q_j})dq_j = \sum_i \int_{C_i} F^S_i \cdot dr = V(q^A) - V(q^B) = - \int_{q_A}^{q_B} \frac{\partial V}{\partial q_j}dq_j $ and since these hold for any two points in configuration space thus described, the integrands are equal.
Some words on notation:
$F^S_i$ are the specified forces acting on the particle $P_i$.
$\int_{C_i} F^S_i \cdot dr$ means the work done by $F_i$ on a particle moving along any path connecting $q^A$ and $q^B.$
The first equality is just using the defintion, as is the last one. So I'm mainly wondering about the justification for the second and third equalities.
Edit: I suppose you can define $V := \sum_i V_i$ which explains the third equality. Is this correct?