
Firstly, some assumptions:
- water temperature $T_{\infty}$ is uniform and constant,
- nitrogen gas flow is highly turbulent, plug flow. Because nitrogen viscosity is very low, that is a reasonable assumption,
- nitrogen gas is heated by convection only. Longitunal conduction is negligle. This is a reasonable assumption because nitrogen's thermal conductivity is low,
- thermal expansion of nitrogen gas is considered neglibible.
Now look at the heat balance of an element $\mathbf{d}x$, mass $\mathbf{d}m$: it receives a heat flux $\frac{\mathbf{d}q}{\mathbf{d}t}$, in accordance with Newton's cooling/heating Law:
$$\frac{\mathbf{d}q}{\mathbf{d}t}=2 \pi r_o R\mathbf{d}x[T_{\infty}-T(x)]\tag{1}$$
Where $R$ is the thermal resistance, I'll come back to it extensively below. $r_o$ is the outside radius of the pipe.
Now we also know that:
$$\mathbf{d}q=c_p\mathbf{d}m\mathbf{d}T(x)$$
Dividing both sides by $\mathbf{d}t$ and because $\frac{\mathbf{d}m}{\mathbf{d}t}=\dot{m}$, we get with $(1)$:
$$c_p\dot{m}\mathbf{d}T(x)=2 \pi r_o R\mathbf{d}x{R}[T_{\infty}-T(x)]\tag{2}$$
where $c_p$ is the constant pressure heat capacity of the nitrogen gas and $\dot{m}$ its mass flow through the pipe.
Now for ease of reading, set:
$$\alpha=\frac{2\pi r_o R}{c_p\dot{m}}$$
And with $(2)$, rearrange slightly:
$$\frac{\mathbf{d}T(x)}{T_{\infty}-T(x)}=\alpha \mathbf{d}x\tag{3}$$
Integrating $(3)$ between $(0,L)$ and $(T_0,T(L))$ we get:
$$-\ln\Big[\frac{T_{\infty}-T(L)}{T_{\infty}-T_0}\Big]=\alpha L$$
Slight reworking then yields:
$$\boxed{T(L)=T_{\infty}-(T_{\infty}-T_0)e^{-\alpha L}}\tag{4}$$
Note that for $L \to +\infty$, $T(L) \to T_{\infty}$.
Thermal Resistance:
A full treatise of the concept of themal resistance is outside the scope of this answer. May I suggest you read up on it here.
In our pipe problem we have three components to the thermal resistance:
- outer convection zone: water to pipe ($R_1$),
- conduction zone: heat conducting through circular pipe wall ($R_2$),
- inner convection zone: pipe to nitrogen gas ($R_3$).
The overall thermal resistance $R$ is obtained from:
$$\frac{1}{R}=\frac{1}{R_1}+\frac{1}{R_2}+\frac{1}{R_3}$$
where:
- $R_1=h_o$, the outer (convection) heat transfer coefficient,
- Conduction zone:
$R_2=\frac{1}{k_{Cu}}\ln\frac{r_o}{r_i}$
where the $r$ are outer and inner radii of the pipe and $k_{Cu}$ the thermal conductivity of copper.
- $R_3=h_i$, the inner (convection) heat transfer coefficient.