Referring to the diagram below:- !enter image description here
In $\triangle CAB$, let the length of the altitude through $C$ be $1$ unit.
In $\triangle CDE$, let the length of the altitude through $C$ be $x$ unit.
$\triangle CAB \sim \triangle CDE \implies AB : DE = 1 : x$
Area of $\triangle DEM$
$=\frac{1}{2}.DE. (1 – x)$
$=\frac{1}{2}.x. AB. (1 – x)$
Max(Area of $\triangle DEM$)
$= Max \frac{1}{2}.x. AB. (1 – x)$
$= \frac{AB}{2} Max(x – x^2)$ [$AB$ is given as constant]
For the quadratic function $(x – x^2)$, maximum occurs when $x = \frac{-(1)}{2(-1)} = \frac{1}{2}$
That is, $DE$ should be $0.5$ units from $C$ (on the altitude of $\triangle CAB$ through $C$ and its length is $1$ unit).