Given:
\(\mathrm{I=\int \frac{x e^{x}}{\sqrt{1+e^{x}}} d x}\) .....(A)
Take \(1+\mathrm{e}^{\mathrm{x}}=\mathrm{t}^{2} \quad \ldots .(1)\)
Differentiating with respect to \(\mathrm{x}\), we get
\( \mathrm{e}^{\mathrm{x}} \mathrm{dx}=2 \mathrm{tdt}\)
From equation (1), we get
\(\mathrm{e^{x}=t^{2}-1}\)
So, \(\mathrm{x}=\log \left(\mathrm{t}^{2}-1\right)\)
Now, put the above values in equation (A)
\(\mathrm{I}=\int \frac{\log \left(\mathrm{t}^{2}-1\right)}{\sqrt{\mathrm{t}^{2}}} 2 \mathrm{tdt}\)
\(=2 \times \int \frac{\log \left(\mathrm{t}^{2}-1\right)}{\mathrm{t}} \times \mathrm{tdt}\)
\(=2 \int \log \left(\mathrm{t}^{2}-1\right) \mathrm{d t}\)
Using integration by parts rule, we get
Integration by parts:
\( \int \mathrm{uvdx}=\mathrm{u} \int \mathrm{vdx}-\int\left(\frac{\mathrm{du}}{\mathrm{dx}} \times \int \mathrm{v} \mathrm{dx}\right) \mathrm{dx}+\mathrm{c}\)
\(=2\left[\mathrm{\log \left(t^{2}-1\right) \times t-2 \int \frac{t^{2}}{t^{2}-1} d t}\right]\)
\(=\mathrm{2 t \log \left(t^{2}-1\right)-4 \int\left[1+\frac{1}{t^{2}-1}\right] d t}\)
\(=\mathrm{2 t \log \left(t^{2}-1\right)-4 t-4 \times \frac{1}{2} \log \left(\frac{t-1}{t+1}\right)+c}\)
\(=\mathrm{2 t \log \left(t^{2}-1\right)-4 t-2 \log \left(\frac{t-1}{t+1}\right)+c}\)
\(=\mathrm{2 t\left(\log \left(t^{2}-1\right)-2\right)-2 \log \left(\frac{t-1}{t+1}\right)+c}\)
Resubstitute the value of \(\mathrm{t}\), we get
\(=\mathrm{2(x-2) \sqrt{1+e^{x}}-2 \log \frac{\sqrt{1+e^{x}}-1}{\sqrt{1+e^{x}}+1}+c}\)
\(=(2 \mathrm{x}-4) \sqrt{1+\mathrm{e}^{\mathrm{x}}}-2 \log \frac{\sqrt{1+\mathrm{e}^{\mathrm{x}}}-1}{\sqrt{1+\mathrm{e^{x}}}+1}+\mathrm{c}\).......(2)
On comparingequation(2) with question, we get
\(\mathrm{f(x) = 2 x-4}\)