Problem: Evaluate $\int (e^{2x}+2e^{x}-e^{-x}-1)e^{e^{x}+e^{-x}} dx$
My teacher gave me this indefinite integration problem and this one was immediately after he taught us how to evaluate integrals such as the one mentioned below
$\int e^{x}(f(x)+f'(x))$ $dx$ = $e^{x}f(x)+c$
So there is a high chance he expected us to evaluate the integral in the title using this method.
But I am unable to resolve the integral into that form. I obviously doing $e^{x}+e^{-x}=u$ but did not succeed. Any help would be appreciated.
Let $e^x=t$. Then $e^x dx = dt \Rightarrow dx = dt/t$. We have $$I=\int e^{t+\frac{1}{t}}\Big(t^2 + 2t -\frac{1}{t} -1 \Big) \frac{dt}{t} = \int e^{t+\frac{1}{t}}\Big(t + 2 -\frac{1}{t^2} -\frac{1}{t} \Big) dt$$ Notice if we are going to set $t+\frac{1}{t}=u$, then $\big(1-\frac{1}{t^2}\big)dt=du$ ; a factor of $\big(1-\frac{1}{t^2}\big)$ must appear. So rewrite $$I=\int e^{t+\frac{1}{t}}\Big\{t -\frac{1}{t} + 1 + 1 -\frac{1}{t^2} \Big\} dt$$ $$=\underbrace{\int e^{t+\frac{1}{t}}\Big\{t\Big(1 -\frac{1}{t^2} \Big) + 1\Big\}}_{I_1} +\underbrace{\int e^{t+\frac{1}{t}} \Big\{ 1 -\frac{1}{t^2} \Big\}}_{I_2} dt$$ $$=\underbrace{\int \Big\{ t \cdot e^{t+\frac{1}{t}}\Big(1 -\frac{1}{t^2} \Big) + e^{t+\frac{1}{t}}\Big\}}_{I_1} +\underbrace{\int e^{t+\frac{1}{t}} \Big\{ 1 -\frac{1}{t^2} \Big\}}_{I_2} dt$$ $I_2$ is straightforward. Recognize $I_1$ is of the form $\int \{ yf'(y)+f(y)\}\,dy$ with antiderivative $yf(y)+C$. Therefore $$I=te^{t+\frac{1}{t}} + e^{t+\frac{1}{t}}+ C=(t+1)e^{t+\frac{1}{t}}+ C$$ $$I=(e^x+1)e^{e^x+e^{-x}}+C$$