We have a function $$ f(x)=\frac{(1-q^x)\times q^{(2-x)}}{x^2} $$ The task is to find the point where the function is minimum. I have an assumption that $q$ is a value in the range $(0,1)$.
I am trying to find the closed-form solution for $x_{min}$, the point of minimum.
My attempt is as follows:
Taking log followed by derivative w.r.t $x$ and equating it to zero gives,
$-\frac{q^{x} \times log (q)}{1-q^x}-log (q)-\frac{2}{x}=0$
$\implies\frac{1+q^x}{1-q^x} \times log(q)=-\frac{2}{x}$
How to simplify further is where I am facing problem? I am specially interested in the case when $q$ is closer to 1. I tried the following approximation :
$\frac{1+q^x}{1-q^x}=\frac{2-px}{px},$ where $p=1-q$. This lead to $x_{min}=\frac{2}{log(1/q)}$. But, in fact, I would like to improve this using a better approximation. Can someone give me any tips on how to proceed ? What better approximations can I use?
$$f(x)=\frac{(1-q^x)\times q^{(2-x)}}{x^2}\implies f'(x)=\frac{q^{2-x} \left(2 q^x-x \log (q)-2\right)}{x^3}$$ So, we need to solve for $x$ $$2 q^x-x \log (q)-2=0$$ the solution of which being $$x_*=-\frac{W\left(-\frac{2}{e^2}\right)+2}{\log (q)}\approx -\frac{1.59362}{\log (q)}$$ where $W(.)$ is Lambert function.
Now $$f''(x)=\frac{q^{2-x} \left(-6 q^x+x \log (q) (x \log (q)+4)+6\right)}{x^4}$$ and then $$f''(x_*)=-\frac{2 q^2 \left(W\left(-\frac{2}{e^2}\right)+1\right) \log ^4(q)}{W\left(-\frac{2}{e^2}\right) \left(W\left(-\frac{2}{e^2}\right)+2\right)^3}$$ which is positive if $0 \leq q \leq 1$; so $x_*$ corresponds to a minimum.
Now $$f(x_*)=-\frac{q^2 \log ^2(q)}{W\left(-\frac{2}{e^2}\right) \left(W\left(-\frac{2}{e^2}\right)+2\right)}\approx 1.54414\, q^2 \log ^2(q)$$