Answer:
For a rectangle of length L and width W, the perimeter is:
P = 2*L + 2*W
And the area is:
A = L*W.
Now, we know that the sanctuary has one side along a straight riverbank, then we will not fence that side. if L > W, then makes sense to put one of the "length" sides in the riverbank, in that way, we are saving more fence for the other 3 sides.
Then we will have that, the total length of fence used is:
12km = 2*W + L (two times the width and only one time the length are fenced).
From this, we can isolate one of the variables:
L = 12km - 2*W
And replace that in the area equation:
A(W) = (12km - 2*W)*W = 12km*W - 2*W^2.
To maximize this function, we must see when the first derivate is equal to zero:
A'(W) = 12km - 4*W = 0
12km = 4*W
12km/4 = 3km = W
Then the width that maximizes the area is W = 3km.
And the maximum area will be:
A'(3km) = 12km*3km - 2*(3km)^2 = 18km^2
And the length can be computed with the equation:
L = 12km - 2*W = 12km - 2*3km = 6km