Introduction

Antibiotics are a large group of pharmaceutical substances that kill bacteria or slow their growth. They have extensive applications in medical infection treatment, accounting for approximately 15% of total drug consumption1,2,3. An important point to consider is that less than 10% of these drugs undergo any transformation in the body, while the rest are excreted unchanged4,5,6. Antibiotics can find their way into the environment through various pathways, including discharge from manufacturing sites, domestic and hospital wastewater, gradual disposal of expired medications, topical application of drugs, and washing off drugs from the skin or contaminated clothes7,8,9.

The combination of trimethoprim (TMP) and sulfamethoxazole (SMX) as cotrimoxazole is present in several pharmaceutical forms, including oral suspension, tablets, and intravenous infusion for human or veterinary use. This combination is widely used to treat urinary tract and respiratory infections10,11,12. Environmental issues due to releasing TMP and SMX antibiotics into water sources pose a serious threat. Their most significant impact lies in the toxicity to micro-organisms present in the environment, disrupting ecological balance13. TMP and SMX antibiotics can also be used as liquid manure or sewage sludge fertilizers, entering aquatic environments, soil, and the food chain, leading to microbial resistance against them14. Consequently, drug resistance may occur in individuals, making common antibiotics ineffective in responding to infections in the body15.

Several methods have been employed for the removal of antibiotic from water. These techniques include reverse osmosis, ion exchange, coagulation, membrane filtration, and adsorption16,17,18,19. However, specific approaches have not been considered due to their associated limitations, including the need for extensive maintenance, high energy, chemical consumption, and suboptimal efficiency. Adsorption is one of the most widely used techniques in wastewater treatment processes due to its simplicity and relatively low cost20. During adsorption, dissolved ions or compounds are adsorbed and remain on the adsorbent solid surface21.

Recently, nanomaterials have garnered significant attention as exceptional adsorbents, primarily due to their high specific surface area and numerous active groups. Additionally, certain nanoparticles can selectively adsorb specific compounds, making them highly versatile for diverse chemical groups22,23. Over the past two decades, research on the exceptional electrical, catalytic, optical, and magnetic properties of nanoparticles has progressed rapidly24. Among the different types of nanoparticles, metal nanoparticles have attracted considerable attention due to their unique physical and chemical properties, including their ability to penetrate into microscopic pores, colloidal stability, and resistance to aggregation in solutions25,26.

As a subset of metal nanoparticles, magnetic nanoparticles can be easily separated from solutions using an magnet, eliminating the need for centrifugation and filtration. Hematite (α-Fe2O3), magnetite (Fe3O4), and maghemite (γ-Fe2O3) are important members of the Iron family because of their anti-corrosion properties, adjustable optical and magnetic characteristics, excellent chemical stability, cost-effectiveness, and environmental friendliness27,28. Among the adsorbents, magnetite-chitosan nanoparticles (Fe3O4/CS NPs) have been used to remove pollutants from aqueous environments because of the high potential, high adsorption capacity, and high specific surface area of these nanoparticles29,30.

In a study, Karimi et al. used Fe3O4/CS nano-bio-adsorbent to remove Cd (II), Cu (II), and Zn (II) ions from an aqueous solution. The removal rate for Cd (II), Cu (II), and Zn (II) ions was 99.98%, 93.69%, and 83.81%, respectively, at pH of 5.3, a metal concentration of 10 mg L−1, the adsorbent dosage of 1 g L−1, and room temperature for 24 h31. Thinh et al. used Fe3O4/CS NPs to remove Cr (VI) from the aqueous solution. The results revealed that the highest adsorption capacity of 55.80 mg g−1 was obtained at a pH of 3 for 100 min at room temperature32. In another study, Shen et al. evaluated the removal of C. I. Acid Red 73 by magnetic chitosan-Fe (III) hydrogel. This study obtained the maximum adsorption capacity of 294.5 mg g−1 in 10 mL at a dosage of 0.02 g, a pH of 12, and 25 °C with a concentration of 50 mg L−133.

Nowadays, design of experiments (DOEs) such as response surface methodology (RSM) are used instead of classical methods (one-factor-at-a-time)34. RSM is a combination of mathematical and statistical methods used in process optimization, where many variables affect the desired response. This method can be performed to lower the number of tests, determine square regression coefficients, and evaluate the relationship between one or more responses using the influence of independent variables35,36.

