Trying to evaluate : $\int \frac{e^{x^2}+2xe^{x}}{e^{x^2}+e^x} dx$

Here is an alternative way

$\displaystyle\int \frac{e^{x^2}+2xe^{x}}{e^{x^2}+e^x} dx=\int \frac{e^{x^2}+2xe^{x}+e^x-e^x}{e^{x^2}+e^x} dx=$

$\displaystyle x+\int \frac{(2x-1)e^{x}}{e^{x^2}+e^x} dx=x+\int \frac{(2x-1)}{e^{x^2-x}+1} dx=x+\int\frac{du}{e^u-1}$

Can you now continue?


Using Mathematica, we can obtain via:

Integrate[(Exp[x^2] + 2 x*Exp[x])/(Exp[x^2] + Exp[x]), x]

an exact form:

$$\int \frac{e^{x^2}+2 x e^x}{e^{x^2}+e^x} \, dx=x^2-\log \left(e^{x^2}+e^x\right)+x$$

the plot looks as follows:

enter image description here

Behind the scenes it shows the transformation:

$$\int 1+\frac{e^x(2x-1)}{e^x+e^{x^2}} \, dx=x+\int \frac{e^x(2x-1)}{e^x+e^{x^2}} \, dx=x+\int \frac{2e^xx}{e^x+e^{x^2}}-\frac{e^x}{e^x+e^{x^2}} \, dx=x+\int \frac{2e^xx}{e^x+e^{x^2}}\, dx-\int \frac{e^x}{e^x+e^{x^2}} \, dx$$