A mysterious equality $\int_0^1 \left( e^x+x-1\right) e^{-\frac{x}{\mathrm{e}^x-1}}~dx=(e-1)^2e^{\frac e{1-e}}$ I can't prove this mysterious equality $$\int_0^1 \left(e^x+x-1\right)e^{-\frac{x}{\mathrm{e}^x-1}}dx=(e-1)^2e^{\frac e{1-e}}.$$
The changes of variables I used lead to nowhere.
Origin:
My friend proposed  me two integrals:

*

*The first is the object of the question and the second is to prove that  $\quad\displaystyle \int_0^\infty \dfrac{x}{1-\text{e}^{-x}}\exp\left(\dfrac{x}{\text{e}^{-x}-1}\right)dx=1$.

*The second is of the form $\displaystyle \int_0^\infty g(h(x) dx$ where $h(x)=\dfrac{x}{1-\text{e}^{-x}}$ and $g(x)=xe^{-x}$. By using properties of h and g and especially that $h(x)-h(-x)=x,\quad  \forall x\in \mathbb R$, we can show that  $\displaystyle \int_0^\infty g(x)dx=\int_0^\infty g\circ h(u)du$ and the result is proven.

 A: $$I=\int_0^1 (e^x+x-1)\exp\left(\frac{-x}{e^x-1}\right)dx=\int_0^1 (e^x+x-1)e^x\exp\left(\frac{xe^x}{1-e^x}\right)dx$$
$$=\color{blue}{\int_0^1 (e^x-x-1)e^x\exp\left(\frac{xe^x}{1-e^x}\right)dx}+2\color{red}{\int_0^1 xe^x\exp\left(\frac{xe^x}{1-e^x}\right)dx}=I_1+2I_2$$

$$I_1=\int_0^1 e^x(e^x-x-1)\exp\left(\frac{xe^x}{1-e^x}\right)dx=-\int_0^1 (e^x-1)^2\left(\exp\left(\frac{xe^x}{1-e^x}\right)\right)'dx$$
$$=-(e-1)^2e^{\frac{e}{1-e}}+2\int_0^1 e^x (e^x-1)\exp\left(\frac{xe^x}{1-e^x}\right)dx$$
$$\underbrace{I_1+2I_2}_{=I}=-(e-1)^2e^{\frac{e}{1-e}}+2\underbrace{\int_0^1 e^x (\color{blue}{e^x}\color{red}{+x}\color{blue}{-1})\exp\left(\frac{xe^x}{1-e^x}\right)dx}_{=I}$$
$$\Rightarrow I=-(e-1)^2e^{\frac{e}{1-e}}+2I = \boxed{(e-1)^2e^{\frac{e}{1-e}}}$$
A: A factor of the form $e^{f(x)}$ is fairly robust under differentiation and integration. This suggests the following ansatz:
$$ \int (e^x - 1 + x)e^{-\frac{x}{e^x-1}} \, \mathrm{d}x = F(x) e^{-\frac{x}{e^x-1}} $$
for some function $F(x)$. Moreover, for OP's equality to hold, we must have
$$ F(1)e^{\frac{1}{1-e}} - F(0)e^{-1} = (e-1)^2 e^{\frac{e}{1-e}}. $$
This suggests that $F(x)$ would satisfy
$$ F(1) = (e-1)^2 e^{-1} \qquad\text{and}\qquad F(0) = 0. $$
So, we can try
$$ F(x) = (e^x - 1)^2 e^{-x} $$
and et voilà! This works:
$$ \int (e^x - 1 + x)e^{-\frac{x}{e^x-1}} \, \mathrm{d}x = (e^x - 1)^2 e^{-x} e^{-\frac{x}{e^x-1}} + \mathsf{C}. $$
Therefore the desired equality indeed holds.
A: My approach: I am Assuming that OP has not given RHS :)
We have
$$I=\int\left(e^x+x-1\right) e^{\frac{-x}{e^x-1}} d x$$
Let $$f(x)=\frac{-x}{e^x-1}$$ Then its derivative is
$$f'(x)=\frac{(x-1) e^x+1}{\left(e^x-1\right)^2}$$
Now comes the Tricky part:
$$e^x+x-1=\left((x-1) e^x+1+e^{2 x}-1\right) e^{-x}$$
$$\begin{aligned}
&\Rightarrow e^x+x-1=\left((x-1) e^x+1\right) e^{-x}+\left(e^x-e^{-x}\right) \\
\\
&\Rightarrow e^x+x-1=e^{-x}\left(e^x-1\right)^2 \frac{\left((x-1) e^x+1\right)}{\left(e^x-1\right)^2}+\left(e^x-e^{-x}\right)
\end{aligned}$$
Now multiplying both sides with $e^{f(x)}$ and Integrating we get:
$$\Rightarrow\left(e^x+x-1\right) e^{f(x)}=e^{-x}\left(e^x-1\right)^2 f^{\prime}(x) e^{f(x)}+\left(e^x-e^{-x}\right) e^{f(x)}$$
$$\Rightarrow I=\int e^{-x}\left(e^x-1\right)^2 f^{\prime}(x) e^{f(x)}\:dx+\int \left(e^x-e^{-x}\right)e^{f(x)}\:dx $$
Now Evaluate the first integral above by parts taking $u=e^{-x}(e^x-1)^2,\:v=f'(x)e^{f(x)}$
We get
$$I=e^{-x}\left(e^x-1\right)^2 e^{f(x)}-\int \frac{d}{d x}\left(e^{-x}\left(e^x-1\right)^2\right) e^{f(x)} d x+\int\left(e^x-e^{-x}\right) e^{f(x)} d x$$
Now Interestingly
$$\frac{d}{d x}\left(e^{-x}\left(e^x-1\right)^2\right)=\frac{d}{d x}\left(e^x-2+e^{-x}\right)=e^x-e^{-x}$$
Are we happy now, Yes last two integrals cancels.
Thus $$I=e^{-x}(e^x-1)^2\times e^{\frac{-x}{e^x-1}}+C$$
Now the Definite Integral is a piece of cake.
