Step 1: Gauss's Law
According to Gauss's Law, the total electric flux \( \Phi_E \) through a closed surface is given by:
\[
\Phi_E = \frac{Q_{\text{enc}}}{\epsilon_0}
\]
where \( Q_{\text{enc}} \) is the total charge enclosed within the closed surface.
Step 2: Calculating the Net Charge Enclosed
The charges enclosed inside the closed surface are:
\[
q, -2q, +5q
\]
Adding them together:
\[
Q_{\text{enc}} = q + (-2q) + 5q = 4q
\]
Step 3: Finding the Flux
Using Gauss's Law:
\[
\Phi_E = \frac{Q_{\text{enc}}}{\epsilon_0} = \frac{4q}{\epsilon_0}
\]
Final Answer: The electric flux through the closed surface is \( \frac{4q}{\epsilon_0} \).