Call the extreme points of wire A, B and call the cut point C ==> the line AC, say of length , will be shaped bent into a circle and the line CB, of length , into a square.

As the circle's perimeter is , with the circle's radius, the circle's area is , and the square's area is . so the total area of these two shapes is

.

Now derivate, equal to zero and etc.

Tonio