Answer:
Let x be the perimeter of square.
Let y be the perimeter of equilateral triangle.
As both the shapes are made from a single wire, we can say that-
or 
The length of the side of square is 
The length of the side of triangle is 
We have to find the area.
Area of square =
=
= 
Area of triangle = 
= 
= 
Now differentiating the function to maximize the total area-
A = 
Substituting x=6-y

Differentiating the function with respect to y, we get
A(y) = 
Now equating y to 0, we get
y = 
The function reaches the minimum at y = 
We can find the maximum area at x=0 and x=6
= 
= 
Therefore, you should use x = 0m or x = 6m for square to get the total area to be maximum.
Now we can evaluate for x
We know x = 6-y
x = 
= 
Therefore, the lengths of x and y can be used to minimize the total area.
x=
y=