I am solving the below integral. 

$$\int\_{0}^{1} (e^{\frac{-x}{a}}-a(1-e^{-\frac{1}{a}}))^2 dx$$

I can decompose the integrand to the simple elements doing all the algebra and then split and calculate all the integrals separately but this seems to be a very awkward way prone to mistakes. 

Do you see any simpler way to solve it? 

for a=2 I expect to get 0.0128