x = length of one of the 2 $30 sides y = length of one of the other sides ($30 or $15, doesn't matter)
Area = x * y = 500 ft2
Cost = (Length of Sides 1-3) * $30 + Length side 4 * $15
= (x + x + y) * $30 + y * $15
= (2x + y) *$30 + y*$15
= 60x + 30y + 15y
= 60x + 45y
Now we know Area = x * y = 500, so:
y = 500 / x
Substitute in 500/x for y:
Cost = C(x) = 60x + 45*(500/x) = 60x + 22500/x
C(x) = 60x + 22500/x or C(x) = 60x + 22500*x^-1
This is your function!
Now take the derivative if you want to find x at the minimum cost. When the derivative is 0 you have reached a minimum in your cost:
dC/dx = 60 - 22500*x^-2 = 0
60 = 22500x^-2
x^-2 = 2.666 * 10 ^-3 Raise each side to the power of -1/2 (X^-2)^-1/2 = (2.666 * 10 ^-3)^-1/2
X = 19.36 ft at the length of x at minimum cost. The minimum cost is about $2323.80