Therefore, the present study aims to investigate the efficiency of Fe3O4/CS adsorbent to remove TMP and SMX from aqueous solutions. Further, the effect of pH, sonication time, adsorbent amount, and analyte concentration on the removal efficiency of contaminants is investigated. Analysis of variance (ANOVA) was used as a statistical method to analyze the responses. Moreover, BBD-based RSM was employed to achieve appropriate response levels for optimizing the removal of contaminants from aqueous solutions. Overall, this design has several advantages, such as reducing the number of tests, time, and cost and increasing removal efficiency.

Materials and method

Reagents and materials

All chemicals used in the experiments were of analytical grade. Chitosan was purchased from Aladdin Chemical Reagent Co. Ltd. Also, Iron (II) chloride, tetrahydrate, iron (III) chloride hexahydrate, trimethoprim, sulfamethoxazole, ethanol, acetone, hydrochloric acid, ammonia, acetic acid, sodium hydroxide, acetonitrile, and nitric acid were obtained from Sigma Aldrich Co. Ltd. Distilled water was used in all experiments to increase the volume of the solutions. The stock solution was prepared from each antibiotic with a concentration of 1000 mg L−1, and pH was determined via a pH-Meter. The ultrasonic bath was used to create interaction between the adsorbent and analyte. The samples containing antibiotics were analyzed by UV–Vis spectrophotometer. A centrifuge and a magnet were also used to separate the adsorbent from the solution. Adsorbent characteristics such as morphology, adsorbent shape, and phase characteristics were investigated using scanning electron microscopy (SEM), transmission electron microscopy (TEM), X-ray diffraction (XRD), pH of zero point of charge (pHzpc), vibrating sample magnetometer (VSM), and Fourier-transform infrared (FTIR).

Synthesis of Fe3O4 NPs

Fe3O4 NPs were synthesized by the co-precipitation method. To this end, a mixture of 4 mL FeCl3 (2 M) and 2 mL FeCl2 (2 M) was prepared in a flat-bottom beaker. This solution was severely stirred for 30 min at 30 °C, and chemical precipitation was formed by slowly adding 100 mL of ammonia solution (1 M) to the mixture. The steps for this process were carried out under intense stirring and N2 gas. Black Fe3O4 NPs were separated by an external magnet. Finally, the NPs were rinsed with distilled water and ethanol until the pH reached 7.

Synthesis of Fe3O4/CS NPs

Fe3O4/CS NPs were prepared using the co-precipitation method. To this end, 0.3 g of chitosan was dissolved in 50 mL of acetic acid solution (1%, V/V). Then, 2 g of Fe3O4 NPs prepared in the previous section were added to the mixture. The mixture was stirred for 30 min, followed by adding 50 mL of 1 M NaOH solution to the suspension to obtain Fe3O4/CS NPs. Finally, the prepared NPs were rinsed with distilled water until the pH reached 7 and then dried. The properties and morphology of the Fe3O4/CS NPs were investigated using SEM, VSM, pHzpc, TEM, FTIR, and XRD analyses.

pH of zero point of charge (pHzpc)

The pHzpc is the point at which the surface charge of the adsorbent is neutral. It is one of the crucial stages in determining the surface characteristics of the adsorbent. For this purpose, 10 Erlenmeyer flasks (100 mL) containing 30 mL of NaCl solution (0.01 M) were prepared, and each Erlenmeyer flask was adjusted to different pH values ranging from 2 to 11. The pH adjustments were performed using NaOH (0.1 M) and HCl (0.1 M). Subsequently, 0.2 g of the adsorbent was added to each Erlenmeyer, and the Erlenmeyers were placed on a shaker for 24 h. After 24 h and the separation of the adsorbent from the solution, the final pH was measured. The difference between the initial and final pH values was calculated, and the ΔpH curve was plotted against the initial pH values. The point where the curve intersects the X-axis is called the pHzpc.

Response surface methodology (RSM)

RSM applies experimental techniques to design and optimize the relationships between the test factors. Next, after checking the responses, it analyzes and presents graphs based on one or more criteria37. In this research, pH solution (A), analyte concentration (B), adsorbent amount (C), and sonication time (D) were selected as parameters affecting the removal performance of antibiotics. Design-Expert® software (version 10) was used to examine the effect of parameters on response performance (removal efficiency). Then, experiments were designed using Box–Behnken Design. The number of experiments was determined using Eq. (1).

