Hello,
Suppose that the printed part is a rectangle of sides x and y (x will be the length, y the height). And assuming that the paper is rectangular..
The area of the printed part is
Since there is a margin on top and on bottom of 2 inches each, the height of the paper will be
And since there are two lateral margins of 1 inch each, the length of the paper will be
Hence the area of the paper will be
So find x and y such as A is minimized, and remember that
Hence I'd advise you to develop the expression for A