I've had this doubt for quite a while, This link https://chem.libretexts.org/Bookshelves/Physical_and_Theoretical_Chemistry_Textbook_Maps/Map%3A_Physical_Chemistry_for_the_Biosciences_(Chang)/04%3A_The_Second_Law_of_Thermodynamics/4.08%3A_Dependence_of_Gibbs_Energy_on_Temperature_and_Pressure
Clearly states that Gibbs energy can be used to predict the reactions that are happening at constant temperature and pressure.
Still I've faced many questions like "Effect on equilibrium on a system of ideal gases (in a closed container) upon addition of inert gas (while maintaining constant volume and temperature of the container). The answers of such questions involve the concept of equilibrium and they say - Since the partial pressures of the species involved in the reactions isn't affected (upon adding inert ideal gas) so the equilibrium is not affected. Thus the reaction doesn't move in any direction, it remains in equilibrium. (The equilibrium constant involve partial pressures of gaseous species)
But my question is why can we even use the equilibrium constant and reaction quotient to predict the direction of reaction as the total pressure of the system clearly rises. (Its not constant).
The usual expression of equilibrium constant relating activities of reactants and products is derived from taking Gibbs energy change for a reaction and then using dG = 0 at equilibrium. But the latter is only true for systems under constant pressure and temperature.
Example of the link to question -
Please tell me where I'm wrong as I'm really confused right now!