$$ {\text{N}} = {\text{2K }}\left( {{\text{K}} - {1}} \right) \, + {\text{ C}}_{{\text{o}}} $$
(1)

where K is the number of investigated parameters and Co is the number of repetitions of the experiment steps38.

A total of 29 experiments (with 5 central replicates) were designed and implemented for each analyte. After selecting the model, the equation of the model and its predicted coefficients were determined through the quadratic equation (Eq. 2):

$$\mathrm{Y }={\beta }_{0}+\sum_{i=1}^{k}{\beta }_{i}{X}_{i}+ \sum_{i=1}^{k}{\beta }_{ii}{X}_{i}^{2}+ \sum_{i\le j}^{k}\sum_{j}^{k}\beta ij{X}_{i}{X}_{j}$$
(2)

where, β0, βi, βii, and βij are constant, linear, quadratic, and interaction coefficients of regression, respectively. Also, Xi and Xj denote coded independent variables, and k is the number of variables39. Statistical analysis was run to evaluate the accuracy and adequacy of the model using ANOVA, with probability values of Prob < F > 0.05. Further, the predictability and adequacy of the model were tested using the coefficient of determination of linear regression (R2), adequate precision, the lack of fit criterion, adjusted determination coefficient (Adj-R2), and detect the residuals. For the experimental design in the current study, four factors were selected, including pH, adsorbent amount, antibiotic concentration, and sonication time. Each factor was considered at three levels, as shown in Table 1.

Table 1 The BBD based on RSM.

Adsorption experiments

All adsorption experiments were done in a discontinuous system. For this purpose, 100 mL of solutions containing different concentrations of antibiotics were prepared in 250 mL Erlenmeyer flasks. Moreover, pH in the range of 3 to 9 was investigated to examine the effect of pH on the removal of analytes. Then, 0.05–0.15 g of Fe3O4/CS NPs was added to the solutions containing the analytes. The solutions prepared based on the model provided by RSM were placed in the ultrasonic bath, and the time was determined for each test by the software. Afterward, the adsorbent was separated from the sample using centrifugation and an external magnetic field. In the next step, the concentration of antibiotics was measured by UV–Vis spectrophotometer. Finally, the removal efficiency was calculated using Eq. (3).

$$\mathrm{\%R }=\frac{{\mathrm{c}}_{\mathrm{o}}-{\mathrm{c}}_{\mathrm{e}}}{{\mathrm{c}}_{\mathrm{o}}}\times 100$$
(3)

In this equation, Co (mg L−1) was the initial concentration of the analyte in the solution, Ce (mg L−1) was the equilibrium concentration of the analyte after the equilibration time, and R was the removal efficiency40.

Results and discussion

Characterization of Fe3O4/CS NPs

