Chemistry - Why is dG = dH − TdS?

Solution 1:

Why is dG=dH-TdS?

It isn't. That would only be true at constant temperature. In general:

$$\mathrm{d}G = \mathrm{d}H - T\,\mathrm{d}S - S\,\mathrm{d}T$$

Solution 2:

If you write $\mathrm{d}G = \mathrm{d}H - T\,\mathrm{d}S$, you drop off one term of the differentiation of $G$ which is $S\mathrm{d}T$. By definition $G = H - TS$. So, $$\mathrm{d}G = \mathrm{d}H - T\,\mathrm{d}S-S\,\mathrm{d}T$$ Then, you should write $\mathrm{d}H = T\,\mathrm{d}S + V\,\mathrm{d}p$ (not as you have written $\mathrm{d}H = S\,\mathrm{d}T + V\,\mathrm{d}p$ ).

Finally, $$\mathrm{d}G = T\,\mathrm{d}S + V\,\mathrm{d}p - T\,\mathrm{d}S - S\,\mathrm{d}T$$ $$\mathrm{d}G = V\,\mathrm{d}p - S\,\mathrm{d}T$$