I'm trying to calculate complete flux through a pyramid formed by a plane and the axis planes. I can't to come to the same answer using usual method and the divergence theorem.
The plane is
$2x+y+z-2=0$
The vector field is
$\vec F=(-x+7z)\vec k$
Using the divergence theorem:
$div\vec F = \frac{d}{dz}(-x+7z) = 7 $
$Ф=\int_{0}^{1}\int_{0}^{2-2x}\int_{0}^{2-2x-y}div\vec F*dzdydx = 7\int_{0}^{1}\int_{0}^{2-2x}\int_{0}^{2-2x-y}dzdydx = -\frac{70}{3}$
Using the usual method: since the field has only k-component, full flux will be a sum of fluxes through the $2x+y+z-2=0$ plane and through the xy-plane (flux through zy and zx will be zero).
Flux through $2x+y+z-2=0$:
$\int_{0}^{1}\int_{0}^{2-2x}(-x+7z)\vec k\cdot (\frac{2\vec i + \vec j + \vec k}{\sqrt 6})\sqrt 6dydx = \frac{13}{3}$,
where $(\frac{2\vec i + \vec j + \vec k}{\sqrt 6})$ is a normal unit vector and $(-x+7z)\vec k\cdot (\frac{2\vec i + \vec j + \vec k}{\sqrt 6})$ is a dot product.
Flux through the xy plane: The unit vector will be -1. Since we are in the xy plane, the vector field will be $-x+7*0 = -x$. The integral is then:
$\int_{0}^{1}(-x\vec k\cdot -\vec k)(2-2x)dx = \frac{1}{3}$
The total flux: $\frac{13}{3} + \frac{1}{3} = \frac{14}{3}$
$\frac{14}{3} \neq -\frac{70}{3}$
What did I do wrong?
Since the divergence of the given vector field is constant, we can just multiply the volume of the pyramid with the divergence. The pyramid has ground surface (in the $xy$-plane) $1$, because it is a right triangle with base $1$ and height $2$. The height of the pyramid is $2$, so the pyramid volume is $\frac{1}{3}\cdot 1 \cdot 2=\frac{2}{3}$. Multiplying with the divergence $7$ gives an answer $\frac{14}{3}$.
Let's check this by doing the integral in your question: \begin{align} \Phi&=\int_{0}^{1}\int_{0}^{2-2x}\int_{0}^{2-2x-y}dzdydx\\ &=\int_{0}^{1}\int_{0}^{2-2x}\left[\int_{0}^{2-2x-y}dz\right]dydx\\ &=\int_{0}^{1}\left[\int_{0}^{2-2x}(2-2x-y)dy\right]dx\\ &=\int_{0}^{1}\left[2y-2xy-\frac{1}{2}y^2\right]_0^{2-2x}dx\\ &=2\int_{0}^{1}(x-1)^2dx\\ &=\frac{2}{3}\left[(x-1)^3\right]_0^1\\ &=\frac{2}{3} \end{align}