Let the distance from the tip of the base of the triangle to the point that the top of the rectangle meets the triangle be x, then the width of the rectangle is √3/2x and the length of the rectangle is L - x.
Thus, Area of the rectangle = √3/2x(L - x) = √3/2xL - √3/2x^2
For maximum area, dA/dx = 0
dA/dx = √3/2L - √3x = 0
√3/2L = √3x
x = L/2
L - x = L - L/2 = L/2
√3/2x = √3/2(L/2) = √3/4L
Therefore, the dimensions of the square are L/2 and √3/4 L.