I have to calculate a rather difficult integral, and I was asking myself if there were clever ways to approach this integral. I have to calculate $E[X^2]$. I know that $E[X] = \frac{1}{2}$, because of symmetry in the point $x = \frac{1}{2}$.
Let $f_X(x) = \alpha k(\alpha) \left(2 - e^{x-1/\alpha} - e^{-x/\alpha} \right)$,
then $E[X^2] = \int_{x=0}^{x=1} x^2 \cdot \alpha k(\alpha) \left(2 - e^{x-1/\alpha} - e^{-x/\alpha} \right)$d$x$
Note that this function is only defined between $0 \le x \le 1$.
Do I have to calculate this by brute force, or can I do something more elegant here?
Hint. Integrating by parts twice, one gets $$ \int_0^1x^2e^{ax}dx=\left(\frac{2}{a^3}-\frac{2}{a^2}+\frac{1}{a}\right)e^a-\frac2{a^3},\qquad a \neq0. $$ Then one may apply it to $$ \begin{align} E[X^2] &= \alpha k(\alpha)\int_{0}^{1} x^2 \cdot \left(2 - e^{x-1/\alpha} - e^{-x/\alpha} \right)dx \\&=2 \alpha k(\alpha)\int_{0}^{1}x^2dx- \alpha k(\alpha)e^{-1/\alpha}\int_{0}^{1}x^2e^{x}dx- \alpha k(\alpha)\int_{0}^{1}x^2e^{-x/\alpha}dx. \end{align} $$