Why don't we get infinite energy from a continous emission spectrum? If the spectrum emitted contains all kinds of photons of all kinds of wavelengths, doesn't that mean it should have infinite number of photons of very small energies? For example, 4000 angstrom to 7500 angstrom spectrum would have all wavelengths falling between this range. Which means all energies falling between the range of 1.65eV to 3.1eV. Any fractional value between these, which are numerically infinite. Where am I going wrong?
 A: You should think about the energy spectrum (which is your emission spectrum times photon energy in the function of frequency/wavelength) like a density function. Then if you want to specify the energy of your radiated light you need to specify the volume in which your photons are present. Let's think about our atmosphere for a second. Its density varies with height. So you can state infinitely many different densities along the way from the ground to the space. But it does not mean that a "slice" of our atmosphere over $1\,\mathrm{km}^2$ has an infinite mass. What you do is an integral of your density over volume i.e. you do a sum of infinite different densities over infinitely small volumes, which gives you a finite number. The same applies to integrating an emission energy spectrum.
A: I think at the core of the question lies the problem of identifying a definite integral with an infinite sum. I.e. thinking among the lines that
$$
\int_{\lambda_{a}}^{\lambda_{b}} \rho_E(\lambda)d\lambda \stackrel{?}{=} \sum_{n=0}^\infty \int _{\lambda_n}^{\lambda_n}\rho_E(\lambda _n)d\lambda \stackrel{?}{=} \sum_{n=0}^\infty E_n = \infty
$$
This is wrong. Integrals are generally not the same as infinite sums. You may approximate an integral by a finite Riemann sum and we can define integrals as limit of a Riemann sum, but at no point do we set the integral exactly equal to a pure infinite sum of single points.
We can sometimes use uniformly convergent series expressions for functions to find the value of an integral, but that is not the same as summing up single points, as written above.
See also:

*

*https://math.stackexchange.com/questions/410541/integration-and-area-why-is-integrating-over-a-single-point-zero

*https://math.stackexchange.com/questions/2866672/riemann-integral-on-a-single-point
A: You are assuming that for every frequency there is a photon emitted at any time. But in practice, as you make your frequency range smaller, the number of photons emitted decrease.
This is perhaps best seen in the Planck radiation law, which states that a blackbody at temperature $T$ emits energy at power $$B_\nu(T)=\frac{2h}{c^2}\frac{\nu^3}{e^{(h\nu/k_B T)}-1}.$$ This is a continuous spectrum, $B_\nu(T)>0$ for all frequencies, but the total energy emitted is finite. What the formula above tells you is that the total energy in a frequency range $\nu_1,\nu_2$ is $\int_{\nu_1}^{\nu_2} B_\nu(T) d\nu$. But as you let $\nu_1\rightarrow \nu_2$ this approaches zero.
Photons viewed as discrete particles have energy $h\nu$, so for high frequencies you get fewer photons per second. You can think of emission when $B_\nu(T)$ is small as having a low probability per second of emitting a photon in the range $[\nu,\nu+d\nu]$.
The derivation of the radiation law above historically also explained why you don't get an infinite number photons at very small or very high energies (due to quantization).
