4. (Viviani's Problem). Given two parallel lines $AB$ and $CD$, the distance between which is $b$, and two points: $M$ on $AB$ and $N$ on $CD$. On $AB$ from point $M$, a segment $ME=a$ is marked. What point $L$ on the line $MN$ should be connected to point $E$ so that the sum of the areas of triangles $ELM$ and $NLF$ is the smallest? $F$ is the intersection point of lines $EL$ and $CD$.
4. Let $\boldsymbol{h}$ be the height of triangle $M L E$. Then the height of triangle $F L N$ will be $b-h, F N=x, x=\frac{a(b-h)}{h}$.

The sought double area $2 S=a h+\frac{a(b-h)^{2}}{h}$,

i.e., $2 S=a\left(h+\frac{b^{2}}{h}-2 b+h\right)=a\left(2 h+\frac{b^{2}}{h}-2 b\right)$.

The minimum value of the sought area is obtained when the expression $2 h+\frac{b^{2}}{h}$ is minimized. The product $2 h \cdot \frac{b^{2}}{h}=2 b^{2}$ is a constant, so the sought expression has its minimum value when $2 h=\frac{b^{2}}{h}$, from which $h=\frac{b \sqrt{2}}{2}$.

![](https://cdn.mathpix.com/cropped/2024_05_21_ec9ddf54a7c86775293eg-114.jpg?height=392&width=620&top_left_y=929&top_left_x=364)

Fig. 26

![](https://cdn.mathpix.com/cropped/2024_05_21_ec9ddf54a7c86775293eg-114.jpg?height=317&width=349&top_left_y=984&top_left_x=1319)

Fig. 27