The redness at (x,y) is given by f(x,y):
>
f:=(1/9)*(x+2*y)^2;
a:=0: b:=1:
c:=0: d:=1:
Below we compute Riemann sums with uniform square partitions, and choosing the center of each square as the representative point of the square:
>
pmax:=4:
for p from 0 to pmax do
m:=2^p;
n:=2^p;
dx:=(b-a)/m;
dy:=(d-c)/n;
tot:=0:
red_ink:=0:
for i from 0 to m-1 do
x_at_center:=a+(i+0.5)*dx:
for j from 0 to n-1 do
y_at_center:=c+(j+0.5)*dy:
f_at_center:=subs(x=x_at_center,y=y_at_center,f);
colr:=COLOR(RGB, f_at_center,0,0);
red_ink:=red_ink+f_at_center*dx*dy;
box[i*n+j]:=plottools[rectangle]([a+i*dx,c+(j+1)*dy], [a+(i+1)*dx,c+j*dy], color=colr):
od:
od:
total_red_ink[p]:=evalf(red_ink);
txt:=plots[textplot]([(a+b)/2,(c+d)/2,total_red_ink[p]],color=white):
frame[p]:=plots[display](txt,seq(box[k],k=0..n*m-1),scaling=constrained);
od:
for p from 0 to pmax do
plots[display](frame[p],labels=['x','y'],insequence=true,scaling=constrained);
od;
The sequence of sums seems to be converging to something near .296.