# Computing double integral using linear algebra

$$\iint_D (6x+2y) \, \mathrm d x \,\mathrm d y$$

where $$D$$ is the convex hull of $$4$$ given points,

$$D = \mbox{conv} \left\{ (0,0),(-2,6),(3,2),(1,8) \right\}$$

This is a parallelogram with "unit vectors" $$(-2,6)$$, $$(3,2)$$.

I wanted to give a try to solve the following problem with algebra instead of calculus. So, I thought about calculating the area of it and piling it up to get its volume. I got the cosine between both vectors with the dot product formula, which is $$\dfrac{6}{\sqrt{13\cdot40}}$$ and the sine with the Pythagoras identity which is $$\sqrt{\dfrac{484}{13\cdot40}}$$ I remember that $$|a|\cdot |b|\cdot \sin\alpha$$ gives the height, and $$|a|\cdot |b|\cdot \cos\alpha$$ gives the area. So I figured that maybe this would solve the integral problem for the area?

$$\dfrac{6}{\sqrt{13\cdot40}} \cdot \sqrt{13} \cdot \sqrt{40}\sqrt{\dfrac{484}{{13\cdot40}}}\cdot \sqrt{13} \cdot \sqrt{40}$$

That gives me $$6 \cdot 22 = 132$$ That's wrong but the right result is $$11 \cdot 22 = 242$$ so there might be something in that?

• You can compute an integral with the aid of areas if your integrand is 1 or a constant. In your case you have an integrand which contains other variables $x,y$... In this case you should decompose your domain and transform the double integral into two successive one dimensional integrals. Or change variables in order to transform your domain into a square (not sure that's easier to do...) Jul 6, 2018 at 9:37
• May be the solid volume of which you want to get is not a parallelipiped. Its top is not parallel to XOY Jul 6, 2018 at 9:40
• @BeniBogosel: would it work if I did a change of base from \begin{pmatrix} \begin{align} 3 & -2 \\ 2 && 6\\ \end{align} \end{pmatrix} Sorry, I can't separate the 2 and the 6 properly! Jul 6, 2018 at 10:03
• Maybe if I made a cube of the integral then I would be able to calculate it's volume then? Jul 6, 2018 at 10:12

The area of the domain is given by the cross product of two sides,

$$(2,-6)\times(3,2)=22.$$

Then the integral must be the area times the average value of the integrand, which by linearity is also the value of the function at the centroid, $\left(\dfrac12,4\right)$, hence

$$22\left(6\cdot\frac12+2\cdot4\right)=22\cdot11.$$

Your answer cannot be right, because you make no use of the coefficients $6$ and $2$ in the integrand. What you are evaluating is

$$|a|^2|b|^2\cos\alpha\sin\alpha$$

which has no justification.

Another solution is by noting that the volume is a truncated prism with bases $(0,0,0),$ $(-2,6,0),$ $(3,2,0),(1,8,0)$ and $(0,0,0),(-2,6,0),(3,2,22),(1,8,22)$, which is the half of a non-truncated prism of height $22$. Hence

$$22\cdot\frac{22}2.$$

• Thanks @YvesDaoust, I really love your answer! How do I find the centroid? Jul 6, 2018 at 10:46
• @Dovendyr: by symmetry, the centroid of the parallelogram is the centroid of the four vertices, i.e. the arithmetic mean.
– user65203
Jul 6, 2018 at 10:46
• I like your second take on it as well, but can you send some graphic representation?? Jul 6, 2018 at 10:47
– user65203
Jul 6, 2018 at 10:47
• I got an empty box. Even though I follow the instructions! Graphics3D[ Prism[ {0, 0, 0}, {-2, 6, 0}, {3, 2, 0}, {1, 8, 0}, {0, 0, 0}, {-2, 6, 0}, {3, 2, 22}, {1, 8, 22}]] Jul 6, 2018 at 10:56

Let

$$\begin{bmatrix} x\\ y\end{bmatrix} = \begin{bmatrix} 3 & -2\\ 2 & 6\end{bmatrix} \begin{bmatrix} u\\ v\end{bmatrix}$$

where the determinant of the matrix is $22$. Since

$$6x + 2y = \begin{bmatrix} 6\\ 2\end{bmatrix}^\top \begin{bmatrix} x\\ y\end{bmatrix} = \begin{bmatrix} 6\\ 2\end{bmatrix}^\top \begin{bmatrix} 3 & -2\\ 2 & 6\end{bmatrix} \begin{bmatrix} u\\ v\end{bmatrix} = \begin{bmatrix} 22\\ 0\end{bmatrix}^\top \begin{bmatrix} u\\ v\end{bmatrix} = 22 u$$

we have

$$\iint_D (6x+2y) \, \mathrm d x \,\mathrm d y = \iint_{[0,1]^2 } (22 u) (22 \, \mathrm d u \,\mathrm d v) = 22^2 \int_0^1 u \, \mathrm d u = \frac{22^2}{2} = 22 \cdot 11$$

• This is amazing! So neat! I have to give it some thought to understand how and why the determinant comes into play. I'll be back! Jul 6, 2018 at 13:15
• Note that the gradient of $6x+2y$ is orthogonal to the 2nd column of the matrix. The integrand was not chosen randomly! Jul 6, 2018 at 13:35
• I have been thinking a bit about that, but why is that : $$\begin{bmatrix} u\\ v\end{bmatrix} = \begin{bmatrix} 3 & -2\\ 2 & 6\end{bmatrix} \begin{bmatrix} x\\ y\end{bmatrix}$$? Isn't it the vectors $u$ and $v$ that have coordinates $\begin{pmatrix} 3 \\ 2 \end{pmatrix}$ and $\begin{pmatrix} -2 \\ 6 \end{pmatrix}$ respectively? And in addition, why is that $6x+2y=22u$? Where is that coming from? Jul 7, 2018 at 9:14
• You have a parallelogram in the $(x,y)$ plane. It is a pain to integrate a function over this parallelogram. To make your life easier, consider a unit square $[0,1]^2$ in the $(u,v)$ plane. Via the linear transformation $$\begin{bmatrix} x\\ y\end{bmatrix} = \begin{bmatrix} 3 & -2\\ 2 & 6\end{bmatrix} \begin{bmatrix} u\\ v\end{bmatrix}$$ the $4$ vertices of the unit square in $(u,v)$ are mapped to the $4$ vertices of the parallelogram. Fortunately, the integrand in terms of $u$ and $v$ depends only on $u$. Thus, perform the integration over the unit square of the $(u,v)$ plane. Jul 7, 2018 at 12:46
• Note that the unit square in the $(u,v)$ plane is ($22$ times) smaller than the parallelogram in the $(x,y)$ plane. Thus, to compensate for the shrinking, multiply the integral over $u$ and $v$ by the determinant of the matrix (which is $22$). Jul 7, 2018 at 13:00