So I was reading the textbook today, and I see this picture for the temperature profile through the boundary layer.
Look at the positions of $T_w$ and $T_b$ relative to the $y$-axis - $T_w$ is lower than $T_b$.
So the question then, is why does the temperature increase in the middle of the boundary layer in the first diagram and not for the second?
The second diagram is graphing stagnation temperature, not static temperature. When turbulence/viscosity converts kinetic energy to thermal, it increases the static temperature but the stagnation temperature remains constant. (Stagnation temperature is the total of thermal energy + kinetic energy). So the bulge in the first image is because the static temperature increases from turbulence/viscosity converting the kinetic energy, no bulge in the second because it's showing stagnation temperature which already includes the kinetic energy.
The wall temperature determines t$_w$ due to heat transfer between wall and the air close to it.
The boundary temperature t$_b$ is simply the temperature of air outside and at the outer limit of the boundary layer. So much is obvious.
In between, friction will heat up the air, and the steeper the speed gradient is, the more friction heat will be set free. This means that the boundary temperature will increase only slowly as one moves into the boundary layer from the outside. Closer to the wall frictional heating will increase and have its peak close to the wall, where cooling from contact to the wall is still small. Directly at the wall this cooling effect from contact with the wall will become dominant, so there is again a steep drop in air temperature.
Only when the wall has been heated up by the boundary layer such that there is no cooling effect, the temperature profile in the bottom graph will occur. This is the case for a surface of little heat capacity and an equilibrium condition with no more heat transfer between air and wall.