How to convert bandwidth from wavelength to energy?

I have an x-ray emission spectrum obtained using wavelength dispersive spectroscopy (WDS), the spectrum gives us the number of counts (intensity) as a function of wavelength. I measured the bandwidth (FWHM) in that case it gave me about 1.3 nm, my question is how can I convert the bandwidth from the wavelength unit into energy (eV)?

I have an x-ray emission spectrum obtained using wavelength dispersive spectroscopy (WDS), the spectrum gives us the number of counts (intensity) as a function of wavelength.

The spectrum as a function of wavelength is integrated over wavelength to get counts: $$I = \int d\lambda f(\lambda)\;,$$ where you might also denote $$f(\lambda)$$ as $$\frac{dI}{d\lambda}$$

I measured the bandwidth (FWHM) in that case it gave me about 1.3 nm,

Here, you are saying there are some limits of integration: $$I_{FWHM} = \int_{\lambda_1}^{\lambda_2} d\lambda f(\lambda)\;,$$ where $$\lambda_2 - \lambda_1 = 1.3$$nm.

my question is how can I convert the bandwidth from the wavelength unit into energy (eV)?

The integral can be re-written as an integral over energy: $$I_{FWHM} = \int_{\lambda_1}^{\lambda_2} d\lambda f(\lambda) = \int_{E(\lambda_1)}^{E(\lambda_2)} dE \frac{d\lambda}{dE} f(\lambda(E))\;,$$ where $$\lambda_2 > \lambda_1$$ and where typically for a photon one will take: $$E = \frac{hc}{\lambda}\to \frac{d\lambda}{dE} = -\frac{hc}{E^2}\;.$$

So, we can write: $$I_{FWHM} = \int_{E(\lambda_1)}^{E(\lambda_2)} dE \frac{d\lambda}{dE} f(\lambda(E)) = -\int_{hc/\lambda_1}^{hc/\lambda_2} dE \frac{hc}{E^2}f(\lambda(E)) = \int_{hc/\lambda_2}^{hc/\lambda_1} dE \frac{hc}{E^2}f(\lambda(E))\;,$$ so the FWHM bandwidth in terms of energy is: $$\Delta E_{FWHM} = hc\left(\frac{1}{\lambda_1} - \frac{1}{\lambda_2}\right)$$

The most correct way is to determine the wavelengths $$\lambda_1$$ and $$\lambda_2$$ on either side of your peak $$\Delta\lambda$$, convert each of those to energy via $$E=hc/\lambda$$, then compute $$\Delta E$$.

For small $$\Delta\lambda$$, it is also approximately true that:

$$\frac{\Delta\lambda}{\lambda_0}\approx\frac{\Delta E}{E_0}$$

where $$\lambda_0$$ and $$E_0$$ are the center points of your peak.