# Why is dG=dH-TdS?

I get that $G=H-TS$ because then: $\mathrm dG=\mathrm dH-T\mathrm dS-S\mathrm dT=T\mathrm dS+V\mathrm dp-T\mathrm dS-S\mathrm dT$. Therefore, by cancelling: $\mathrm dG=V\mathrm dp-S\mathrm dT$ which is the equations for $\mathrm dG$. However, I can’t get this result from using $\mathrm dG=\mathrm dH-T\mathrm dS$.

$$\mathrm dH=S\mathrm dT+V\mathrm dP$$ $$\mathrm dG=(S\mathrm dT+V\mathrm dp)-T\mathrm dS$$

This does not give me the right equation. Where am I going wrong?

$$\mathrm{d}G = \mathrm{d}H - T\,\mathrm{d}S - S\,\mathrm{d}T$$
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$$