  We investigated CeCoIn$_5$ and LaCoIn$_5$ single crystals, which have the
same HoCoGa$_5$-type tetragonal crystal structure, using infrared spectroscopy.
However, while CeCoIn$_5$ has 4$f$ electrons, LaCoIn$_5$ does not. By comparing
these two material systems, we extracted the temperature-dependent electronic
evolution of the $f$ electrons of CeCoIn$_5$. We observed that the differences
caused by the $f$ electrons are more obvious in low-energy optical spectra at
low temperatures. We introduced a complex optical resistivity and obtained a
magnetic optical resistivity from the difference in the optical resistivity
spectra of the two material systems. From the temperature-dependent average
magnetic resistivity, we found that the onset temperature of the Kondo effect
is much higher than the known onset temperature of Kondo scattering ($\simeq$
200 K) of CeCoIn$_5$. Based on momentum-dependent hybridization, the periodic
Anderson model, and a maximum entropy approach, we obtained the hybridization
gap distribution function of CeCoIn$_5$ and found that the resulting gap
distribution function of CeCoIn$_5$ was mainly composed of two (small and
large) components (or gaps). We assigned the small and large gaps to the
in-plane and out-of-plane hybridization gaps, respectively. We expect that our
results will provide useful information for understanding the
temperature-dependent electronic evolution of $f$-electron systems near Fermi
level.
