\text{Area of Garden} &= 18 \times 5 = 90 \ yd^2\\\text{Area of border} &= 39 \ yd^2\\\text{Area of Garden} + \text{border} &= (12 + 2x)(5 + x)\\\text{Area of border} &= (\text{Area of garden} + \text{border}) - \text{Area of garden}\\39 &= (18 + x)(5 + x) - 90\\39 &= 90+18x+5x+2x^2-90\\39 &= 23x+2x^2\\0 &= 2x^2+23x-39