I use a direct method to extract the longitudinal structure function in the next-to-leading order approximation with respect to the number of active flavor from the parametrization of parton distributions. The contribution of charm and bottom quarks corresponding to the gluon distributions (i.e., Gn f =3(x, Q 2 ) and Gn f =5(x, Q 2 )) is considered. I compare the obtained longitudinal structure function at n f = 4 with the H1 data [Eur.Phys.J.C74, 2814(2014) and Eur.Phys.J.C71, 1579 (2011)] and the result L.P. Kaptari et al.[ Phys.Rev.D99, 096019(2019)] which is based on the Mellin transforms. These calculations compared with the results from CT18 [Phys. Rev.D103, 014013(2021)] parametrization model. The nonlinear effects on the gluon distribution improve the behavior of the longitudinal structure function in comparison with the H1 data and CT18 at low values of Q 2 .