Because of the effects of background and measurement environment and multiplet effects of different elements, high-precision analysis of mixed capture -ray energy spectra of complicated formations remains challenging for geochemical elemental logging. The direct demodulation (DD) method makes full use of the measured data information, enabling physical constraints to be rationally applied to the spectral analysis process, and can yield high-precision elemental content from poor-statistics, low signal-to-noise ratio, and disturbed data. We construct mixed formations of different sandstones and limestones, mixed formations of sandstone and anhydrite, and more complicated mixed formations of multiple lithologies and employ Monte Carlo numerical simulations to obtain the neutron-capture -ray energy spectra of these mixed formations. We then employ the DD method and the weighted-least-squares (WLS) method to analyze quantitatively such mixed spectra, respectively, and compare the results with the actual contents of formation elements. The results indicate that the DD method offers higher precision spectral analysis compared with the results of the WLS method. The results for the capture -ray energy spectra of the formation for two actual wells also indicate that the DD method can be useful for spectral analysis in actual application.