Why the collisions of molecules with the wall in kinetic theory are 'elastic'? I simply don't understand the reason such collisions are elastic.
The elastic collision should be satisfying 1. (kinetic) energy conservation and 2. momentum conservation.
Lets saying the wall is on $x = L_{x}$, and the x-dir velocity of a molecule is $ v_{x} $.
The textbook and other sources that I saw, after the collision, the velocity of a molecule changing from $ v_{x}$ to $\textrm{} -v_{x}$.
It is obvious after the collision, the kinetic energy of a molecule is the same and it is reasonable because in thermal equilibrium the internal energy of a system must be not changed (and a molecule belongs to the system).
But the momentum obviously changed ($mv_{x}$ to $\textrm{}-mv_{x}$).
Why this collision is elastic?
Should I consider the wall also as included in a system?
 A: The first point to say is that each collision with the wall conserves momentum. Momentum is always conserved in all collisions. What happens is that the momentum of the wall also changes, but the mass of the wall is large, so this only requires a very small change in velocity. In fact, to give a bit more detail, the force of the collision causes a slight bending of the wall, and this transfers the force to the whole container. So the
container would begin to move in the direction of the latest collision, but the collisions are happening very rapidly all around the walls so there are many momentum kicks to the container as a whole, in all directions, and they balance each other out.
The next thing to say is that the simple model where each collision is elastic is in fact a bit over-simplified. What really happens is that the incoming molecule typically lands on the wall, undergoing an inelastic collision, and sticks there. It stays attached for a short time called the 'dwell time', and then it is shaken off again by thermal motion or it is disturbed by another incoming atom or molecule. It is only after averaging over many such stick-and-release processes that one can claim that the energy of the molecules coming away from the wall is equal to the energy of the molecules approaching the wall. So what the simple argument is really doing is asking you to believe what is the overall result on average. It is entirely reasonable that the energies are balanced, because the whole situation is in internal thermal equilibrium. Similar claims can be made about momentum.
A: Actually the collision is perfectly elastic.
The important fact is that the mass of the wall
is much larger than the mass of the molecule.
Let's work out this in more detail.
$m$ and $v$ is mass and velocity of the molecule.
$M$ and $V$ is mass and velocity of the wall.
And we assume, before the collision the wall is at rest ($V_\text{before}=0$).
Then conservation of kinetic energy (because it is an elastic collision) gives
$$\frac{1}{2}mv_\text{before}^2=
\frac{1}{2}mv_\text{after}^2+\frac{1}{2}MV_\text{after}^2$$
and conservation of momentum gives
$$mv_\text{before}=mv_\text{after}+MV_\text{after}.$$
We can solve the two equations above for the velocities
$v_\text{after}$ and $V_\text{after}$ after the collision.
The math is straight-forward, and I omit the details here.
The result is:
$$v_\text{after}=-\frac{M-m}{M+m}v_\text{before}$$
$$V_\text{after}=\frac{2m}{M+m}v_\text{before}$$
So we see that the speed of the molecule after the collision
is a tiny bit smaller than its speed before the collision.
And the wall gets a tiny recoil velocity.
For the wall much heavier than the molecule ($M\gg m$)
this simplifies to
$$v_\text{after}\approx -v_\text{before}$$
$$V_\text{after}\approx 0$$
The take-away from this calculation is:
Because the mass of the wall is so much
larger than the mass of the molecule,
the wall receives momentum from the molecule,
but is does not receive kinetic energy.
A: Energy and momentum are always conserved. Sometimes it looks like you are losing energy because of friction but this is just a transformation of energy; kinetic energy of a macroscopic object gets converted to thermal energy (kinetic energy of microscopic particles).
So by default energy is conserved, unless there is some place where the energy can go to. That's why the energy is conserved here.
Thermal equilibrium does not apply here. We are talking about a single particle. To even define thermal equilibrium you need a lot of particles.
To see why this particular case is an elastic collision let's take a look at the equations for the velocities after an elastic collision. See this wikipedia article
$$v_1=\frac{m_1-m_2}{m_1+m_2}u_1+\frac{2m_2}{m_1+m_2}u_2\\
v_2=\frac{2m_1}{m_1+m_2}u_1+\frac{m_2-m_1}{m_1+m_2}u_2
$$
Here $u_1$ and $v_1$ are the velocities of the particle before and after the collision and  $u_2$ and $v_2$ are the velocities of the wall before and after the collision. A collision with a wall can be modeled as a collision with an object of infinite mass. The mass isn't actually infinite but it's large enough to not make a difference. So take $u_2=0$ and $m_2\rightarrow\infty$.
The equations become
$$v_1\approx-u_1+2u_2=-u_1\\v_2\approx 0\cdot u_1-u_2=0$$
So colliding with a very massive object elastically will flip your velocity.
Note: to get which values you should use in the last equation just type the mass fractions in a calculator with $m_1$ some random value and $m_2$ a very large value like 1000000.
