Minimize an integral (recreational integration) Here’s a neat integration puzzle (whose solution is rather pleasing) that I thought some of MSE’s integration buffs might enjoy:

Find the value of $\alpha$ that minimizes the integral
  $$\int_{-1}^\infty \frac{dx}{(\alpha+1/2)e^{\alpha x}+x+1}$$

For a more difficult (and even more pleasing) challenge, try this generalization:

For some function $f$, define
  $$g(\alpha) = \int_{-1}^\infty \frac{dx}{f(\alpha)e^{\alpha x}+x+1}$$
  For what values of $\alpha$ does $g’(\alpha)=0$?

 A: For the first question:
Obviously $\alpha>0$ is needed for convergence of the integral.
By the substitution $t=\alpha(x+1)$,
$$I(\alpha):=\int_{-1}^\infty \frac{dx}{(\alpha+1/2)e^{\alpha x}+x+1}=\int_{0}^\infty \frac{dt}{(\alpha^2+\alpha/2)e^{-\alpha}e^{t}+t}=\int_{0}^\infty \frac{dt}{A(\alpha)e^{t}+t}$$
Since $$\frac{dI}{dA}=-\int^\infty_0\frac{e^x}{(x+Ae^x)^2}dx<0$$ $I(\alpha)$ minimizes when $A(\alpha)$ maximizes.
Note that $$\frac{dA}{d\alpha}=\left(-\alpha^2+\frac{3\alpha}{2}+\frac12\right)e^{-\alpha}$$
$A(\alpha)$ has the global maximum at $\alpha_c=\frac{3+\sqrt{17}}{4}$, which coincides with the numerical guess made by @Mariusz Iwaniuk.
A: I decided to expand on Szeto's approach to find the solution for all $f$. Making the same substitution, $t = \alpha(x+1)$, we get $$g(\alpha) = \int_{0}^{\infty} \frac{1}{\alpha f(\alpha)e^{t-\alpha}+t} dt$$
Then differentiating with respect to $\alpha$, we get $$g'(\alpha) = \int_{0}^{\infty}\left(\frac{-e^{t}e^{-\alpha}\left(\alpha\cdot\left(\frac{d}{d\alpha}f\left(\alpha\right)\right)+f\left(\alpha\right)\left(1-\alpha\right)\right)}{\left(\alpha f\left(\alpha\right)e^{-\alpha}e^{t}+t\right)^{2}}\right)dt$$
Factoring out the constant results in $$g'(\alpha) = e^{-\alpha}\left(\alpha\cdot\left(f'(\alpha)\right)+f\left(\alpha\right)\left(1-\alpha\right)\right)\int_{0}^{\infty}\left(\frac{-e^{t}}{\left(\alpha f\left(\alpha\right)e^{-\alpha}e^{t}+t\right)^{2}}\right)dt$$
The integral part will always be negative since the numerator is always negative and the denominator is positive. Therefore, for $g'(\alpha) = 0$ to be true, $$\alpha f'\left(\alpha\right)+f\left(\alpha\right)\left(1-\alpha\right) = 0$$ must be true. I believe solving for $\alpha$ is impossible in the general case, without knowing $f$, but that should give where $g'(\alpha) = 0$.
Thank you to Martin Gales for pointing out my error in my previous answer.
