4. Given an isosceles right triangle with a base length of 1, two congruent squares are placed inside it. Figures 2 and 3 show two different placements. The difference between the sum of the areas of the two squares in Figure 2 and the sum of the areas of the two squares in Figure 3 is ( ).
(A) $\frac{1}{72}$
(B) $\frac{1}{48}$
(C) $\frac{1}{36}$
(D) $\frac{1}{24}$
(E) $\frac{1}{18}$
4. A.

Let the side length of the square in Figure 2 be $x$. Then $\frac{x}{\frac{1}{2}}=\frac{\frac{1}{2}-x}{\frac{1}{2}} \Rightarrow x=\frac{1}{4}$.
At this point, the sum of the areas of the two small squares is $\left(\frac{1}{4}\right)^{2} \times 2=\frac{1}{8}$.
Let the side length of the square in Figure 3 be $y$. Then $\frac{\frac{\sqrt{2}}{2}-2 y}{\frac{\sqrt{2}}{2}}=\frac{y}{\frac{\sqrt{2}}{2}} \Rightarrow y=\frac{\sqrt{2}}{6}$.
At this point, the sum of the areas of the two small squares is $\left(\frac{\sqrt{2}}{6}\right)^{2} \times 2=\frac{1}{9}$.
Therefore, the area difference is $\frac{1}{8}-\frac{1}{9}=\frac{1}{72}$.