Find the maximum value of the integral $\int_{-1}^1|x-a|e^xdx$ where $|a|\le1$

463 Views Asked by At

Question:

Find the maximum value of the integral $\int_{-1}^1|x-a|e^xdx$ where $|a|\le1$

My Attempt:

Let $f(a)=\int_{-1}^a(a-x)e^xdx+\int_{a}^1(x-a)e^xdx$

$f'(a)=\int_{-1}^ae^xdx+\int_{a}^1-e^xdx$

$f'(a)=e^a-e^{-1}-(e-e^a)$

For maximum, $f'(a)=0$

So, $2e^a-e-e^{-1}=0\implies 2e^a=e+\frac1e$

So, $e^a=\frac{e^2+1}{2e}\implies a=\ln\left(\frac{e^2+1}{2e}\right)$

But the answer given is: Max value $e+e^{-1}$ when $a=-1$

What's wrong in my approach?

Edit:

For derivative, I have used Leibniz Integral Rule

1

There are 1 best solutions below

2
On BEST ANSWER

Start from your step: $f'(a)=e^a-e^{-1}-(e-e^a)$

$$f''(a)=2e^a>0$$

So your $a=\ln(\frac{e^2+1}{2e})$ is local minima, not maxima, the function is concave up with respect to $a$, so you will find the maxima at one of two endpoints. Therefore, it is consistent with the answer in your book, which occurs at $a=-1$