I'm following Wikipedia's derivation of Maxwell-Boltzmann statistics.
After applying Lagrange multipliers, we arrive at this expression for energy:
$${\displaystyle E={\frac {\ln W}{\beta }}-{\frac {N}{\beta }}-{\frac {\alpha N}{\beta }}}$$
with $\alpha$ and $\beta$ as the constants emerging from the constraints.
Next, it is explained that Boltzmann simply identified this as an expression of the fundamental thermodynamic relation:
$${\displaystyle E=TS-PV+\mu N}$$
and just set the constants $\alpha$ and $\beta$ equal to $-\mu/kT$ and $1/kT$ to set the expression so that they are equal.
I can understand that setting the constants in this way does make the expressions same, but why is it physically or mathematically justified? I've been taught the method of Lagrange and we always had to solve a system of equations to figure out the constants and then finally solve the maxima or minima. But here we are simply setting the constants so that we can arrive at a nice expression, but why is it ok to just set the constants this way and conclude that we have arrived at something that represents reality?