Given a fixed length of fencing what is the maximum area that can be enclosed in rectangular pasture for which one side is a stone wall (so the length of fencing need only cover three sides of the rectangle).

Let denote the width of the pasture (i.e., the length of the sides perpendicular to the wall) and let denote the length of the pasture (i.e., the length of the side of the rectangle that is parallel to the wall).

Then, we have which implies . We then want to maximize

Taking the derivative,

Then we have when and

Therefore, is increasing when and decreasing when . Hence, takes its maximum when . Then,

Therefore the dimensions of the rectangular pasture are by , where is the total length of the fencing.