See please recollect that random wave itself a superposition of a number of sinusoidal components. So, based on a number of sinusoidal components you have wave time history. Similarly, here when you want to superpose if you have too many infinity it is not possible practical from practical point of view it is very difficult. A more appropriate or practical approximation is used is to adopt sufficiently large number of wavelengths in equation 3 and sufficiently small intervals of frequency and direction in equation 5. That is in equation 5 smaller intervals of frequency and direction, but in equation 3 affix the number of components.