The wavelength (\( \lambda \)) associated with the threshold energy is related to the work function (\( \phi \)) as:
\[
\lambda = \frac{hc}{\phi},
\]
where \( h \) is Planck’s constant, \( c \) is the speed of light, and \( \phi \) is the work function in eV.
Step 1: Calculate Wavelengths
For \( \phi_A = 9 \, \text{eV} \):
\[
\lambda_A = \frac{1242}{9} = 138 \, \text{nm}.
\]
For \( \phi_B = 4.5 \, \text{eV} \):
\[
\lambda_B = \frac{1242}{4.5} = 276 \, \text{nm}.
\]
Step 2: Calculate the Difference in Wavelengths
\[
\Delta \lambda = \lambda_B - \lambda_A = 276 - 138 = 138 \, \text{nm}.
\]
Final Answer:
\[
\boxed{138 \, \text{nm}}
\]