Let the other side of the rectangle be $y$, and say the circle is being built on the $x-$ side. Then $$12 = x+2y+\frac 12 \pi x\implies y = 6 - x- \frac 14\pi x$$
The area of the rectangular portion is $$xy = 6x - x^2 -\frac 14\pi x^2$$
The area of the half circle is $$\frac 12\pi \frac {x^2}4=\frac 18\pi x^2$$
Summing gives us a total area of $$xy = 6x - x^2 -\frac 18\pi x^2$$