# Thread: Integral with Recursion Relation

1. ## Integral with Recursion Relation

Problem
====================
Let $\displaystyle E_{n} = \int_0^1 x^ne^{x-1}dx$

with the following recursion relation

$\displaystyle E_n = 1 - nE_{n-1}$

Start with the index n = 1 and group to the index n = 20. How can you tell that the results are incorrect and at what index n?

Attempt
====================

I do not think that the results can be incorrect; I think it is true for all indices.

First, I integrate $\displaystyle E_n$ using integration by parts (I forgot how to do the "evaluate from/to" symbol in Latex so I used a bracket)

$\displaystyle E_n = \int_0^1 x^ne^{x-1}dx = [x^ne^{x-1}]_{0}^{1} - \int_0^1 nx^{n-1}e^{x-1}dx$

Simplify to get

$\displaystyle = 1- n \int_0^1 x^{n-1}e^{x-1}dx$

Since $\displaystyle E_{n} = \int_0^1 x^ne^{x-1}dx$, then $\displaystyle E_{n-1} = \int_0^1 x^{n-1}e^{x-1}dx$

Thus,

$\displaystyle = 1 - nE_{n-1}$

Shouldn't this be true for all indices n? I wrote a MATLAB script that computed $\displaystyle E_n, E_{n-1}$ at all indices and the results look fine.

2. Originally Posted by Paperwings
Problem
====================
Let $\displaystyle E_{n} = \int_0^1 x^ne^{x-1}dx$

with the following recursion relation

$\displaystyle E_n = 1 - nE_{n-1}$

Start with the index n = 1 and group to the index n = 20. How can you tell that the results are incorrect and at what index n?

Attempt
====================

I do not think that the results can be incorrect; I think it is true for all indices.

First, I integrate $\displaystyle E_n$ using integration by parts (I forgot how to do the "evaluate from/to" symbol in Latex so I used a bracket)

$\displaystyle E_n = \int_0^1 x^ne^{x-1}dx = [x^ne^{x-1}]_{0}^{1} - \int_0^1 nx^{n-1}e^{x-1}dx$

Simplify to get

$\displaystyle = 1- n \int_0^1 x^{n-1}e^{x-1}dx$

Since $\displaystyle E_{n} = \int_0^1 x^ne^{x-1}dx$, then $\displaystyle E_{n-1} = \int_0^1 x^{n-1}e^{x-1}dx$

Thus,

$\displaystyle = 1 - nE_{n-1}$

Shouldn't this be true for all indices n? I wrote a MATLAB script that computed $\displaystyle E_n, E_{n-1}$ at all indices and the results look fine.