SEM images were captured for the Fe3O4/CS sample to examine the size of nanoparticles and their morphology (Fig. 1A). Figure 1A shows a spherical morphology and uniformity for the sample, along with appropriate granulation with no aggregation. In addition, particle size was determined between 75 and 81 nm. Figure 1B illustrates the TEM image of Fe3O4/CS adsorbent. The TEM image in Fig. 1B confirms the sample’s spherical morphology and uniform size. Moreover, the magnetic property of the synthesized Fe3O4/CS sample was tested by the VSM method at room temperature (Fig. 1C). The magnetic diagram for the sample is similar to the letter S, and the curved shape of the sample confirms the superparamagnetic property of the sample. In addition, the degree of saturation of the sample was equal to 25 emu g−1. This value suggests the high magnetic property of the sample and its easy separation from the reaction environment by an external magnet. The magnetic property of the sample was compared by performing VSM analysis for the pure iron oxide nanoparticles. For the pure Fe3O4 sample, the saturation magnetization was 59 emu g−1, which is much higher than that of the Fe3O4/CS composite sample. This result indicates the presence of chitosan next to iron oxide nanoparticles and the change of iron percentage in the sample compared to its pure ratio. XRD analysis was performed to identify and confirm the structure of Fe3O4/CS crystals. For the Fe3O4/CS sample, the position and relative intensity of all peaks according to the standard XRD pattern for Fe3O4 NPs is JCPDS card no. 1436-8541. The presence of sharp peaks with high intensity indicates a good network structure. On the other hand, the absence of additional peaks confirms the purity and the absence of impurities in the produced sample (Fig. 1D). Seven peaks with angles of 30.2°, 35.8°, 43.5°, 53.7°, 57.4°, 62.8°, and 75.3° and corresponding crystal plates of 220, 311, 400, 422, 511, 440, and 622, respectively, were identified in the spectrum. These peaks are related to iron oxide nanoparticles with a cubic spinel lattice structure. Moreover, the weak broad peak that appeared at the angle of 21–28 is related to chitosan, which is present in the substrate of the magnetic composite sample. The size of Fe3O4/CS crystals was about 70 nm using the Debye–Scherrer Equation. The results of pH determination showed that the Fe3O4/CS adsorbent surface has zero electric charge at pH = 4.9 (Fig. 1E). Therefore, the adsorbent surface will have a positive electrical charge at a pH lower than pHzpc and a negative electrical charge at a pH higher than pHzpc. FTIR spectroscopy was used to identify and confirm the structure of Fe3O4/CS NPs. For this purpose, FT-IR analysis was carried out from two combinations of Fe3O4/CS NPs, CS. Besides, FT-IR analysis of Fe3O4/CS NPs was also performed after 6 cycles of sorption and desorption. In the FT-IR spectrum related to chitosan, the broad peak at 3427 cm−1 is related to the stretching vibrations of amine and hydroxyl groups on the chitosan chain, and the peaks at 2922 cm−1 and 2851 cm−1 are attributed to the stretching vibrations of carbon-hydrogen bonds. The bending vibrations related to the nitrogen–hydrogen bond appear at 1649 cm−1 and the peak at 1262 cm−1 is related to the carbon–oxygen stretching of the first type of alcohol in the chitosan chain. The double peaks at 1093 cm−1 and 1027 cm−1 are attributed to the carbon–oxygen stretching vibrations of the chitosan structure. The FT-IR analysis of Fe3O4/CS NPs shows well all the peaks related to chitosan with a slight shift, in addition to the sharp and distinct peak at 576 cm−1 related to the stretching vibration of the iron-oxygen (Fe–O) bond, which is added to it. It confirms the presence of iron oxide nanoparticles in the composition. Also, as shown in Fig. 1F, these peaks were again observed with full intensities like the initial absorbance when performing the desorption processes.

Figure 1
figure 1

(A) SEM image, (B) TEM image, (C) VSM magnetization curve, (D) XRD pattern, (E) pHzpc, and (F) FTIR analysis of Fe3O4/CS NPs adsorbent and after 6 cycles of sorption desorption processes.

Statistical analysis

Design Expert software was used for regression analysis, drawing RSM graphs, and ANOVA. ANOVA results are presented in Tables 2 and 3. The tables show the parameters and statistical analysis of the presented second-order model for removing TMP and SMX. The determination coefficient (R2) and adjusted determination coefficient (Adj-R2) were used to estimate the goodness of the fit of the model. The high value of R2 (i.e., 0.9993 for TMP and 0.9973 for SMX) indicates that the model can explain more than 99.7% of the variation. Also, the value of Adj-R2 more than 0.99 shows a high degree of correlation between the experimental and predicted values. Therefore, the closer the R2 and Adj-R2 are to 1, the better the model describes response changes as a function of independent variables. The significance of the model for removing the contaminants is expressed by F-value, which was 1433.03 and 373.25 for TMP and SMX, respectively. Adeq-Precision shows the difference between the model’s predicted response and the average value of the prediction error. When this criterion is greater than 4, it indicates the acceptable discrimination power of the model. In this study, Adeq-Precision for removing TMP and SMX was 113.73 and 65.61, respectively. Another parameter used to evaluate the model is the lack of fit (LOF) test. This test is significant if the P-value of the model is greater than 0.05 (95% significance level). Tables 2 and 3 show that the P-value for removing TMP and SMX is greater than 0.05. Quadratic equations (Eqs. 4 and 5) demonstrate the mathematical relationship between the parameters for removing TMP and SMX using RSM.

