Volume of the intersection of 2 parallel hyperplanes Following is the notation-
$w = [w_1,w_2,\ldots,w_d]^T, w \in \mathbb{R}^d$ and Bias $b \in \mathbb{R}$. The $w$ and $b$ are fixed.
$x = [x_1,x_2,\ldots,x_d]^T$. Each $x_i \in [l_i,u_i]$ where $l_i, u_i \in \mathbb{R}$. $x$ is the variable.
Then the 2 parallel hyperplanes are defined as
$0 \leq w_1x_1 + w_2x_2 ...+ w_{d-1}x_{d-1} + b$
$w_1x_1 + w_2x_2 ...+ w_{d-1}x_{d-1} + b < -w_d $
($x_d$ disappears due to the structure of my specific use case.)
How can I bound the volume of the intersection of these 2 hyperplanes? I need a closed form expression for this.
Suggestions - Probably can use volume of a high dimensional parallelogram or rectangle. Probably this is helpful..
 A: *

*Let $V(c)$ denote  volume  of the portion of your box that lies inside the half space defined by  $\{ x: n\cdot x<c\}$.  Then the answer you seek is simply $ V(b)- V(a)$. This is the volume in the box-shaped region in the slab defined by
$\{ x: a< n\cdot x < b \}$.

To compute $V(c)$ see the answers to your related question.
Finding probability or volume of a set of points satisfying an inequality


*Alternatively, you can use the spline formula for $V(c)$ given in this article, which is an analytical formula.

Barrow, D. L., and P. W. Smith. “Spline Notation Applied to a Volume Problem.” The American Mathematical Monthly, vol. 86, no. 1, 1979, pp. 50–51, https://doi.org/10.2307/2320304. Accessed 22 Apr. 2022.


*Here is a short worked example in the plane which generalizes to higher dimensions. (If you draw a picture you will see that the integral formulas that appear below have a simple geometrical interpretation. The purpose of using these integral formulas is to have a systematic notation that extends easily to higher dimensions.)

The unit square in the plane is the Cartesian product of two unit-length intervals. The indicator function for the unit square  can be expressed in terms of the Heaviside step function  $H$ as
$S(x,y)= ( H(x)- H(x-1)) ( H(y)- H(y-1))$ whose product expands as an alternating sum of four terms that are indicator functions of translated characteristic functions of the upper-right-hand quadrant.
One of these products is for example $H(x-1) H(y-1)$ which is the indicator function for the quadrant $x>1, y>1$.
You want to slice the unit square  with a tilted half space $T$ of the form $\{ (x,y): ax+b y<c \}$  and find the area  of that region. Denote the indicator function of that tilted half space by $T(x,y)$.
Then
Area  sought = $\int\int S(x,y) T(x,y) dx \ dy$
which expands as the alternating sum of four integrals, one of which is $\int\int H(x-1) H(y-1) T(x,y)$. But by a translation of variables this is $ \int \int H(x) H(y) T(x+1, y+1)$ and the latter indicator expression is nonzero iff $ ax+by< c-a-b$, which  you will note is simply a shifted value of $c$.
Thus we see that  the expression $ \int \int H(x) H(y) T(x+1, y+1)$ is simply the volume of the portion of the first quadrant that lies inside the halfspace  $ ax+by< c-a-b$. That region is either empty ( if $c-a-b <0)$ or is a triangle, and  the  triangular area is easy to compute by computing intercepts.
The 3D problem is similar, but the  3D regions created are now not triangles  but rather 3D tetrahedra formed by a tilted plane cutting through a right octant. The volume of that is the product of the lengths of the three axis  intercepts/3!.
