# Setting up integral over tetrahedron

1. Dec 22, 2015

### JonnyG

1. The problem statement, all variables and given/known data
Let $S$ be the tetrahedron in $\mathbb{R}^3$ having vertices $(0,0,0), (1,2,3), (0,1,2),$ and $(-1,1,1)$. Evaluate $\int_S f$ where $f(x,y,z) = x + 2y - z$.

2. Relevant equations

3. The attempt at a solution
I just want to confirm that I am setting up the integral properly: Looking at the projection of the tetrahedron onto the $xy$-plane, it looks like $-1 \leq x \leq 1$ and $-x \leq y \leq 2x$. Now looking at the actual tetrahedron, it seems as if $z$ varies between $0$ and the plane $-x + z - 2 = 0$ so that the boundaries for $z$ are: $0 \leq z \leq x + 2$. Therefore $\int_S f = \int_0^{x+2} \int_{-x}^{2x} \int_{-1}^1 f \text{ } dxdydz$. Is this correct?

EDIT: Wait, this makes no sense. If that is my setup, then my final integral will have an $x$ in it. Forget the projection onto the xy-plane. Looking at the tetrahedron, it looks as if $x$ is bounded between the two planes $-x + 2y - z = 0$ and $x + 4y - 3z = 0$ so that $2y - z \leq x \leq 3z - 4y$. It seems as if $y$ is bounded between the two planes $x + 2y - z = 0$ and $y = 2$ so that $\frac{z}{2} - \frac{x}{2} \leq y \leq 2$. It looks as if $z$ is bounded between the xy plane and [/itex] -x + z - 2 = 0 [/itex] so that $0 \leq z \leq x + 2$. So that my integral should be $\int_0^{x+2} \int_{\frac{z}{2} - \frac{x}{2}}^2 \int_{2y - z}^{3z - 4y} f \text{ } dxdydz$. Is this correct?

Also, the book gives a hint: Find a suitable linear transformation $g$ as a change of variables. I've been trying to find a linear diffeomorphism from the tetrahedron to the unit cube (or a diffeomorphism from a set that differs from the tetrahedron by measure zero to a set that differs from the unit cube by measure zero), but have been unable to find such a mapping. However, perhaps that is the easier route than to try and do what I am currently doing?

Last edited: Dec 22, 2015
2. Dec 22, 2015

### haruspex

Your second integral looks worse than the first. There should be an order of integration which eliminates one free variable at a time. The last one must have a constant range.
I would look for a parametrization whereby changing one parameter (starting at the origin, say) takes you smoothly to another vertex. Three other vertices, three parameters.

3. Dec 22, 2015

### geoffrey159

If I'm correct, with your 3 planes
$P_1 | x-2y + z = 0$
$P_2 | x-z+2 = 0$
$P_3 | x+4y - 3z = 0$

then your region is determined by the intersection of 3 half-spaces : $R = E_1 \cap E_2 \cap E_3$, where
$E_i = P_i + t_i \vec u_i, \quad t_i \ge 0,\ i = 1,2,3$
with $\vec u_1 = (-1,1,1)$, $\vec u_2 = -\vec u_1$, $\vec u_3 = (0,1,2)$

hope it helps

4. Dec 22, 2015

### JonnyG

I was able to find a linear diffeomorphism to a tetrahedron with vertices at the origin and at (1,0,0), (0,1,0) and (0,0,1). That integral is much easier to set up. But out of curiosity, if I wanted to avoid using the change of variables theorem, how would I go about setting this integral up?

5. Dec 22, 2015

### LCKurtz

But nothing in the problem statement says this is to be a volume integral, and the notation suggests it is to be a surface integral.

6. Dec 22, 2015

### haruspex

I guess you are reading S as surface, but it defines S to be the tetrahedron, then asks for an integral over S. Also, the hint (if quoted correctly) suggests a transformation, not multiple transformations. I agree it could be clearer (maybe the original is).

7. Dec 22, 2015

### Ray Vickson

You could express it as $I = \int_S f dV = \int_{z=0}^3 F(z) \, dz$, with
$$F(z) = \int_{S(z)} f(x,y,z) \, dx \, dy$$
and where $S(z) = \{(x,y): (x,y,z) \in S \}$ is the slice through $S$ for given, fixed $z$. By looking at the coordinates of the vertices, it is clear that the shape/description of $S(z)$ is different in the three regions $z \in [0,1], \: z \in [1,2] \, \: z \in [2,3]$, so $F(z)$ would have a piecewise description, requiring a split of the integral into three $z$-intervals.