$$ \begin{aligned} \% {\text{Removal-TMP}} &= + {88}.{23 } + {8}.{42}*{\text{A }} - {1}.{46}*{\text{B }} + {3}.{12}*{\text{C }} \hfill \\ & \quad - {4}.{21}*{\text{D }} - {6}.{87}*{\text{A}}*{\text{B}} - {24}.{84}*{\text{A}}*{\text{C}} - {1}.0{2}*{\text{A}}*{\text{D}} \hfill \\ & \quad + {16}.{46}*{\text{B}}*{\text{C}} - {12}.0{1}*{\text{B}}*{\text{D}} - {7}.{42}*{\text{C}}*{\text{D}} - {25}.{13}*{\text{A}}^{{2}} \hfill \\ & \quad - {25}.{53}*{\text{B}}^{{2}} - {1}.{83}*{\text{C}}^{{2}} - {17}.{25}*{\text{D}}^{{2}} \hfill \\ \end{aligned} $$
(4)
$$ \begin{aligned} \% {\text{Removal-SMX}} & = + {93}.{14 } + {3}.{42}*{\text{A }} - {2}.{48}*{\text{B }} + {6}.{69}*{\text{C }} \hfill \\ & \quad- {5}.{3}0*{\text{D }} - {2}.0{2}*{\text{A}}*{\text{B}} - {17}.{75}*{\text{A}}*{\text{C}} + {3}.{61}*{\text{A}}*{\text{D}} \hfill \\ & \quad+ {9}.{79}*{\text{B}}*{\text{C}} - {4}.0{5}*{\text{B}}*{\text{D}} - {1}.{85}*{\text{C}}*{\text{D}} - {18}.{81}*{\text{A}}^{{2}} \hfill \\ & \quad- {15}.{75}*{\text{B}}^{{2}} - {6}.{12}*{\text{C}}^{{2}} - {12}.{77}*{\text{D}}^{{2}} \hfill \\ \end{aligned} $$
(5)
Table 2 ANOVA for response surface quadratic model for removal of TMP.
Table 3 ANOVA for response surface quadratic model for removal of SMX.

The positive sign in front of the parameters displays the synergistic effect of the variable on the model. Meanwhile, the negative sign indicates a decreasing or opposite effect on the model. When an increase in the value of one variable is followed by an increase in the value of another variable, a positive correlation coefficient is obtained, which indicates synergy. On the other hand, when a reduction in the value of one variable is followed by a reduction in another variable, a negative correlation coefficient is obtained, indicating disintegration. Table 4 presents the experimental results and the results obtained from the Design-Expert® software for removing TMP and SMX.

Table 4 BBD matrix for removal of TMP and SMX.

In addition to the mentioned criteria to evaluate the model’s accuracy, the difference between the experimental and predicted residuals was used to test the model’s accuracy (Figs. 2, 3, 4). The residuals are considered unfit changes by the model. Figure 2A and B present the residual diagram for evaluating the normal distribution of the residuals. The points in the normal graph of the residuals form a straight line, confirming the normal distribution of residuals.

Figure 2
figure 2

Normal plot of residuals for (A) TMP and (B) SMX.

Figure 3
figure 3

Graph of actual values versus predicted values for (A) TMP and (B) SMX.

Figure 4
figure 4

Box–Cox curve for (A) TMP and (B) SMX.

Figure 3A and B display the actual versus predicted values for each model. The response values against the actual values are presented to help identify values or groups of values not predicted by the model. According to Fig. 3A and B, there is a trivial difference between predicted values and the experimental results.

Figure 4A and B provide Box–Cox curves. This figure is a tool to identify the most appropriate power transfer function to be applied to the response. The lowest point in the Box–Cox graph reflects the best Lambda value (Lambda: the minimum residual sum of squares in the transformed model). This figure also illustrates a 95% confidence interval. According to the Box–Cox graph, the value of Landa was considered equal to 1, and no transformation was needed. The graphs related to the adequacy of the model also exhibit the good performance of the model.

Three-dimensional

