well first find an equation for the lengths of the sides

A=(L)(w)

6000=(L)(x)

L=6000/x

so, the total amount of fence is going to be represented by the equation y=2x+6000/x

now fill in the prices to make it a cost function

C(x)=(2)(2x)+(5)(6000/x)+(4)(30)

C(x)=4x+30000/x+120

then you want to find the minimun you can do this by graphing the problem on a calculator and looking at it,or using the derivative to find the min.

C'(x)=4-(30000/(x^2))

0=4-(30000/(x^2))

30000/x^2=4

4(x^2)=30000

x^2=7500

x=sqrt(7500)

fill that value into the cost equation for x and solve an that will be the min cost