Let x = length of fence that divides the two corrals
y = length of a side of the fence perpendicular to the dividing fence
Then, xy = 54
C = cost of fence = 5(2x+2y) + 2x
So, C = 12x + 10y
Since xy = 54, we have y = 54/x
So, C = 12x + 540/x
C' = 12 - 540/x2
= (12x2 - 540) / x2
C' = 0 if 12x2 = 540
x2 = 45
x = √45 = 3√5 m
When 0 < x < 3√5, C' < 0 (so C is decreasing)
When x > 3√5, C' > 0 (so C is increasing)
Therefore, C is minimized when x = 3√5 m and y = 54/(3√5) = 18√5/5 m.