Consider a function f: \mathbb R^2 \to \mathbb R
with
f(x,y) = A {\color{red}K} + B x
and a constant \color{red}K
.
Which \color{red}K
ensures that
\displaystyle \int \int_{{\color{orange}D}} f(x,y) dA = I
with the given triangel
\color{orange}D
below.
{\color{red}K} =
K
By definition
\displaystyle
\int \int_{{\color{orange}D}} f(x,y) \, dA =
\int \int_{{\color{orange}D}} (A {\color{red}K} + B x) \, dA =
\int \int_{{\color{orange}D}} A {\color{red}K} \, dA + \int \int_{{\color{orange}D}} B x \, dA
.
The 1st summand
\displaystyle \int \int_{{\color{orange}D}} A {\color{red}K} \, dA =
A {\color{red}K} \int \int_{{\color{orange}D}} 1 \, dA
can be computed geometrically,
since\displaystyle \int \int_{{\color{orange}D}} 1 \, dA =
area of the triangle
{\color{orange}D} = X \cdot Y = Y*X.
Using this give the value of this integral
\displaystyle \int \int_{{\color{orange}D}} A {\color{red}K} \, dA = A*X*Y {\color{red}K}
.
For the 2nd integration compute
\displaystyle
\int \int_{{\color{orange}D}} B x \, dA =
B \int_{0}^{X}
\int_{fractionReduce(Y,X,small=true) x - Y}^{-fractionReduce(Y,X,small=true) x +Y}
x \, dy dx
.
The interval boundaries of the inner integration satisfy
fractionReduce(Y,X) x - Y = - \left(-fractionReduce(Y,X) x +Y\right)
,
i.e. one the of the boundaries is the negative of the other.
Due to the symmetry of the even function y \mapsto x
one gets
\displaystyle
\int_{fractionReduce(Y,X,small=true) x - Y}^{-fractionReduce(Y,X,small=true) x +Y} x \, dy =
2 \int_{0}^{-fractionReduce(Y,X,small=true) x +Y} x \, dy
= 2 x \left( -fractionReduce(Y,X,small=true) x +Y \right) = -fractionReduce(2*Y,X) x^2 +2*Yx
.
The 2nd integration is
\displaystyle \int_{0}^{X} -fractionReduce(2*Y,X) x^2 +2*Yx \, dx
and hence
-fractionReduce(2*Y*X*X+6*Y*X*X,3)
.
Combined we have
\displaystyle \int \int_{{\color{orange}D}} f(x,y) dA = I = A*X*Y {\color{red}K} + fractionReduce(-2*Y*X*X-6*Y*X*X,3)
and
{\color{red}K} = K
.