The mayor of a village wants to build a library of which the windows have a shape of a rectangle on top of a square. The total perimeter of each window is of P meters and varies depending on each windows size. Find the dimensions of the windows in terms of P, that maximizes the area of all the windows.

Because I can't draw on here, the perimeter I have is

6x + 2y = P

(3x for each of the squares sides, because the rectangle covers the last one, 2y for each of the rectangles sides, and the last 3x are the rectangles length, x being half the length of the rectangle, so 2x on top of the rectangle and 1x at the bottom, because the other x is the junction between the square and the rectangle.)

-----------|
| |-------|
|___|

For the area, I found:

p = 6x +2y
y = (P-6x)/2

so

A(x) = x^2 + 2x((P-6x)/2)

now, I know I have to derive A(x)
but what I'm not sure is if the derivative of P will be 0, or do I simply leave P as it is?

sorry for the drawing, apparently it didn't work when I submitted the question!

A(x) looks good.

A(x) = x(P-5x) = Px - 5x^2

You can take the derivative if you want, getting

A' = P - 10x
so, A' = 0 when x = P/10

Or, you can see that the roots of A(x) are 0 and P/5, making the max halfway between, or at x = P/10
y = (P-6x)/2 = (P-P/10)/2 = 9P/20

Rats. y = (P-6P/10)/2 = 4P/20 = P/5

But then, we knew that, since y=2x

I understand now, thanks a lot steve!

To find the dimensions of the windows that maximize the area, you need to find the derivative of the area function and set it equal to zero. However, in this case, you don't need to consider the derivative of the perimeter (P) because it is a constant value given in the problem.

Let's calculate the derivative of the area function A(x):

A(x) = x^2 + 2x((P-6x)/2)
= x^2 + x(P - 6x)
= x^2 + Px - 6x^2

To find the derivative, you need to apply the power rule and the constant rule of differentiation. The power rule states that the derivative of x^n is n*x^(n-1), and the constant rule states that the derivative of a constant times x is the constant itself.

Taking the derivative of A(x) with respect to x:

dA(x)/dx = d/dx (x^2 + Px - 6x^2)
= 2x + P - 12x

Now, set the derivative equal to zero and solve for x:

2x + P - 12x = 0

Simplifying the equation:

-10x + P = 0
10x = P
x = P/10

Now that you have the value of x (half the length of the rectangle), you can substitute it back into the perimeter equation to find the value of y (half the height of the rectangle):

6x + 2y = P
6(P/10) + 2y = P
3(P/5) + 2y = P
2y = P - 3(P/5)
2y = P - (3P/5)
2y = (2P/5)
y = P/5

So, the dimensions of the windows in terms of P that maximize the area are x = P/10 and y = P/5.