The effect of changes in TMP concentration on TMP removal efficiency in optimal conditions (pH of 6, adsorbent amount of 0.13 g/100 mL, and sonication time of 15 min) is presented in Fig. 5A. Changes in TMP concentration were investigated in the range of 10 to 30 mg L−1. The results (Fig. 5A) indicated that by keeping other factors (e.g., sonication time, adsorbent amount, and pH) constant in optimal conditions, the amount of TMP ion removal reduced with increasing concentration. As a result, the highest removal efficiency was observed at a concentration of 22 mg L−1. The explanation is that with the increase in the concentration of antibiotics in the solution, the competition for access to the binding sites from the adsorbent increases, and all the binding sites are exposed to analytes. Finally, it can be concluded that with the increase in concentration, the adsorbent surface is quickly saturated, and the removal percentage decrease. In other words, at low concentrations, more effective adsorption sites are available for antibiotics. In contrast, at higher concentrations, the number of antibiotics is much higher than that of adsorption sites on the adsorbent. Hence, the adsorption of cations depends on the initial concentration, and with increasing concentration, the absorption percentage decreases. Norzaee et al. investigated the removal of penicillin G antibiotics via persulfate. The results proved that the removal efficiency decreases with the increase in the initial concentration of antibiotics42. Similar results were obtained by Gao et al. on removing antibiotics from industrial wastewater by graphene oxide43.

Figure 5
figure 5

The three-dimensional (3D) plots of removal of (A) TMP, (B) SMX, and (C) TMP.

Figure 5A illustrates the effect of pH on the removal efficiency of TMP by the adsorbent. The percentage of TMP removal increased as the pH changed from 3 to 6. Subsequently, at higher pH values, the removal of antibiotics decreased. The pHzpc of Fe3O4/CS adsorbent was calculated to be 4.9. At pH values above the pHzpc, the surface of Fe3O4/CS adsorbent becomes negatively charged due to the presence of hydroxide ions (OH-), enabling the adsorption of antibiotics. The maximum removal for TMP and SMX was observed at pH = 6. It was assumed that at pH < 6, the high hydronium ions (H3O+) concentration competes with antibiotics, leading to reduced adsorption at lower pH levels. When the pH value was > 6, the increase in alkaline conditions and OH- concentration in the solution resulted in electrostatic repulsion. Therefore, the removal efficiency decreased at higher pH values due to electrostatic repulsion. Wang and You investigated the removal of antibiotics from aqueous environments by iron oxide/activated carbon nanoparticle composite. The results showed that the removal rate of antibiotics is extremely low at a pH of less than 6. They explained this result by the high concentration of H+ ions in the experiment environment. These ions occupy the binding sites on the adsorbent surface and exhibit greater competition for surface adsorption44.

Figure 5B depicts the simultaneous effect of the two parameters (i.e., adsorbent amount and pH) on SMX removal. The results in Fig. 5B suggest that the analyte removal percentage increases with increasing the adsorbent amount. This outcome can be due to the rise in empty and unoccupied sites with increasing adsorbent content. In general, the surface adsorption of analytes increases with increasing the adsorbent since more adsorption sites will be available. When the amount of adsorbent is low, the removal percentage reduces, probably due to insufficient active sites and saturation of the adsorbent surface. In a study, Yang et al., using graphene oxide as an adsorbent to remove antibiotics from aqueous solutions, yielded results similar to those of the present research. Their results indicated that the removal efficiency increases with increasing the adsorbent amount45.

Figure 5C provides the effect of TMP concentration and reaction time on TMP removal efficiency. According to Fig. 5C, the removal efficiency increases by increasing the reaction time. The reason is that with the accumulation of analyte molecules in empty and unoccupied sites over time, the analyte concentration reduces, and the removal rate increases. Askari et al. investigated the removal of antibiotics from aqueous environments using walnut wood and magnetized with cobalt ferrite. The results revealed that the increase in time caused an increase in the removal percentage of antibiotics46. Similar results were obtained regarding the increase in removal percentage with increasing contact time in studies by Lanjwani et al., Vu et al., and Mohammed et al.47,48,49.

Optimal points

The optimal points for removing the contaminants were obtained using the Design-Expert® software, as reported in Table 5. The optimization is performed to find points with a higher removal index. This study optimized the important factors in removal efficiency (i.e., adsorbent amount, antibiotics concentration, sonication time, and pH solution). Table 5 represents the optimization results. It is of note that the experiments were done under optimal conditions to confirm the results obtained from the model prediction. The results indicated a good agreement with the removal value predicted by the model under optimal conditions.

Table 5 Optimum conditions of removal of TMP and SMX.

Desorption studies

