Right well lets first find perimeters.

for the rectangle its .

So for the square it's just whatever is left which is .

So area of the rectangle is width times length which is .

Each side of the square has length .

Hence area of the square is...

Hence total area is...

.

To find the minimum find the derivative and set it to be 0.

To show it is a minimum find the second derivative and check if it is greater than 0.

EDIT: I see Soroban is replying to this thread as well. He will explain this better if you are still confused.