Write an article based on this summary:

Set up the formula for the perimeter of a rectangle. Plug the width and height into the formula. Add the length and width, and multiply by 2. Use the formula P=4x{\displaystyle P=4x} to find the perimeter of a square. Find the perimeter given other information.

Article:
The formula is P=2(w+h){\displaystyle P=2(w+h)}, where P{\displaystyle P}  equals the perimeter of the rectangle, w{\displaystyle w} equals the width of the rectangle, and h{\displaystyle h} equals the height of the triangle. If you don’t know the length of the width and height of the rectangle, you cannot use this formula. You can also use the formula P=a+b+c+d{\displaystyle P=a+b+c+d}, where each variable is equal to the length of one side of the rectangle. Due to the commutative property, it doesn’t matter which measurement you use for the width, and which you use for the height. The width and height are two adjacent sides. If the rectangle is not a square, these to side lengths must be different. For example, if a rectangle has a width of 5 cm and a height of 10 cm, your formula will look like this: P=2(5+10){\displaystyle P=2(5+10)}. Make sure you follow the order of operations and complete the calculation in parentheses before multiplying. The resulting value will give you the perimeter of your rectangle. For example:P=2(5+10){\displaystyle P=2(5+10)}P=2(15){\displaystyle P=2(15)}P=30{\displaystyle P=30}So, the perimeter of the rectangle is 30 cm. In this formula x{\displaystyle x} is equal to the length of one side of the square. A square has 4 equal sides, so to find its perimeter, you only need to multiply the length of one side by 4. For example, if a square has one side that is 3 cm long, to find the perimeter, you would calculate P=4(3)=12{\displaystyle P=4(3)=12}. So, the perimeter is 12 cm. Often you will not be given the length of all sides, or even the length of any side. It still may be possible to  find the perimeter of a rectangle.  If you know the area of the rectangle, and the length of one side, you can find the perimeter by finding the missing width or height using the area formula. Set up the formula A=wh{\displaystyle A=wh}. Plug in the values you know, then solve for the missing variable. Now you know the length and width, so you can use the perimeter formula. If you know one side length and the length of the diagonal, you can use the Pythagorean Theorem to find the missing side length. Set up the formula a2+b2=c2{\displaystyle a^{2}+b^{2}=c^{2}}. Substitute the length of the diagonal for c{\displaystyle c}, and the side length for a{\displaystyle a}. Solve for b{\displaystyle b}. Now you know the length and width, so you can use the perimeter formula.