Let the width of the rectangle be W in.
Therefore, length = 2W in
Area of the rectangle, Ar = L*W = 2W*W = 2W^2
Also, perimeter of the rectangle, Pr = 2(L+W) = 2(2W+W) = 2(3W) = 6W
Then, perimeter of square, Ps = 52-6W
And, area of the square, As = [(52-6W)/4]^2 = [13-1.5W]^2 = (13-1.5W)(13-1.5W) = 169-19.5W-19.5W+2.25W^2 = 2.25W^2-39W+169
Therefore,
Total area, At = Ar+As = 2W^2+2.25W^2-39W+169 = 4.25W^2 -39W+169
For maximum area, the first derivative of the total area expression should be zero. Therefore;
dAt/dW = 8.5W - 39 = 0 => 8.5W = 39 => W = 39/8.5 = 4.588 in
Therefore, for maximum area, width (W) should be 4.588 in