# Integrating: $\int \limits_{0}^{1} (1+xe^x)e^{e^x}dx$ (wolfram alpha doesn't provide the steps for this one)

How do I integrate this thing?

$\int \limits_{0}^{1} (1+xe^x)e^{e^x}dx$

I've tried all the different integration methods and "by parts" combinations for $u$ and $dv$...

-

Notice first that $(d/dx)(e^{e^x}) = e^x.e^{e^x}$. Integrating by parts, we see that $$\int xe^xe^{e^x} dx = xe^{e^x} - \int e^{e^x} dx$$ Hence $$\int (1 + xe^x)e^{e^x} dx = xe^{e^x} + C$$ and the definite integral $$\int_0^1 (1 + xe^x)e^{e^x} dx = e^e$$

-
that's like saying "notice the answer"... am I supposed to guess or recognize the derivative of $e^{e^x}$ ? –  nofe Feb 2 '12 at 17:40
I'm sorry you don't like it. It's a very natural thing to notice because the derivative of $e^{f(x)}$ is $f'(x)e^{f(x)}$. –  Simon S Feb 2 '12 at 17:43
@nofe: To be blunt, yes, you are supposed to recognize the derivative of $e^{e^x}$. –  Brian M. Scott Feb 2 '12 at 17:50
If nothing else, now you've seen this method you'll be able to cope with integrals such as $$\int (\sec x . \tan x + 1)e^{\sin x} dx$$ –  Simon S Feb 2 '12 at 17:54
which parts did you use to plug in? I've already tried integrating partially by setting $dv=(1+xe^x)$ and $u=e^{e^x}$ and that didn't work. –  nofe Feb 2 '12 at 17:57

This might be a long or a short question,deppending on how you see it. Integration is much like learning kung fu. You learn all these "secret" cool tricks to be able to tear down huge scary baddases (also know as integrals)

When to use these cool and secret commes only with much practice, after solving hundreds of integrals you start to develop a gutt feeling for what will work. But before that, it will require much blood, tears and sweat.

One of these hidden techniques I have discovered is integration by cancelation, in lack of a better word for it. The gist of it is breaking the integral into parts, then use integration by parts on one of the parts to obtain some kind of helpful cancelation.

I give two examples below, first the easiest example (although a very cool one) Evaluate the integral below

$$I = \int \sin(\ln x) + \cos(\ln x) \, \mathrm{d}x$$

The standard method of solving this integral is by either rewriting using complex numbers, or use the substitution $u=ln x$ and $x = e^u$. I will spare you for the details, but the problem is rather cumbersome (although an exellent excercise, try it!)

Now, for the experienced kung fu integrator, he will solve this problem by using integration by parts. We use parts on the first part of our integral. Let

\begin{align} u &= \sin(\ln x) \qquad \quad v' = 1 \\ u'&=\frac{1}{x}\cos(\ln x) \qquad \, v = x \end{align}

This turns our integral into

\begin{align} I & = \int \sin(\ln x) + \cos(\ln x) \, \mathrm{d}x \\ I & = \int \sin(\ln x)\, \mathrm{d}x + \int \cos(\ln x) \, \mathrm{d}x \\ I & = \left[ x \sin(\ln x) - \int x \cdot \frac{1}{x} \cos(\ln x) \, \mathrm{d}x \right] + \int \cos(\ln x) \, \mathrm{d}x \\ I & = \left[ x \sin(\ln x) - \int \cos(\ln x) \, \mathrm{d}x \right] + \int \cos(\ln x) \, \mathrm{d}x \\ I & = x \sin(\ln x) + \mathcal{C} \end{align}

And so we see this made the computations a cakewalk. Now actually spotting this can be challengening. And to me this is usually some sort of last approach. Let us look at another example.

$$I = \int \left( 1 + 2x^2 \right)e^{x^2} \, \mathrm{d}x$$

Many will look at this integral, and claim that it is unsolvable in terms of elementary functions. They say this because they spot an $e^{x^2}$ in the integrand. This is closely relatated to the gaussian integral. However the integral above is "solvable" in lack of a better word. However most approaches will fail. I will leave it to you to show that the classical approaches all fail here: Integration by parts, and substitutions.

The "trick" here is to split the integral into two parts like below

$$I = \int e^{x^2} \, \mathrm{d}x + \int 2x^2 e^{x^2} \, \mathrm{d}x$$

Now if one were to use integration by parts on the first part. (Which might seem absurd, as we know it has no antiderivative) we obtain, once again, some clever cancelations. I will leave it to you, to fill in the details.

Now, the last problem here is very closely related to your problem. And by applying the exact same approach, we can calculate your integral. Please note, we never once assumed we knew the answer. The only thing we did was some rearrangements, and some clever use of integration by parts. Again, these things are hard to spot. But you will get used to it, and you will eventually learn kung fu. Below are one more problem you might want try to solve using this method.

$$\int \frac{2}{\log x} + \log(\log x) - \frac{1}{\log^2x} \, \mathrm{d}x$$

-
+1 for "Integration is much like learning kung fu." Hokuto Finger Shot of Emptiness! –  Korgan Rivera Feb 9 '12 at 2:54
I pressed your integral ki points, your integral will be solved in three days. –  N3buchadnezzar Feb 9 '12 at 7:32

Well, I was trying to come up with a more straightforward solution, but I think I just ended up lucking into it instead. I was hoping I could somehow eliminate one term with integration by parts. My first step eliminated the x term by multiplying the first part by $e^{-x}$ and the second by $e^x$ to get

$\int(e^{-x}+x)e^xe^{e^x}dx$

$u=e^{-x}+x,du=1-e^{-x}$

$dv=e^xe^{e^x}dx,v=e^{e^x}$

$\int(e^{-x}+x)e^xe^{e^x}dx=e^{e^x}(e^{-x}+x)-\int(1-e^{-x})e^{e^x}dx$

Problem now is if I try the same multiplication as before, I won't be able to eliminate any terms. However, it is possible to proceed from here. Instead, we'll multiply the first part by $e^x$ and the second part by $e^{-x}$.

$\int(1-e^{-x})e^{e^x}dx=\int(e^x-1)e^{-x}e^{e^x}dx=\int(e^x-1)e^{e^x-x}dx$

$z=e^x-x,dz=(e^x-1)dx$

$\int(e^x-1)e^{e^x-x}dx=\int e^zdz=e^z=e^{e^x-x}$

Plugging this back in, we get

$\int(1+xe^x)e^{e^x}dx=e^{e^x}(e^{-x}+x)-\int(1-e^{-x})e^{e^x}dx=$

$e^{e^x}(e^{-x}+x)-e^{e^x}e^{-x}+C=xe^{e^x}+C$

-