The desorption of the analyte from the adsorbent surface for its reuse is crucial. The desorption experiments of antibiotics from the Fe3O4/CS NPs surface were carried out using various solvents such as acetonitrile, acetone, ethanol, and nitric acid. These experiments were conducted under optimal conditions for the variables. After separating Fe3O4/CS NPs using an external magnetic field, the adsorbent surface was washed with the desired solvent. Finally, the remaining antibiotic concentration was measured using a UV/Vis spectrophotometer. Among four different solvents (ethanol, acetone, nitric acid, and acetonitrile), ethanol showed the highest desorption for TMP and SMX from the Fe3O4/CS NPs (Fig. 6). Therefore, ethanol was selected as the solvent in subsequent experiments.

Figure 6
figure 6

The effect of solvent on the desorption of analyte.

Reusability of Fe3O4/CS NPs

The expanded process of desorption has been adopted to reduce the production costs of the adsorbent and minimize the remaining waste materials. Based on the results, ethanol was selected as the most efficient solvent for the desorption of TMP and SMX from the adsorbent surface. Therefore, after the absorption of TMP and SMX from the aqueous solution with Fe3O4/CS NPs, the adsorbent was recovered and reused through six consecutive cycles of desorption with ethanol. Figure 7 illustrates the efficiency of desorption over the six stages of the recovery process. According to the results, the recovery percentage for TMP and SMX only decreased by about 5% after five cycles of absorption and desorption, indicating more than 95% recovery. The acceptable reduction in adsorption capacity signifies the remarkable stability of the adsorbent and the non-degradation of the Fe3O4/CS NPs structure, which highlights the economic feasibility of synthesizing and utilizing this adsorbent for the treatment of wastewater containing TMP and SMX. Figure 7C depicts the method of separating Fe3O4/CS NPs from the sample medium.

Figure 7
figure 7

The reusability of adsorbent for removal of (A) TMP, (B) SMX, and (C) the removal illustration.

Analysis of real samples

Several water samples (i.e., tap water, wastewater, and lake water fish farm) were used to test the validity and applicability of the proposed method. Then, TMP and SMX removal experiments were carried out on real samples under optimal conditions. To this end, water samples were filtered to remove suspended particles, and then experiments were performed according to the method stated in “Synthesis of Fe3O4/CS NPs” section. According to the results (Table 6), the removal efficiency of TMP and SMX in environmental water samples was in the range of 91.23%-98.28%, indicating that the sample texture has a trivial effect on the efficiency of the method.

Table 6 Results of removal of TMP and SMX in real samples (n = 3).

Comparison with other methods

The performance comparison of the proposed adsorbent with other adsorbents is shown in Table 7. The results of Table 7 showed that the proposed method was comparable to other methods available in the literature. On the other hand, the contact time for our research was superior to other adsorbents for removing TMP and SMX. The results showed that the ultrasonic-assisted removal method significantly improves the efficiency of the removal. Also, using the optimization method with the help of RSM reduces the number of tests and the consumption of materials.

Table 7 Literature comparison of removal for TMP and SMX.

Conclusions

The present study used Fe3O4/CS NPs to determine the removal process of TMP and SMX. Accordingly, BBD-based RSM was applied to evaluate the effect of parameters on response performance. Independent variables, such as pH, sonication time, adsorbent amount, and analyte concentration, were optimized in removing TMP and SMX. The results of SEM, VSM, XRD, and TEM showed that the Fe3O4/CS NPs were successfully prepared and existed as spherical nanoparticles with an average size of about 70 nm. The large R2 coefficient guarantees the fit of the quadratic model and indicates good processing of the data under investigation. After optimization, the removal amount of TMP and SMX at a pH of 6, concentration of 22 mg L−1, adsorbent amount of 0.13 g/100 mL, and contact time of 15 min was 93.85% and 98.01%, respectively. The results of desorption studies showed that ethanol as a solvent increased the desorption efficiency of antibiotics from the adsorbent surface. Furthermore, reusability showed that Fe3O4/CS NPs could be used up to 6 times efficiently to remove TMP and SMX. The results also suggested that Fe3O4/CS NPs effectively removed TMP and SMX from real water samples and can remove TMP and SMX in the range of 91.23% to 95.95%. The results of real water samples analysis showed that the sample matrix had no significant effect on removing the TMP and SMX antibiotics from water samples. The experimental results demonstrated that Fe3O4/CS NPs could be employed successfully as environmentally friendly adsorbents for removing TMP and SMX antibiotics from the water samples.