# Divide a triangle so that all rectangles are bisected

Consider a right triangle $(0,0),(1,0),(0,1)$ in the plane. I am interested in dividing the triangle into two parts by a curve so that every rectangle of the form $$(0,0),(x,0),(x,1-x),(0,1-x)$$ gets divided into two regions of equal area by the curve. That is, we are interested in how the curve divides every axes-parallel rectangle with the origin and a point on the hypotenuse as diagonal points. Its quite a simple concept really, and the following diagram clarifies it further.

So we see that the curve is simply the line segment connecting $(0,1/2)$ to $(1/2,0)$. It is easy to see that this line segment divides every axis parallel rectangle into two regions of equal area. This is the easy part.

Now suppose the triangle area is not uniform. In other words, suppose we have a weight function $f(x,y)$ at each point $(x,y)$ so that the area of a region $W$ is now an integral $$\int_{W} f(x,y)dx dy$$

With this measure in place, we can ask the same question.

Given $f(x,y)$, is there a curve $$y=g(x)$$ such that it divides every axes-parallel rectangle into two regions of equal measure, and if yes, does it have an expression in terms of $f(x,y)$ (or a way to obtain it)? Explicitly, is there a function $g:[0,1] \to [0,1]$ such that for every $\alpha \in [0,1]$, $$\int \limits_{x=0}^{\alpha} \int \limits_{y=0}^{g(x)} f(x,y)dx .dy = \frac{1}{2} \int \limits_{x=0}^{\alpha} \int \limits_{y=0}^{1-\alpha} f(x,y)dx. dy$$

If this seems a bit too open-ended, it would be great even if something tractable could be worked out for special cases of $f$ assuming it is well-behaved, or even concrete non-trivial examples. I am just interested in whether this kind of notion has been studied anywhere.

I found an example where such a curve $y=g(x)$ does not exist.
If we take $f(x,y)=xy$, then your equation for $g(x)$ becomes:
$$\int_0^\alpha xg^2(x)\,dx={1\over4}\alpha^2(1-\alpha)^2,$$ and deriving both sides with respect to $\alpha$ we get: $$g^2(\alpha)=\alpha^2-{3\over2}\alpha+{1\over2}.$$ That works fine for $0\le\alpha\le1/2$, but the right-hand side of that equation is negative for $1/2<\alpha<1$, so it is not possible to find a suitable $g(x)$ for all $\alpha\in[0,1]$.
Another negative example. For $f(x,y)=x^2+y^2$, if we repeat the above passages we end up with $$g(x)\left(x^2+{1\over3}g^2(x)\right)={1\over6}(1-2x)^3.$$ Once again, for $x>1/2$ the right-hand side is negative, which implies $g(x)<0$. But that is not a valid solution, because $g$ must satisfy $0\le g(x)\le1$ for all $x\in[0,1]$.