Let and . The area of triangle BCD is , and the area of ABDE is . Hence the area of the pentagon P is

However you know that the perimeter is 10, so . Substitute into the area equation to obtain

Simplify, and differentiate both sides with respect to x and find critical points.