# What's the median of $f(x) = 4xe^{-2x}$?

I'm trying to find the median of $$f(x) = 4xe^{-2x}$$.

So far, I've tried solving for $$q_{50}$$ by plugging it into an integral and setting it equal to 0.5 like so: $$\int_{0}^{q_{50}} 4xe^{-2x} dx = 0.5$$. I eventually get to $$-2q_{50}e^{-2q_{50}} - e^{-2q_{50}} + 1 = 0.5$$. Unfortunately, at this point, I have been unable to solve for $$q_{50}$$.

Is there something I've done wrong up to this point or another method that I could be using instead to find the median? Thanks for the help!

• Looks right to me. Solving it numerically, as here yields $q_{50}\approx .839173$
– lulu
Dec 12, 2021 at 22:25
• here it is in DESMOS
– WW1
Dec 12, 2021 at 22:30

Letting $$x=q_{50}$$, as @Vítězslav Štembera answered, you want to solve for $$x$$ the equation $$(2 x+1)\,e^{-2 x}=k \quad\implies\quad(2x+1)\,e^{-(2 x+1)}=\frac k e$$ The only explicit solution of it is given by $$x=-\frac{1}{2} \left(1+W_{-1}\left(-\frac{k}{e}\right)\right)$$ where $$W_{-1}(.)$$ is the second branch of Lambert function.
Your equation \begin{align} -2q_{50}e^{-2q_{50}} - e^{-2q_{50}} + 1 = 0.5 \end{align} i.e. \begin{align} (2q_{50}+1)e^{-2q_{50}}= 0.5 \end{align} is correct, however it is trascendental and must be solved numerically. Using MAPLE for example you can find $$q_{50}\approx 0.839173495$$.