The formulas for the perimeter P and the area A of the rectangle are used to write equations as follows:

P = 2 * L + 2 * W

A = L * W

Then these equations are solved for L and W which are the length and width of the rectangle.

How to use the calculator

Enter the perimeter P and area A as positive real numbers and press "enter". The outputs are the width, length and diagonal of the rectangle. There are conditions under which this problem has a solution (see formulation of problem below).

Formulation of Problem

Let P be the perimeter of a rectangle and A its area. Let W and L be, respectively, the width and length of the rectangle. Find W and L in terms of P and A.

solution

P = 2 * W + 2 * L (1)

and

A = W * L (2)

solve equation (1) for W:

W = P / 2 - L

and W by P / 2 - L in A = W * L to obtain

A = L * (P / 2 - L)

Rewrite as a standard quadratic equation in L

L^{ 2} - L (P / 2) + A = 0

Solve the above equation for L and find W using W = P / 2 - L.

Practice: Find the discriminant of the above quadratic equation and find the condition on P and A under which the above problem has no solution.