Starting point: S(E,V,N) is extensive: S(cE,cV,cN)=cS(E,V,N)

Differentiate both sides with respect to c:

∂S∂cE⋅E+∂S∂cV⋅V+∂S∂cN⋅N=S(E,V,N)

Set c=1 and substitute the definitions ∂S∂E=1T, ∂S∂V=PT, ∂S∂N=−μT:

ET+PTV−μTN=S

Result:

E=TS−PV+μN

Gibbs-Duhem — take total derivative of the Euler equation:

dE=TdS+SdT−PdV−VdP+μdN+Ndμ

Subtract the fundamental relation dE=TdS−PdV+μdN:

SdT−VdP+Ndμ=0