For example, in the region $z \in [0,1]$ the region has edges $(0,0,0) \to (-1,1,1)$, $(0,0,0) \to (a,b,1)$ and $(0,0,0) \to (u,v,1)$, where $(a,b,1)$ is the point at $z = 1$ on the line segment from $(0,0,0)$ to $(1,2,3)$ and $(u,v,1)$ is the corresponding point on the other segment from $(0,0,0)$ to $(0,1,2)$.

Alternatively, we could take $yz$ slices of $S$ for fixed $x$; that might be more convenient, as it needs only two $x$-regions $x \in [-1,0], \: x \in [0,1]$.

8. Dec 24, 2015

### geoffrey159

So how did you do with your transformation? It's interesting but you remain silent on this.

My idea is this:
You need to preserve planeity and alignments so you must have been looking for an affine transformation from the unit tetrahedron $T_0$ to $T$ right ?
For any point $0,M \in T_0$, the transformation $f$ has the form $f(M) = f(O) + \vec f ( \vec {OM} )$.

Let's name the vertices of $T_0$ and $T$:
$T_0:\ A_0(0,0,0),A_1(1,0,0), A_2(0,1,0), A_3(0,0,1)$
$T :\ B_0(0,0,0),\ B_1(1,2,3),\ B_2(0,1,2),\ B_3(-1,1,1)$

Since you want $f$ bijective, then the linear part of $f$ must be bijective.
Since the $(\vec{ A_0A_i})_{i=1,2,3}$ form a basis of $\mathbb{R^3}$ (the canonical basis), then $\vec f$ is bijective iff $(\vec f ( \vec {A_0A_i}))_{i=1,2,3}$ also form a basis of $\mathbb{R}^3$.

