Derivation of Helmholtz free energy and associated relation I am quite new in thermodynamics and I have never touched it so far. But now I have some basic questions that I hope someone can kindly explain them to me. 
I know the Helmholtz free energy is defined as
$$\Phi= U - T S,$$
where $U$ is the internal energy, $T$ is the temperature and $S$ is the entropy. 
The first question is how to derive this equation and what are the basic assumptions? I went through some books but they are just accepting it as a presumption. 
Next, I would like to know how to derive the following relation,
$$S=-\frac{\partial \Phi}{\partial T},$$
from the first question. 
 A: In thermodynamic, you can define what is called thermodynamic potential. Their are definition. But you can see them as legendre tranformation with respect to some variable. One of the point is that by defining these thermodynamic potential you change the variables e.g. for the Helmholtz free energy, you have:
$$ F(T,V) = U-TS$$
The variable $F(T,V)$ are important here and tell you that you can derivate F with respect to T and V. But derivate with respect from $S$ will make no sense. Whereas for the intern energy $U(S, V)$ derivating with respect to $S$ make sense, bu derivation with respect to $T$ does not.
For the second question, why $\frac{\partial F}{\partial T} = -S$, you can do the following derivation: $d F = dU - TdS - SdT$, you know that $dU = TdS-pdV$ so you have
$$ dF = -SdT - pdV $$
ANd by definition of a differential of the function f(x,y) you have $df= \frac{\partial f}{\partial x} dx+ \frac{\partial f}{\partial y}dy$. Apply to the Helmholtz free energy $F(T,V)$:
$$dF = \frac{\partial F}{\partial T} dT+ \frac{\partial F}{\partial V}dV$$
This is just applying the definition of differential of $F(T,V)$. By identification you get the two equalities:
$$ S = -\frac{\partial F}{\partial T} \quad \text{and} \quad p = -\frac{\partial F}{\partial V}$$ 
