21. In trapezoid $ABCD$ with lower base $AB$ having two fixed points $M, N$, and a moving point $P$ on the upper base $CD$. Let $E=DN \cap AP$, $F=DN \cap MC$, $G=MC \cap PB$, and $DP=\lambda DC$. For what value of $\lambda$ is the area of quadrilateral PEFG maximized? (1988 National Training Team Selection Test)
21. Take $DC$ as the unit length, i.e., $DC=1$, then $DP=\lambda, DC=1-\lambda$, let $AM=a, MN=b, NB=c$, and the height of the trapezoid be $h$.

Draw a line through $C$ parallel to $PB$ intersecting the extension of $AB$ at $Q$, as shown in the figure. Then $PCQB$ is a parallelogram, so $BQ=PC=1-\lambda$. Thus,
$$\begin{array}{l}
\frac{S_{\triangle MGE}}{S_{\triangle MCQ}}=\left(\frac{MB}{MQ}\right)^2=\frac{(b+c)^2}{(b+c+1-\lambda)^2} \\
\text{Also, } S_{\triangle MCQ}=\frac{1}{2}(b+c+1-\lambda) h, \text{ hence } \\
S_{\triangle MCB}=\frac{(b+c)^2}{2(b+c+1-\lambda)} h
\end{array}$$

Similarly, we can get
$$S_{\triangle ANE}=\frac{(a+b)^2 h}{2(a+b+\lambda)}$$

From $S_{PEFG}=S_{\triangle APB} - (S_{\triangle MGB} + S_{\triangle ANE}) + S_{\triangle FMN}$, we know that when $S_{\triangle MGB} + S_{\triangle ANE}$ is minimized, $S_{PEFG}$ is maximized.

And
$$\begin{array}{l}
S_{\triangle MGB} + S_{\triangle ANE}= \\
\frac{h}{2}\left[\frac{(a+b)^2}{a+b+\lambda} + \frac{(b+c)^2}{b+c+1-\lambda}\right]
\end{array}$$

By the Cauchy-Schwarz inequality, we have
$$\begin{array}{l}
\left[\frac{(a+b)^2}{a+b+\lambda} + \frac{(b+c)^2}{b+c+1-\lambda}\right](a+b+\lambda) + (b+c+1-\lambda) \geqslant \\
[(a+b) + (b+c)]^2 = (a+2b+c)^2
\end{array}$$

The equality holds if and only if $\frac{(a+b)^2}{(a+b+\lambda)^2} = \frac{(b+c)^2}{(b+c+1-\lambda)^2}$, i.e., $\lambda = \frac{a+b}{a+2b+c} = \frac{AN}{AN+MB}$.

From equations (1) and (2), we get
$$S_{\triangle MGB} + S_{\triangle ANE} \geqslant \frac{h(a+2b+c)}{2(a+2b+c+1)}$$

When and only when $\lambda = \frac{AN}{AN+MB}$, $S_{\triangle MGB} + S_{\triangle ANE}$ is minimized, and at this time, $S_{PEFG}$ is maximized. In summary, when and only when $\lambda = \frac{AN}{AN+MB}$, the area of quadrilateral $PEFG$ is maximized.