\begin{problem*}{24.21}
Figure~P24.21 represents the top view of a cubic gaussian surface in a
uniform electric field \vect{E} oriented parallel to the top and
bottom faces of the cube.  The field makes an angle $\theta$ with side
$a$, and the area of each face is $A$.  In sumbolic form, find the
electric flux through \Part{a} face $a$, \Part{b} face $b$, \Part{c}
face $c$, \Part{d} face $d$, and \Part{e} the top and bottom faces of
the cube.  \Part{f} What is the net electric flux through the
cube?  \Part{g} How much charge is enclosed within the gaussian
surface?
\begin{center}
%           ^
%    a      E\th|
%  d   b      \ |
%    c         \|
\begin{asy}
import Mechanics;
import ElectroMag;

real u = 1cm;
real theta = 90 + 25;

vector_field(width=2.4u, height=2.4u, EField(dir=theta));
draw(scale(2*u)*shift((-0.5,-0.5))*unitsquare, dashed);
label("$a$", (0,u), align=N);
label("$b$", (u,0), align=E);
label("$c$", (0,-u), align=S);
label("$d$", (-u,0), align=W);
pair c = (u,-0.35u);
Angle a = Angle(c+(0,1), c, c+dir(theta), fill=currentpen, L="$\theta$");
a.draw();
\end{asy}
\end{center}
\end{problem*}

\begin{solution}
The electric flux through a surface $S$ is
\begin{equation}
  \Phi_{ES} = \int_S \vect{E}\cdot\vect{\dd A} = \int_S E \dd A\cos(\theta) \;.
\end{equation}
Where $\theta$ is the angle between \vect{E} and the perpendicular
\vect{\dd A}.  For a uniform field and flat surface, $E$ and $\theta$
are constants, so we can pull them of the integral:
\begin{equation}
  \Phi_{ES} = E\cos(\theta)\int_S \dd A = EA\cos(\theta) \;.
\end{equation}
For this problem, that means we only need to find the appropriate
expression for $\cos(\theta)$ to solve each part.

\begin{align}
  \Phi_{Ea} &= \ans{EA\cos(\theta)} \\
  \Phi_{Eb} &= \ans{-EA\sin(\theta)} \\
  \Phi_{Ec} &= \ans{-EA\cos(\theta)} \\
  \Phi_{Ed} &= \ans{EA\sin(\theta)} \\
  \Phi_{E\text{top}} &= \ans{0} \\
  \Phi_{E\text{bottom}} &= \ans{0} \;
\end{align}

\Part{f}
Summing the flux through each face (above), we have
\begin{equation}
  \Phi_E = EA\cos(\theta) - EA\sin(\theta) - EA\cos(\theta) + EA\sin(\theta)
    + 0 + 0 = \ans{0} \;.
\end{equation}
In other words, all the flux that comes into one part of the cube goes
out through some other part of the cube.

\Part{g}
From Gauss's law,
\begin{align}
  \Phi_E &= \frac{q_\text{in}}{\varepsilon_0} \\
  q_\text{in} &= \Phi_E \varepsilon_0 = \ans{0} \;.
\end{align}
\end{solution}
