Solution (source code)

= Solution

A <probability density function> must have total <integral> one. The numerator is an <even function>, so
$$
N=2\int_0^2(1+e^{-x})\,dx=2[\,x-e^{-x}\,]_0^2=\boxed{6-2e^{-2}}.
$$
This is positive, ensuring nonnegativity of the <probability density function>.