If you begin with 1.5 yd^3 of topsoil and want the topsoil to be only 4 inches deep, then the area of the garden can be found as follows:
Convert 4 in to yards: 4 in 1 yd
------- * ----------- = (1/9) yd
1 36 in
The dimensions of the garden are x (width) by 2x (length) by (1/9) yd (depth). The volume of topsoil would be 2x^2/9 = 1.5 yd^3.
Solving for x: (2/9)x^2 = 1.5 yd^3, or x^2 = (1.5 yd^3) (9/2)
Then: x = sqrt(6.75 yd^3) = 2.6 yd and 2x = 5.2 yd
Check: Does (2.6 yd)(5.2 yd)(1/9) = 1.5 cu yd? YES
Thus, the max size of the garden would be 2.6 yd wide, 5.2 yd long, and 4 inches (or 1/9 foot) deep.