So you can set $\vec f(\vec{A_0A_i}) = \vec { B_0B_i}$ ( the vertices of $T$ aren't coplanar), and it follows that $f(A_i) = B_i$ for all $i=0,1,2,3$
Finally, in the canonical basis of $\mathbb{R}^3$, the matrix of the linear part of $f$ is $P = \begin{pmatrix}1 & 0 & -1 \\ 2 & 1 & 1 \\ 3 & 2 & 1 \end{pmatrix}$ and $f(M) = P (\vec {A_0M})$.

Is it what you get ?

Then, if I'm right $T_0 = \{ (x,y,z):\ x,y,z \ge 0,\ x+y+z \le 1 \} = \{ (x,y,z): 0\le x\le 1,\ 0\le y \le 1-x,\ 0\le z \le 1 - x - y \}$

So I get ;
$\int_T g = |\text{det} P|^{-1} \int_{T_0} g\circ f \ = |\text{det} P|^{-1} \int_0^1\int_0^{1-x}\int_0^{1-x-y} (g\circ f)(x,y,z)\ \ dzdydx$

Is it correct ?

Last edited: Dec 24, 2015
9. Dec 24, 2015

### Ray Vickson

I was going to suggest something similar, but the OP stated he/she had already done something like that---or was it, who knows?

Anyway the tetrahedron $S$ is convex with vertices $\vec{V_1} = (0,0,0)$, $\vec{V_2} = (1,2,3)$, $\vec{V_3} = (0,1,2)$, and $\vec{V_4} = (-1,1,1)$. Any point $\vec{v} \in S$ can be written (uniquely---in this case) as
$$\vec{v} = p_1 \vec{V_1} + p_2 \vec{V_2} + p_3 \vec{V_3} + p_4 \vec{V_4},$$
where all $p_i \geq 0$ and $p_1 + p_2 + p_3 + p_4 = 1$. We can eliminate the equality by setting $p_4 = 1-p_1-p_2-p_3$, so
$$\begin{array}{rcl} \vec{v} &= &p_1 \vec{V_1} + p_2 \vec{V_2} + p_3 \vec{V_3} +(1-p_1-p_2-p_3) \vec{V_4} \\ &=& (-1+p_1+2p_2+p_3,1-p_1+p_2,1-p_1+2p_2+p_3) \end{array}$$
This implies
$$\begin{array}{l} x = -1+p_1+2p_2+p_3\\ y = 1-p_1+p_2\\ z = 1-p_1+2p_2+p_3 \end{array}$$
in $S$. We have $f(\vec{v}) = 2 p_2$ in $S$. The rest is easy:
$$\int_S f \, dV = \int_{S_p} 2 p_2 \left| \frac{\partial(x,y,z)}{\partial(p_1,p_2,p_3)} \right| \, dp_1 \, dp_2 \, dp_3$$
where $S_p = \{ (p_1,p_2,p_3) : p_1, p_2, p_3 \geq 0, p_1+p_2+p_3 \leq 1 \}$.

Last edited: Dec 26, 2015
10. Dec 25, 2015

### JonnyG

I let $g: \mathbb{R}^3 \rightarrow \mathbb{R}^3$, and defined the action of $g$ on the standard basis vectors by $g(e_1) = (0,1,2), g(e_2) = (-1,1,1), g(e_3) = (1,2,3)$, then defined the action of g on an arbitrary vector by $g(x,y,z) = xg(e_1) + yg(e_2) + zg(e_3 = (z-y, x + y + 2z, 2x + y + 3z)$. Then $g$ is a linear isomorphism carrying $T$ onto $S$. It's also a diffeomorphism onto $S$ because it is (obviously) smooth and has nonsingular Jacobian everywhere.

11. Dec 26, 2015

### Ray Vickson

What do you do with the integrand $f = x+2y-z$? What is your final answer?

12. Dec 26, 2015

### JonnyG

$(f \circ g)(x,y,z) = 2z$ and $\mathrm{det}(Dg) = -2$, so that $(f \circ g) \left| \mathrm{det} (Dg) \right| = 4z$. I get $\int_S f = 4 \int_T z = 4 \int_0^1 \int_0^{1-x} \int_0^{1 - x -y} z \mathrm{dz} \mathrm{dy} \mathrm{dx} = \frac{1}{6}$.

How come whenever I post on this site and start using LaTex, it slows down? The text I type lags behind my keystrokes. It only happens on this site.

13. Dec 26, 2015

### geoffrey159

It is disturbing because you don't clearly explain how your transformation sends a tetrahedron to another tetrahedron. How would you build a bijective transformation between 2 non-flat tetrahedrons $(A_0,...,A_3)$ and $(B_0,...,B_3)$? I feel that this is the central question.

14. Dec 27, 2015

### JonnyG

It is very easy to check that $g$ sends $\partial T$ to $\partial S$, and since $g$ is a diffeomorphism, it sends $\mathrm{int}(T)$ to $\mathrm{int}(S)$.

15. Dec 27, 2015

### Ray Vickson

Instead, what I found a bit tricky (and not absolutely convincing!) is that using your transformation you "move the points", and transform the tetrahedron into another tetrahedron. I find it much easier to justify an approach in which the tetrahedron's points are not moved, but simply described in a different coordinate system. In my case I just used standard theorems about convex sets and their representation in terms of extreme points (vertices), allowing for a seamless switch to "barycentric coordinates". Of course, if you have never seen such material about convexity and convex hulls, etc., that approach might seem obscure.

16. Dec 27, 2015

### JonnyG

I have never seen that material before. I am taking a course in differential geometry next year. Can I expect to see it in the class? And I don't know if you actually calculated the integral, but did you get the same answer that I did?

EDIT: I have always looked at the change of variables thereom as, ok, suppose we have a surface that we want to integrate over. Let us find a diffeomorphism from that surface to another surface that may be easier to work with. It should transform "smoothly". But of course, there is a scaling factor which we must adjust for. The scaling factor turns out to be the absolute value of the determinant of the Jacobian. Is this the correct way to look at it? Or is there a better way to look at it?

17. Dec 27, 2015

### Ray Vickson

Material on convexity and convex sets is not typically discussed in differential geometry; it is found in some linear algebra courses, and more generally in material on optimization modelling and methods. The result I used is really from very elementary convexity 101 and uses nothing deep at all.

I got the value 1/6 for the answer, as did you. For that reason I am inclined to "believe" your approach even though it leaves me unconvinced---at least as you have written it up.

18. Dec 27, 2015

### JonnyG

What is there to be "believed" though? It's just an application of the change of variables theorem. One may use the polar coordinate transformation, for example, to "transform" a sphere into a cube, so that the integral is easier to compute. In my case, I just did that but with tetrahedrons instead.

19. Dec 27, 2015

### Ray Vickson

Yes, a change-of-variables is exactly what I did; I am just not convinced that is what YOU did!

However, never mind. You did it your way and I did it my way, and we each prefer out own method.

20. Dec 27, 2015

### geoffrey159

I agree with Ray, it is not clear what your thinking is. I feel like you are bluffing me honestly.