The entropy $S$ of a Van der Waals fluid is: $$ S(U,V,N) = S_0 + NR\ln\left[\left(\frac{V}{N}-b\right)\left(\frac{U}{N}+a\frac{N}{V}\right)^c\ \right] $$ I understand how to get from the equation of the entropy $S(U,V,N)$ to the equation of $F(T,V,N)$, but I don't know how to do the inverse process. I'm going to put my procedure that I followed: \begin{eqnarray} U(S,V,N) &=& N\left[\left(\frac{V}{N}-b\right)^{-1/c}\exp\left(\frac{S-S_0}{NRc}\right) - a\frac{N}{V}\right] \end{eqnarray} By the definition of temperature $T$: $$ T(S,V,N) =\left(\frac{\partial U}{\partial S}\right)_{V,N} = \frac{1}{Rc}\left(\frac{V}{N}-b\right)^{-1/c}\exp\left(\frac{S-S_0}{NRc}\right) $$ then clearing $S$ in the equation: $$ S(T,V,N) = S_0 + NRc\cdot\ln\left[RcT\ \left(\frac{V}{N}-b\right)^{1/c}\right] $$ $$ S(T,V,N) = S_0 + NR\cdot\ln\left[(RcT)^c\ \left(\frac{V}{N}-b\right)\right] $$ then if $T$ is replaced in $U(S,V,N)$: $$ U(T,V,N) = N\left[RcT - a\frac{N}{V}\right] $$ Thus $F(T,V,N)$ is given by: $$ F(T,V,N) = U-TS = RcTN - a\frac{N^2}{V} - T\left(S_0 + NR\cdot\ln\left[(RcT)^c\ \left(\frac{V}{N}-b\right)\right]\right) $$
My problem is this: I know that $\displaystyle S = -\left(\frac{\partial F}{\partial T}\right)_{V,N}$, but if I derivate $S$: $$ S(T,V,N) = -\left(\frac{\partial F}{\partial T}\right)_{V,N} = S_0 + NR\ln\left[(RcT)^c\left(\frac{V}{N}-b\right)\right] $$ And I don't know how to continue to get to my first equation. Is there something wrong?