TITLE: $\int \left[\left(\frac{x}{e}\right)^x + \left(\frac{e}{x}\right)^x\right]\ln x \,dx$
QUESTION [9 upvotes]: Integrate:
$$\int \left[\left(\frac{x}{e}\right)^x + \left(\frac{e}{x}\right)^x\right]\ln x \,dx$$
This question looks like of the form of $$\int\ e^x(f(x)+f'(x))\,dx,$$ but don't know how to get the proper substitution?

REPLY [3 votes]: $\bf{My\; Solution::}$ Let  $$\displaystyle I =  \int \left[\left(\frac{x}{e}\right)^x+\left(\frac{e}{x}\right)^x\right]\cdot \ln (x) dx$$
Now we can write $$\displaystyle \left(\frac{x}{e}\right)^x = x^x \cdot e^{-x} = e^{x\cdot \left(\ln x-1\right)}.............(\star)\color{\red}\checkmark$$
And we can write $$\displaystyle \left(\frac{e}{x}\right)^x=x^{-x}\cdot e^x = e^{-x\cdot \left(\ln x-1\right)}.............(\star)\color{\red}\checkmark$$
Now We can write $$\displaystyle \left[\left(\frac{x}{e}\right)^x+\left(\frac{e}{x}\right)^x\right]=e^{x\cdot \left(\ln x-1\right)}+e^{-x\cdot \left(\ln x-1\right)}= 2\cos h(x\cdot \left[\ln x-1\right])$$
Bcz we can write $$\displaystyle \sin h y  = \left(\frac{e^y-e^{-y}}{2}\right)$$ and $$\displaystyle \cos h y  = \left(\frac{e^y+e^{-y}}{2}\right)$$
So Integral $$\displaystyle I = 2\int \cos h(x\cdot \left[\ln x-1\right])\cdot \ln(x)dx $$
Now Let $$x\cdot \left[\ln x-1\right]=u\;,$$ Then $$\ln(x)dx = du$$
So Integral $$\displaystyle I = 2\int \cos hudu = 2\sin hu+\mathcal{C} = e^{x\cdot \left(\ln x-1\right)}-e^{-x\cdot \left(\ln x-1\right)}+\mathcal{C}$$
So $$\displaystyle I = \int \left[\left(\frac{x}{e}\right)^x+\left(\frac{e}{x}\right)^x\right]\cdot \ln (x) dx = \left[\left(\frac{x}{e}\right)^x-\left(\frac{e}{x}\right)^x\right]+\mathcal{C}$$