# Replacing variables after Legendre transformation

I have the internal energy of a system as a function of entropy $$S$$, number of particles $$N$$ and volume $$V$$: $$U(S,V,N) = \left(\frac{v_0 \theta}{R^2} \right)\frac{S^3}{NV}$$ I need to find the chemical potential $$\mu$$ as a function of $$T$$, $$V$$ and $$N$$. I performed the following Legendre transformation: $$F = U - TS = \left(\frac{v_0 \theta}{R^2} \right)\frac{S^3}{NV} - TS$$ From the first and second laws of thermodynamics: $$dF(T,V,N) = -SdT - pdV + \mu dN$$ Therefore the natural variables of $$F$$ are $$T$$, $$V$$ and $$N$$. Also $$F$$ having an exact differential means, I can write: $$\mu(T,V,N) = \frac{\partial F}{\partial N}(T,V,N) = - \left(\frac{v_0 \theta}{R^2} \right)\frac{S^3}{N^2V}$$

How to calculate $$S(T,V,N)$$ to substitute in the above equation and thus getting rid of the explicit $$S$$?

$$T(S,N,V) = \frac{\partial U}{\partial S} (S,N,V)$$
and that under certain conditions on these functions we can invert this relation to find $$S(T,N,V)$$. We then define
$$F(T,N,V) = U(S(T,N,V),N,V) - T S(T,N,V) \quad .$$
So all the $$S$$ that appear on the RHS of the above equation are understood as functions of $$T,N,V$$. Indeed, we find $$\frac{\partial F}{\partial T} (T,N,V) = -S(T,N,V) \quad .$$