Is the pressure uniform across a gas container having a tempeature gradient? Consider a container of length $l$, cross sectional area $A$, filled with an ideal gas of total mass $m$, in room temperature. The initial pressure and temperature of the gas are $P_i$ and $T_i$.
We now heat one edge of the container, as shown in the figure, using some type of a furnace.

After waiting enough time, this obviously results in a temperature gradient across the $x$ axis of the container. The $x=0$ edge stays in the initial temperature $T_i$, the room temperature, but the the $x=l$ edge is now hotter, and the temperature of the gas there is $T_i+\Delta T$.
If the temperature difference $\Delta T$ is small compared to the room temperature, we can write down a linear function $T(x)$ that describes the temperature of the gas along the $x$ axis:
$$T(x)=T_i\left(1+\frac{\Delta T}{T_i}\frac{x}{l}\right)$$
I am looking for an expression for the number of gas particles $N$ across the container, $N(x)$.
My trial was to use the ideal gas equation $PV=Nk_BT$, where $k_B$ is Boltzmann constant:
$$N(x)=\frac{P_f \cdot V}{k_B T(x)}$$
The question I would like to get an answer to is whether the pressure $P_f$ in the above equation has spatial dependence, and whether this gas and container system can be said to be in thermal equilibrium.
If no, than this implies that $P_f\neq P_i$, out of the consideration that the number of particles stays the same during the whole process. The new pressure $P_f$ may then be found by integrating the number density $n(x)=N/V$ over the $x$ range from $0$ to $l$, which must then be equal to $N$.
But I can't come up with any argument to why $P$ has no variation along the $x$ axis. Certainly the gas molecules in the $x=l$ side are hotter and therefore more energetic, but what is the density there? Does the molecules naturally distribute so that the gas is less dense in this hotter area?
I read in Daniel Schroeder's "An Introduction to Thermal Physics" that

When two systems are in thermal equilibrium, their temperatures are
the same. When they're in mechanical equilibrium, their pressures are
the same. [And,] When they are in diffusive equilibrium, their
chemical potential is the same.

As I see it, none of these categories fall in the above set-up.
How one should physically describe the given situation?
 A: If the pressure was higher on the hot end than on the cold end, the total force would also be higher on the hot end than on the cold end, and hence, the container would accelerate without external directed force being applied, which would contradict momentum conservation. Therefore the density must adapt accordingly, as you have already suspected. This phenomenon is probably familiar to you from hot-air balloons: the decreased density of the hot air causes the buoyancy of the balloon, while the pressure inside must be in equilibrium with outside the balloon (except for some presumably small tension stresses of the balloon nylon bag).
The state, the system is in, is not called equilibrium, but rather steady state (sorry, in the first version I almost literally translated it from german, which was wrong) because there is energy flow, although all the corresponding fields are independent of time.
However, the system is in local thermal equilibrium (there are no temperature jumps) and in local mechanical equilibrium (no pressure jumps, particularly on the hot and cold end, at the transitions towards the surroundings, means: momentum conservation). Chemical potential plays no role here, unless there are several particle types involved.
By the way, what you have indicated as an approximation (the linear temperature gradient) is even exact, if there is exactly no thermal contact to anything along the circumference area of the cylinder.
A: The gas is not at thermal equilibrium because heat is being conducted across the gas.  If gravity is not present, then the pressure will be constant, and the temperature will vary as you say.  In this case, you have $$\rho (x)=\frac{P}{kT(x)}$$ where $\rho(x)$ is the local "number density" of molecules.  The total number of molecules in the container is constant, and equal to the initial number of molecules N:$$N=A\int_0^L{\rho(x)dx}=\frac{PA}{k}\int_0^L{\frac{dx}{T(x)}}=\frac{PV}{k}\left[\frac{1}{L}\int_0^L{\frac{dx}{T(x)}}\right]$$where A is the cross sectional area.  Equivalently, $$PV=Nk\bar{T}$$where $\bar{T}$ is the average temperature given by $$\bar{T}=\frac{1}{\left[\frac{1}{L}\int_0^L{\frac{dx}{T(x)}}\right]}$$
