I was reading "Problems of Calculus in one variable" by I A MARON, and came across this solved example in first chapter which I am unable to comprehend, please help me understand this.
Scan of the example 1.2.7

I was reading "Problems of Calculus in one variable" by I A MARON, and came across this solved example in first chapter which I am unable to comprehend, please help me understand this.
Scan of the example 1.2.7

Copyright © 2021 JogjaFile Inc.
If $x\le\sqrt{2}$ then the area is just $\frac{x^2}{2}+\frac{x^2}{2}=x^2$ which is base times height of both of the triangles $AEM$,$AEN$ added together. If $x>\sqrt{2}$ then it's the area of the square minus the area of the complement of $ADNMB$ which is the upper right triangle $NCM$. That's going to be: $$ AB^2 - (DEC+ECB) = 4 - \frac{(2\sqrt{2}-x)^2}{2}\cdot 2= 4-(2\sqrt{2}-x)^2 $$