How to solve recursions when the final term of recursion is given?

65 Views Asked by At

I am trying to find the general integral of $$ \int x^n e^x$$

Note: n belongs to the set of whole numbers

After reading the answer by Yves Daoust here, I got inspired to try a new method of doing this integral. To motivate the idea, consider the function below:

$$ f(x) = x^n e^x$$

If I derivative this function,

$$ f'(x) = [ x^n + n x^{n-1} ] e^x$$

Even after taking derivative, the function is of form $P(x) e^x$ with the degree of polynomial preserved. I.e: polynomial in the first equation has the same degree as the polynomial attached to $e^x$ in the derivated equation.

So, thinking of this in reverse, if I integrate an expression of form $P(x) e^x$ , I will get $e^x$ multiplied by some polynomial of same degree.


Hence, the integral of $ \int x^n e^x dx$ can be written as $ P(x) e^x + C $ where $P(x)$ is some polynomial of degree $n$.

This means:

$$ ( P(x) e^x)' = x^n e^x$$

Or,

$$ P(x) + P'(x) = x^n$$

Assume $P(x)$ is some polynomial of form:

$$ P(x) = \sum_{i=0}^n a_i x^i$$

Then, our expression becomes:

$$ \sum_{i=0}^n a_i x^i + \sum_{i=0}^n ia_i x^{i-1} = x^n$$

Or,

$$a_n x^n+ \sum_{i=0}^{n-1} a_i x^i + (i+1) a_{i+1} x^i = x^n$$

Rewriting,

$$ a_n x^n + \sum_{i=0}^{n-1} x^i [ a_i + (i+1)a_{i+1} x^i ] = x^n$$

By comparing the coefficient of a polynomial on both sides:

$$ a_n = 1$$

And,

$$ a_i + (i+1) a_{i+1} = 0$$

Now, my question is how I can solve this recursion? and find expression for general term $a_i$ (without induction)?

2

There are 2 best solutions below

1
On BEST ANSWER

Rewrite the recurrence as $$a_{i+1} = -\frac{a_i}{i+1}$$ for $0 \leq i \leq n-1$, with $a_n = 1$. Consider the product $$\prod_{i=j}^{n-1}a_{i+1}=(-1)^{n-j}\prod_{i=j}^{n-1}\frac{a_i}{i+1}=\frac{(-1)^{n-j}j!}{n!}\prod_{i=j}^{n-1}a_i$$ for $0\leq j\leq n-1$. Since none of the $a_i$ can be zero (since $a_n=1$), we can cancel out the $a_i$'s that appear on either side of the last equation. It follows that $$a_k = \frac{(-1)^{n-k}n!}{k!}, \:k\in\{0,1,2,\cdots,n\}$$ Does that answer your question?

0
On

$$I_n=\int x^n e^x dx$$

Use IBP

$$I_n=x^ne^x-\int e^x(nx^{n-1})dx $$

$$I_n=x^ne^x-\left(n\int e^xx^{n-1}dx\right) $$

$$I_n=x^ne^x-\left(n\left(x^{n-1}e^x-(n-1)\int{e^xx^{n-2}}dx\right)\right) $$

Follow this pattern and note that

$$I_n=x^ne^x-nx^{n-1}e^x+n(n-1)x^{n-2}e^x-n(n-1)(n-2)x^{n-3}e^x+\cdots$$

$$I_n=\binom{n}{0}x^ne^x-\binom{n}{1}x^{n-1}e^x+\binom{n}{2}x^{n-2}e^x-\binom{n}{3}x^{n-3}e^x+\cdots$$

$$\boxed{I_n=e^x\sum_{r=1}^{n+1}(-1)^{r+1}\binom{n}{r-1}x^{n-r+1}}$$

Or

$$I_n=e^x\sum_{r=0}^{n}(-1)^{r}\binom{n}{r}x^{n-r}$$

$$\boxed{I_n=x^ne^x\sum_{r=0}^{n}\frac{(-1)^{r}\binom{n}{r}}{x^r}}$$