Consider a cut made at x length from one side. Now you have two pieces x and 3-x. To make a square you need to have 4 sides of equal length, so divide the segment by 4 and for the triangle divide by 3. Now make a general area function for the sum of both areas in terms of x.