# How to determine heat exchanger equation?

What is the equation to determine the inside surface temperature along the length of the counter flow heat exchanger?

The temperature equations for a counter flow exchanger are the same for a parallel flow exchanger as long as steady-state is a valid assumption, so the flow must be fully developed and the temperature profile must be fully developed. For a differential element where the flow travels along $x$ we have the conservation of heat. Properties are known about substances and geometry and we analyze only the averages across the pipe's cross sections, $P$ is perimeter, $h$ is convection coefficient, $c_p$ fluid specific heat at average temperature, $T_m$ and constant (from steady state) average mass flow rate, $\dot{m}$.
$$Q_{in,pipe}+Q_{in,conv} = Q_{out}$$ $$\dot{m} c_p T_m(x) + h P dx (T_m(x) - T_s(x)) = \dot{m} c_p T_m(x+dx)$$
$$\frac{\dot{m} c_p}{h P dx} \frac{dT_m(x)}{dx} + T_m(x) = T_s(x)$$