In this study, we tackle the pressing issue of environmental contamination, mainly focusing on the adverse effects of air pollution and carbon dioxide \((\text{ CO}_2)\) emissions on living beings and their habitats. Carbon dioxide, alongside other major contributors such as solid, liquid, and gaseous fuels, stands as a significant perpetrator of global warming. Our approach involves developing a non-homogeneous differential equation to model carbon dioxide emission, considering the influence of these significant contributors as an input function. The input function is derived using a differential operator as a smoother, and a penalized least square criterion is implemented to estimate the parameters using functional data analysis techniques. The proposed model is applied to historical carbon dioxide emission data and their key constituents in the continental United States from 1882 to 2014. The results show that the model effectively captures emission trends. The model was further employed to forecast emissions for the period 2015–2021, where it exhibited superior predictive accuracy over existing approaches, underscoring its utility as a forecasting tool. This novel approach provides a deeper understanding of the dynamics among key attributing variables and their impacts on the rate of change in carbon dioxide emissions, thereby offering valuable insights for environmental management and policy decisions.