Let
x---------> the length side of the rectangular area
y---------> the width side of the rectangular area
we know that
the area of the rectangle is equal to
\(A=x*y\\ A= 200\ ft^{2} \\ x*y=200\)
\(y=\frac{200}{x}\) -----> equation \(1\)
The perimeter of the rectangle is equal to
\(P=2x+2y\)
but remember that the fourth side of the rectangle will be formed by a portion of the barn wall
so
\(P=x+2y\) -----> equation \(2\)
To minimize the cost we must minimize the perimeter
Substitute the equation \(1\) in the equation \(2\)
\(P=x+2*[\frac{200}{x} ]\)
Using a graph tool
see the attached figure
The minimum of the graph is the point \((20,40)\)
that means for \(x=20\ ft\)
the perimeter is a minimum and equal to \(40\ ft\)
Find the value of y
\(y=\frac{200}{x}\)
\(y=\frac{200}{20}\)
\(y=10\ ft\)
The cost of fencing is equal to
\(5*40= \$200\)
therefore
the answer is
the length side of the the fourth wall will be \(20\ ft\)