Solution (source code)

= Solution

The <function graphs> intersect when $2x=4xe^{-x}$, so $x=0$ or $x=\ln2$. For $0<x<\ln2$, the <exponential function> satisfies $e^{-x}>1/2$, making $4xe^{-x}$ the upper graph. The enclosed <area> is therefore
$$
\begin{aligned}
A&=\int_0^{\ln2}(4xe^{-x}-2x)\,dx\\
&=[-4(x+1)e^{-x}-x^2]_0^{\ln2}\\
&=\boxed{2-2\ln2-(\ln2)^2.}
\end{aligned}
$$
The <antiderivative> of $xe^{-x}$ follows by <integration by parts>.