Let the side length of the larger square be \(x\) cm, and the side length of the smaller square be \(y\) cm.
1. The perimeter of a square is given by \(4 \times \text{side length}\). Therefore, the sum of the perimeters of the two squares is \(4x + 4y = 40\) cm.
2. The difference between the areas of the two squares is \(x^2 - y^2 = 40\) cm².
From the first equation, we can express \(y\) in terms of \(x\):
\[4x + 4y = 40\]
\[4y = 40 - 4x\]
\[y = 10 - x\]
Now, substitute this expression for \(y\) into the second equation:
\[x^2 - (10 - x)^2 = 40\]
\[x^2 - (100 - 20x + x^2) = 40\]
\[x^2 - 100 + 20x - x^2 = 40\]
\[20x - 100 = 40\]
\[20x = 140\]
\[x = \frac{140}{20}\]
\[x = 7\]
So, the side length of the larger square is 7 cm.