We want that
Yellow = Green + Red
For a given h, we can calculate the green triangle's area.
By integration from 0 to h, we can get the sum of Yellow and Green.
By integration from h to 1, we find Red.
Using our equation above (Yellow = Green + Red) and these methods for calculating the areas, we can find h.
then m in y=mx can be calculated quickly:
m=(h-h^2)/h=1-h, which is
m= 1 - (cubic root of half)