Let $A$ be a domain and $G$ a finite group of automorphisms of $A$. I define $$A^G=\{a\in A\mid\sigma(a)=a ,\forall\sigma\in G\}.$$ Furthermore let $S\subset A$ be multiplicatively closed such that $\sigma(S)\subset S$ for all $\sigma\in G$ and we write $S^G=S\cap A^G$. I want to show that $$(S^G)^{-1}A^G\cong(S^{-1}A)^G.$$ (Atiyah and Macdonald, Introduction to Commutative Algebra, Exercise 12, Chapter 5.)
First off, I'm not really sure what is meant by $(S^{-1}A)^G$ here, so it would be nice if somebody could try to guess what would be the most natural interpretation of this.
Regarding the general procedure: I only know that $A$ is integral over $A^G$, which would give me $(S^G)^{-1}A$ being integral over $(S^G)^{-1}A^G$, though I'm not sure if this would be helpful even if I knew what $(S^{-1}A)^G$ was. So depending on this, maybe a little hint would also be nice.
Thanks in advance.