In [1]:
from proofs import integral_methods

Para observar los pasos de la demostración de un método de integración use la siguiente línea reemplazando su argumento por el número de puntos que desea en la aproximación. De forma automatica se construirán los pasos para su deducción.
Tenga en cuenta que los casos prácticos no poseen muchos puntos debido al incremento del número de operaciones lo cual a su vez se traduce en el aumento del error de representación por propagación, y entre más puntos la generación de la deducción tomará más tiempo.
Acorde a los métodos clásicos, use los siguientes números de puntos:

Número de puntos Método de integración
2 Trapecio
3 Simpson $1/3$
4 Simpson $3/8$

Notese que el nombre de los últimos dos casos corresponde al factor común que se extrae de las expresiones, y el primer caso debido a la geometría formada por dicha aproximación (observe que su aproximación es igual a la formula del área de dicha geometría).


In [2]:
integral_methods(4)


Integración numérica

Polinomio interpolante

Como primer paso se construyen los polinomios de Lagrange asociados a cada uno de los 4 puntos $x_i$ solicitados para la interpolación. Tenga en cuenta que los polinomios serán de grado 3.

$$L_{i,n}(x) = \prod_{j=0 \ j\neq i}^n \frac{x-x_j}{x_i-x_j}$$
$$L_{{0,4}}(x)=\frac{\left(x - x_{1}\right) \left(x - x_{2}\right) \left(x - x_{3}\right)}{\left(x_{0} - x_{1}\right) \left(x_{0} - x_{2}\right) \left(x_{0} - x_{3}\right)}$$
$$L_{{1,4}}(x)=\frac{\left(x - x_{0}\right) \left(x - x_{2}\right) \left(x - x_{3}\right)}{\left(- x_{0} + x_{1}\right) \left(x_{1} - x_{2}\right) \left(x_{1} - x_{3}\right)}$$
$$L_{{2,4}}(x)=\frac{\left(x - x_{0}\right) \left(x - x_{1}\right) \left(x - x_{3}\right)}{\left(- x_{0} + x_{2}\right) \left(- x_{1} + x_{2}\right) \left(x_{2} - x_{3}\right)}$$
$$L_{{3,4}}(x)=\frac{\left(x - x_{0}\right) \left(x - x_{1}\right) \left(x - x_{2}\right)}{\left(- x_{0} + x_{3}\right) \left(- x_{1} + x_{3}\right) \left(- x_{2} + x_{3}\right)}$$

Ahora, con los polinomios de Lagrange construidos y la evaluación de la función en los puntos, construimos el polinomio interpolante de grado 3, que suponemos como aproximación a la función.

$$P_4(x)=\frac{\left(x - x_{0}\right) \left(x - x_{1}\right) \left(x - x_{2}\right) f{\left (x_{3} \right )}}{\left(- x_{0} + x_{3}\right) \left(- x_{1} + x_{3}\right) \left(- x_{2} + x_{3}\right)} + \frac{\left(x - x_{0}\right) \left(x - x_{1}\right) \left(x - x_{3}\right) f{\left (x_{2} \right )}}{\left(- x_{0} + x_{2}\right) \left(- x_{1} + x_{2}\right) \left(x_{2} - x_{3}\right)} + \frac{\left(x - x_{0}\right) \left(x - x_{2}\right) \left(x - x_{3}\right) f{\left (x_{1} \right )}}{\left(- x_{0} + x_{1}\right) \left(x_{1} - x_{2}\right) \left(x_{1} - x_{3}\right)} + \frac{\left(x - x_{1}\right) \left(x - x_{2}\right) \left(x - x_{3}\right) f{\left (x_{0} \right )}}{\left(x_{0} - x_{1}\right) \left(x_{0} - x_{2}\right) \left(x_{0} - x_{3}\right)}$$

Integral analitica

Usando el polinomio interpolante, integramos analiticamente respecto a la variable $x$ en el intervalo dado por $\left[x_0, x_3\right]$ y obtenemos la siguiente aproximación.

$$\int_{x_0}^{x_3} f(x)dx\approx \int P_3(x)dx=- \frac{x_{0}^{4} \left(x_{0}^{2} x_{1} f{\left (x_{2} \right )} - x_{0}^{2} x_{1} f{\left (x_{3} \right )} - x_{0}^{2} x_{2} f{\left (x_{1} \right )} + x_{0}^{2} x_{2} f{\left (x_{3} \right )} + x_{0}^{2} x_{3} f{\left (x_{1} \right )} - x_{0}^{2} x_{3} f{\left (x_{2} \right )} - x_{0} x_{1}^{2} f{\left (x_{2} \right )} + x_{0} x_{1}^{2} f{\left (x_{3} \right )} + x_{0} x_{2}^{2} f{\left (x_{1} \right )} - x_{0} x_{2}^{2} f{\left (x_{3} \right )} - x_{0} x_{3}^{2} f{\left (x_{1} \right )} + x_{0} x_{3}^{2} f{\left (x_{2} \right )} + x_{1}^{2} x_{2} f{\left (x_{0} \right )} - x_{1}^{2} x_{2} f{\left (x_{3} \right )} - x_{1}^{2} x_{3} f{\left (x_{0} \right )} + x_{1}^{2} x_{3} f{\left (x_{2} \right )} - x_{1} x_{2}^{2} f{\left (x_{0} \right )} + x_{1} x_{2}^{2} f{\left (x_{3} \right )} + x_{1} x_{3}^{2} f{\left (x_{0} \right )} - x_{1} x_{3}^{2} f{\left (x_{2} \right )} + x_{2}^{2} x_{3} f{\left (x_{0} \right )} - x_{2}^{2} x_{3} f{\left (x_{1} \right )} - x_{2} x_{3}^{2} f{\left (x_{0} \right )} + x_{2} x_{3}^{2} f{\left (x_{1} \right )}\right)}{4 x_{0}^{3} x_{1}^{2} x_{2} - 4 x_{0}^{3} x_{1}^{2} x_{3} - 4 x_{0}^{3} x_{1} x_{2}^{2} + 4 x_{0}^{3} x_{1} x_{3}^{2} + 4 x_{0}^{3} x_{2}^{2} x_{3} - 4 x_{0}^{3} x_{2} x_{3}^{2} - 4 x_{0}^{2} x_{1}^{3} x_{2} + 4 x_{0}^{2} x_{1}^{3} x_{3} + 4 x_{0}^{2} x_{1} x_{2}^{3} - 4 x_{0}^{2} x_{1} x_{3}^{3} - 4 x_{0}^{2} x_{2}^{3} x_{3} + 4 x_{0}^{2} x_{2} x_{3}^{3} + 4 x_{0} x_{1}^{3} x_{2}^{2} - 4 x_{0} x_{1}^{3} x_{3}^{2} - 4 x_{0} x_{1}^{2} x_{2}^{3} + 4 x_{0} x_{1}^{2} x_{3}^{3} + 4 x_{0} x_{2}^{3} x_{3}^{2} - 4 x_{0} x_{2}^{2} x_{3}^{3} - 4 x_{1}^{3} x_{2}^{2} x_{3} + 4 x_{1}^{3} x_{2} x_{3}^{2} + 4 x_{1}^{2} x_{2}^{3} x_{3} - 4 x_{1}^{2} x_{2} x_{3}^{3} - 4 x_{1} x_{2}^{3} x_{3}^{2} + 4 x_{1} x_{2}^{2} x_{3}^{3}} + \frac{x_{0}^{3} \left(x_{0}^{3} x_{1} f{\left (x_{2} \right )} - x_{0}^{3} x_{1} f{\left (x_{3} \right )} - x_{0}^{3} x_{2} f{\left (x_{1} \right )} + x_{0}^{3} x_{2} f{\left (x_{3} \right )} + x_{0}^{3} x_{3} f{\left (x_{1} \right )} - x_{0}^{3} x_{3} f{\left (x_{2} \right )} - x_{0} x_{1}^{3} f{\left (x_{2} \right )} + x_{0} x_{1}^{3} f{\left (x_{3} \right )} + x_{0} x_{2}^{3} f{\left (x_{1} \right )} - x_{0} x_{2}^{3} f{\left (x_{3} \right )} - x_{0} x_{3}^{3} f{\left (x_{1} \right )} + x_{0} x_{3}^{3} f{\left (x_{2} \right )} + x_{1}^{3} x_{2} f{\left (x_{0} \right )} - x_{1}^{3} x_{2} f{\left (x_{3} \right )} - x_{1}^{3} x_{3} f{\left (x_{0} \right )} + x_{1}^{3} x_{3} f{\left (x_{2} \right )} - x_{1} x_{2}^{3} f{\left (x_{0} \right )} + x_{1} x_{2}^{3} f{\left (x_{3} \right )} + x_{1} x_{3}^{3} f{\left (x_{0} \right )} - x_{1} x_{3}^{3} f{\left (x_{2} \right )} + x_{2}^{3} x_{3} f{\left (x_{0} \right )} - x_{2}^{3} x_{3} f{\left (x_{1} \right )} - x_{2} x_{3}^{3} f{\left (x_{0} \right )} + x_{2} x_{3}^{3} f{\left (x_{1} \right )}\right)}{3 x_{0}^{3} x_{1}^{2} x_{2} - 3 x_{0}^{3} x_{1}^{2} x_{3} - 3 x_{0}^{3} x_{1} x_{2}^{2} + 3 x_{0}^{3} x_{1} x_{3}^{2} + 3 x_{0}^{3} x_{2}^{2} x_{3} - 3 x_{0}^{3} x_{2} x_{3}^{2} - 3 x_{0}^{2} x_{1}^{3} x_{2} + 3 x_{0}^{2} x_{1}^{3} x_{3} + 3 x_{0}^{2} x_{1} x_{2}^{3} - 3 x_{0}^{2} x_{1} x_{3}^{3} - 3 x_{0}^{2} x_{2}^{3} x_{3} + 3 x_{0}^{2} x_{2} x_{3}^{3} + 3 x_{0} x_{1}^{3} x_{2}^{2} - 3 x_{0} x_{1}^{3} x_{3}^{2} - 3 x_{0} x_{1}^{2} x_{2}^{3} + 3 x_{0} x_{1}^{2} x_{3}^{3} + 3 x_{0} x_{2}^{3} x_{3}^{2} - 3 x_{0} x_{2}^{2} x_{3}^{3} - 3 x_{1}^{3} x_{2}^{2} x_{3} + 3 x_{1}^{3} x_{2} x_{3}^{2} + 3 x_{1}^{2} x_{2}^{3} x_{3} - 3 x_{1}^{2} x_{2} x_{3}^{3} - 3 x_{1} x_{2}^{3} x_{3}^{2} + 3 x_{1} x_{2}^{2} x_{3}^{3}} - \frac{x_{0}^{2} \left(x_{0}^{3} x_{1}^{2} f{\left (x_{2} \right )} - x_{0}^{3} x_{1}^{2} f{\left (x_{3} \right )} - x_{0}^{3} x_{2}^{2} f{\left (x_{1} \right )} + x_{0}^{3} x_{2}^{2} f{\left (x_{3} \right )} + x_{0}^{3} x_{3}^{2} f{\left (x_{1} \right )} - x_{0}^{3} x_{3}^{2} f{\left (x_{2} \right )} - x_{0}^{2} x_{1}^{3} f{\left (x_{2} \right )} + x_{0}^{2} x_{1}^{3} f{\left (x_{3} \right )} + x_{0}^{2} x_{2}^{3} f{\left (x_{1} \right )} - x_{0}^{2} x_{2}^{3} f{\left (x_{3} \right )} - x_{0}^{2} x_{3}^{3} f{\left (x_{1} \right )} + x_{0}^{2} x_{3}^{3} f{\left (x_{2} \right )} + x_{1}^{3} x_{2}^{2} f{\left (x_{0} \right )} - x_{1}^{3} x_{2}^{2} f{\left (x_{3} \right )} - x_{1}^{3} x_{3}^{2} f{\left (x_{0} \right )} + x_{1}^{3} x_{3}^{2} f{\left (x_{2} \right )} - x_{1}^{2} x_{2}^{3} f{\left (x_{0} \right )} + x_{1}^{2} x_{2}^{3} f{\left (x_{3} \right )} + x_{1}^{2} x_{3}^{3} f{\left (x_{0} \right )} - x_{1}^{2} x_{3}^{3} f{\left (x_{2} \right )} + x_{2}^{3} x_{3}^{2} f{\left (x_{0} \right )} - x_{2}^{3} x_{3}^{2} f{\left (x_{1} \right )} - x_{2}^{2} x_{3}^{3} f{\left (x_{0} \right )} + x_{2}^{2} x_{3}^{3} f{\left (x_{1} \right )}\right)}{2 x_{0}^{3} x_{1}^{2} x_{2} - 2 x_{0}^{3} x_{1}^{2} x_{3} - 2 x_{0}^{3} x_{1} x_{2}^{2} + 2 x_{0}^{3} x_{1} x_{3}^{2} + 2 x_{0}^{3} x_{2}^{2} x_{3} - 2 x_{0}^{3} x_{2} x_{3}^{2} - 2 x_{0}^{2} x_{1}^{3} x_{2} + 2 x_{0}^{2} x_{1}^{3} x_{3} + 2 x_{0}^{2} x_{1} x_{2}^{3} - 2 x_{0}^{2} x_{1} x_{3}^{3} - 2 x_{0}^{2} x_{2}^{3} x_{3} + 2 x_{0}^{2} x_{2} x_{3}^{3} + 2 x_{0} x_{1}^{3} x_{2}^{2} - 2 x_{0} x_{1}^{3} x_{3}^{2} - 2 x_{0} x_{1}^{2} x_{2}^{3} + 2 x_{0} x_{1}^{2} x_{3}^{3} + 2 x_{0} x_{2}^{3} x_{3}^{2} - 2 x_{0} x_{2}^{2} x_{3}^{3} - 2 x_{1}^{3} x_{2}^{2} x_{3} + 2 x_{1}^{3} x_{2} x_{3}^{2} + 2 x_{1}^{2} x_{2}^{3} x_{3} - 2 x_{1}^{2} x_{2} x_{3}^{3} - 2 x_{1} x_{2}^{3} x_{3}^{2} + 2 x_{1} x_{2}^{2} x_{3}^{3}} + \frac{x_{0}}{x_{0}^{3} x_{1}^{2} x_{2} - x_{0}^{3} x_{1}^{2} x_{3} - x_{0}^{3} x_{1} x_{2}^{2} + x_{0}^{3} x_{1} x_{3}^{2} + x_{0}^{3} x_{2}^{2} x_{3} - x_{0}^{3} x_{2} x_{3}^{2} - x_{0}^{2} x_{1}^{3} x_{2} + x_{0}^{2} x_{1}^{3} x_{3} + x_{0}^{2} x_{1} x_{2}^{3} - x_{0}^{2} x_{1} x_{3}^{3} - x_{0}^{2} x_{2}^{3} x_{3} + x_{0}^{2} x_{2} x_{3}^{3} + x_{0} x_{1}^{3} x_{2}^{2} - x_{0} x_{1}^{3} x_{3}^{2} - x_{0} x_{1}^{2} x_{2}^{3} + x_{0} x_{1}^{2} x_{3}^{3} + x_{0} x_{2}^{3} x_{3}^{2} - x_{0} x_{2}^{2} x_{3}^{3} - x_{1}^{3} x_{2}^{2} x_{3} + x_{1}^{3} x_{2} x_{3}^{2} + x_{1}^{2} x_{2}^{3} x_{3} - x_{1}^{2} x_{2} x_{3}^{3} - x_{1} x_{2}^{3} x_{3}^{2} + x_{1} x_{2}^{2} x_{3}^{3}} \left(- x_{0}^{3} x_{1}^{2} x_{2} f{\left (x_{3} \right )} + x_{0}^{3} x_{1}^{2} x_{3} f{\left (x_{2} \right )} + x_{0}^{3} x_{1} x_{2}^{2} f{\left (x_{3} \right )} - x_{0}^{3} x_{1} x_{3}^{2} f{\left (x_{2} \right )} - x_{0}^{3} x_{2}^{2} x_{3} f{\left (x_{1} \right )} + x_{0}^{3} x_{2} x_{3}^{2} f{\left (x_{1} \right )} + x_{0}^{2} x_{1}^{3} x_{2} f{\left (x_{3} \right )} - x_{0}^{2} x_{1}^{3} x_{3} f{\left (x_{2} \right )} - x_{0}^{2} x_{1} x_{2}^{3} f{\left (x_{3} \right )} + x_{0}^{2} x_{1} x_{3}^{3} f{\left (x_{2} \right )} + x_{0}^{2} x_{2}^{3} x_{3} f{\left (x_{1} \right )} - x_{0}^{2} x_{2} x_{3}^{3} f{\left (x_{1} \right )} - x_{0} x_{1}^{3} x_{2}^{2} f{\left (x_{3} \right )} + x_{0} x_{1}^{3} x_{3}^{2} f{\left (x_{2} \right )} + x_{0} x_{1}^{2} x_{2}^{3} f{\left (x_{3} \right )} - x_{0} x_{1}^{2} x_{3}^{3} f{\left (x_{2} \right )} - x_{0} x_{2}^{3} x_{3}^{2} f{\left (x_{1} \right )} + x_{0} x_{2}^{2} x_{3}^{3} f{\left (x_{1} \right )} + x_{1}^{3} x_{2}^{2} x_{3} f{\left (x_{0} \right )} - x_{1}^{3} x_{2} x_{3}^{2} f{\left (x_{0} \right )} - x_{1}^{2} x_{2}^{3} x_{3} f{\left (x_{0} \right )} + x_{1}^{2} x_{2} x_{3}^{3} f{\left (x_{0} \right )} + x_{1} x_{2}^{3} x_{3}^{2} f{\left (x_{0} \right )} - x_{1} x_{2}^{2} x_{3}^{3} f{\left (x_{0} \right )}\right) + \frac{x_{3}^{4} \left(x_{0}^{2} x_{1} f{\left (x_{2} \right )} - x_{0}^{2} x_{1} f{\left (x_{3} \right )} - x_{0}^{2} x_{2} f{\left (x_{1} \right )} + x_{0}^{2} x_{2} f{\left (x_{3} \right )} + x_{0}^{2} x_{3} f{\left (x_{1} \right )} - x_{0}^{2} x_{3} f{\left (x_{2} \right )} - x_{0} x_{1}^{2} f{\left (x_{2} \right )} + x_{0} x_{1}^{2} f{\left (x_{3} \right )} + x_{0} x_{2}^{2} f{\left (x_{1} \right )} - x_{0} x_{2}^{2} f{\left (x_{3} \right )} - x_{0} x_{3}^{2} f{\left (x_{1} \right )} + x_{0} x_{3}^{2} f{\left (x_{2} \right )} + x_{1}^{2} x_{2} f{\left (x_{0} \right )} - x_{1}^{2} x_{2} f{\left (x_{3} \right )} - x_{1}^{2} x_{3} f{\left (x_{0} \right )} + x_{1}^{2} x_{3} f{\left (x_{2} \right )} - x_{1} x_{2}^{2} f{\left (x_{0} \right )} + x_{1} x_{2}^{2} f{\left (x_{3} \right )} + x_{1} x_{3}^{2} f{\left (x_{0} \right )} - x_{1} x_{3}^{2} f{\left (x_{2} \right )} + x_{2}^{2} x_{3} f{\left (x_{0} \right )} - x_{2}^{2} x_{3} f{\left (x_{1} \right )} - x_{2} x_{3}^{2} f{\left (x_{0} \right )} + x_{2} x_{3}^{2} f{\left (x_{1} \right )}\right)}{4 x_{0}^{3} x_{1}^{2} x_{2} - 4 x_{0}^{3} x_{1}^{2} x_{3} - 4 x_{0}^{3} x_{1} x_{2}^{2} + 4 x_{0}^{3} x_{1} x_{3}^{2} + 4 x_{0}^{3} x_{2}^{2} x_{3} - 4 x_{0}^{3} x_{2} x_{3}^{2} - 4 x_{0}^{2} x_{1}^{3} x_{2} + 4 x_{0}^{2} x_{1}^{3} x_{3} + 4 x_{0}^{2} x_{1} x_{2}^{3} - 4 x_{0}^{2} x_{1} x_{3}^{3} - 4 x_{0}^{2} x_{2}^{3} x_{3} + 4 x_{0}^{2} x_{2} x_{3}^{3} + 4 x_{0} x_{1}^{3} x_{2}^{2} - 4 x_{0} x_{1}^{3} x_{3}^{2} - 4 x_{0} x_{1}^{2} x_{2}^{3} + 4 x_{0} x_{1}^{2} x_{3}^{3} + 4 x_{0} x_{2}^{3} x_{3}^{2} - 4 x_{0} x_{2}^{2} x_{3}^{3} - 4 x_{1}^{3} x_{2}^{2} x_{3} + 4 x_{1}^{3} x_{2} x_{3}^{2} + 4 x_{1}^{2} x_{2}^{3} x_{3} - 4 x_{1}^{2} x_{2} x_{3}^{3} - 4 x_{1} x_{2}^{3} x_{3}^{2} + 4 x_{1} x_{2}^{2} x_{3}^{3}} - \frac{x_{3}^{3} \left(x_{0}^{3} x_{1} f{\left (x_{2} \right )} - x_{0}^{3} x_{1} f{\left (x_{3} \right )} - x_{0}^{3} x_{2} f{\left (x_{1} \right )} + x_{0}^{3} x_{2} f{\left (x_{3} \right )} + x_{0}^{3} x_{3} f{\left (x_{1} \right )} - x_{0}^{3} x_{3} f{\left (x_{2} \right )} - x_{0} x_{1}^{3} f{\left (x_{2} \right )} + x_{0} x_{1}^{3} f{\left (x_{3} \right )} + x_{0} x_{2}^{3} f{\left (x_{1} \right )} - x_{0} x_{2}^{3} f{\left (x_{3} \right )} - x_{0} x_{3}^{3} f{\left (x_{1} \right )} + x_{0} x_{3}^{3} f{\left (x_{2} \right )} + x_{1}^{3} x_{2} f{\left (x_{0} \right )} - x_{1}^{3} x_{2} f{\left (x_{3} \right )} - x_{1}^{3} x_{3} f{\left (x_{0} \right )} + x_{1}^{3} x_{3} f{\left (x_{2} \right )} - x_{1} x_{2}^{3} f{\left (x_{0} \right )} + x_{1} x_{2}^{3} f{\left (x_{3} \right )} + x_{1} x_{3}^{3} f{\left (x_{0} \right )} - x_{1} x_{3}^{3} f{\left (x_{2} \right )} + x_{2}^{3} x_{3} f{\left (x_{0} \right )} - x_{2}^{3} x_{3} f{\left (x_{1} \right )} - x_{2} x_{3}^{3} f{\left (x_{0} \right )} + x_{2} x_{3}^{3} f{\left (x_{1} \right )}\right)}{3 x_{0}^{3} x_{1}^{2} x_{2} - 3 x_{0}^{3} x_{1}^{2} x_{3} - 3 x_{0}^{3} x_{1} x_{2}^{2} + 3 x_{0}^{3} x_{1} x_{3}^{2} + 3 x_{0}^{3} x_{2}^{2} x_{3} - 3 x_{0}^{3} x_{2} x_{3}^{2} - 3 x_{0}^{2} x_{1}^{3} x_{2} + 3 x_{0}^{2} x_{1}^{3} x_{3} + 3 x_{0}^{2} x_{1} x_{2}^{3} - 3 x_{0}^{2} x_{1} x_{3}^{3} - 3 x_{0}^{2} x_{2}^{3} x_{3} + 3 x_{0}^{2} x_{2} x_{3}^{3} + 3 x_{0} x_{1}^{3} x_{2}^{2} - 3 x_{0} x_{1}^{3} x_{3}^{2} - 3 x_{0} x_{1}^{2} x_{2}^{3} + 3 x_{0} x_{1}^{2} x_{3}^{3} + 3 x_{0} x_{2}^{3} x_{3}^{2} - 3 x_{0} x_{2}^{2} x_{3}^{3} - 3 x_{1}^{3} x_{2}^{2} x_{3} + 3 x_{1}^{3} x_{2} x_{3}^{2} + 3 x_{1}^{2} x_{2}^{3} x_{3} - 3 x_{1}^{2} x_{2} x_{3}^{3} - 3 x_{1} x_{2}^{3} x_{3}^{2} + 3 x_{1} x_{2}^{2} x_{3}^{3}} + \frac{x_{3}^{2} \left(x_{0}^{3} x_{1}^{2} f{\left (x_{2} \right )} - x_{0}^{3} x_{1}^{2} f{\left (x_{3} \right )} - x_{0}^{3} x_{2}^{2} f{\left (x_{1} \right )} + x_{0}^{3} x_{2}^{2} f{\left (x_{3} \right )} + x_{0}^{3} x_{3}^{2} f{\left (x_{1} \right )} - x_{0}^{3} x_{3}^{2} f{\left (x_{2} \right )} - x_{0}^{2} x_{1}^{3} f{\left (x_{2} \right )} + x_{0}^{2} x_{1}^{3} f{\left (x_{3} \right )} + x_{0}^{2} x_{2}^{3} f{\left (x_{1} \right )} - x_{0}^{2} x_{2}^{3} f{\left (x_{3} \right )} - x_{0}^{2} x_{3}^{3} f{\left (x_{1} \right )} + x_{0}^{2} x_{3}^{3} f{\left (x_{2} \right )} + x_{1}^{3} x_{2}^{2} f{\left (x_{0} \right )} - x_{1}^{3} x_{2}^{2} f{\left (x_{3} \right )} - x_{1}^{3} x_{3}^{2} f{\left (x_{0} \right )} + x_{1}^{3} x_{3}^{2} f{\left (x_{2} \right )} - x_{1}^{2} x_{2}^{3} f{\left (x_{0} \right )} + x_{1}^{2} x_{2}^{3} f{\left (x_{3} \right )} + x_{1}^{2} x_{3}^{3} f{\left (x_{0} \right )} - x_{1}^{2} x_{3}^{3} f{\left (x_{2} \right )} + x_{2}^{3} x_{3}^{2} f{\left (x_{0} \right )} - x_{2}^{3} x_{3}^{2} f{\left (x_{1} \right )} - x_{2}^{2} x_{3}^{3} f{\left (x_{0} \right )} + x_{2}^{2} x_{3}^{3} f{\left (x_{1} \right )}\right)}{2 x_{0}^{3} x_{1}^{2} x_{2} - 2 x_{0}^{3} x_{1}^{2} x_{3} - 2 x_{0}^{3} x_{1} x_{2}^{2} + 2 x_{0}^{3} x_{1} x_{3}^{2} + 2 x_{0}^{3} x_{2}^{2} x_{3} - 2 x_{0}^{3} x_{2} x_{3}^{2} - 2 x_{0}^{2} x_{1}^{3} x_{2} + 2 x_{0}^{2} x_{1}^{3} x_{3} + 2 x_{0}^{2} x_{1} x_{2}^{3} - 2 x_{0}^{2} x_{1} x_{3}^{3} - 2 x_{0}^{2} x_{2}^{3} x_{3} + 2 x_{0}^{2} x_{2} x_{3}^{3} + 2 x_{0} x_{1}^{3} x_{2}^{2} - 2 x_{0} x_{1}^{3} x_{3}^{2} - 2 x_{0} x_{1}^{2} x_{2}^{3} + 2 x_{0} x_{1}^{2} x_{3}^{3} + 2 x_{0} x_{2}^{3} x_{3}^{2} - 2 x_{0} x_{2}^{2} x_{3}^{3} - 2 x_{1}^{3} x_{2}^{2} x_{3} + 2 x_{1}^{3} x_{2} x_{3}^{2} + 2 x_{1}^{2} x_{2}^{3} x_{3} - 2 x_{1}^{2} x_{2} x_{3}^{3} - 2 x_{1} x_{2}^{3} x_{3}^{2} + 2 x_{1} x_{2}^{2} x_{3}^{3}} - \frac{x_{3}}{x_{0}^{3} x_{1}^{2} x_{2} - x_{0}^{3} x_{1}^{2} x_{3} - x_{0}^{3} x_{1} x_{2}^{2} + x_{0}^{3} x_{1} x_{3}^{2} + x_{0}^{3} x_{2}^{2} x_{3} - x_{0}^{3} x_{2} x_{3}^{2} - x_{0}^{2} x_{1}^{3} x_{2} + x_{0}^{2} x_{1}^{3} x_{3} + x_{0}^{2} x_{1} x_{2}^{3} - x_{0}^{2} x_{1} x_{3}^{3} - x_{0}^{2} x_{2}^{3} x_{3} + x_{0}^{2} x_{2} x_{3}^{3} + x_{0} x_{1}^{3} x_{2}^{2} - x_{0} x_{1}^{3} x_{3}^{2} - x_{0} x_{1}^{2} x_{2}^{3} + x_{0} x_{1}^{2} x_{3}^{3} + x_{0} x_{2}^{3} x_{3}^{2} - x_{0} x_{2}^{2} x_{3}^{3} - x_{1}^{3} x_{2}^{2} x_{3} + x_{1}^{3} x_{2} x_{3}^{2} + x_{1}^{2} x_{2}^{3} x_{3} - x_{1}^{2} x_{2} x_{3}^{3} - x_{1} x_{2}^{3} x_{3}^{2} + x_{1} x_{2}^{2} x_{3}^{3}} \left(- x_{0}^{3} x_{1}^{2} x_{2} f{\left (x_{3} \right )} + x_{0}^{3} x_{1}^{2} x_{3} f{\left (x_{2} \right )} + x_{0}^{3} x_{1} x_{2}^{2} f{\left (x_{3} \right )} - x_{0}^{3} x_{1} x_{3}^{2} f{\left (x_{2} \right )} - x_{0}^{3} x_{2}^{2} x_{3} f{\left (x_{1} \right )} + x_{0}^{3} x_{2} x_{3}^{2} f{\left (x_{1} \right )} + x_{0}^{2} x_{1}^{3} x_{2} f{\left (x_{3} \right )} - x_{0}^{2} x_{1}^{3} x_{3} f{\left (x_{2} \right )} - x_{0}^{2} x_{1} x_{2}^{3} f{\left (x_{3} \right )} + x_{0}^{2} x_{1} x_{3}^{3} f{\left (x_{2} \right )} + x_{0}^{2} x_{2}^{3} x_{3} f{\left (x_{1} \right )} - x_{0}^{2} x_{2} x_{3}^{3} f{\left (x_{1} \right )} - x_{0} x_{1}^{3} x_{2}^{2} f{\left (x_{3} \right )} + x_{0} x_{1}^{3} x_{3}^{2} f{\left (x_{2} \right )} + x_{0} x_{1}^{2} x_{2}^{3} f{\left (x_{3} \right )} - x_{0} x_{1}^{2} x_{3}^{3} f{\left (x_{2} \right )} - x_{0} x_{2}^{3} x_{3}^{2} f{\left (x_{1} \right )} + x_{0} x_{2}^{2} x_{3}^{3} f{\left (x_{1} \right )} + x_{1}^{3} x_{2}^{2} x_{3} f{\left (x_{0} \right )} - x_{1}^{3} x_{2} x_{3}^{2} f{\left (x_{0} \right )} - x_{1}^{2} x_{2}^{3} x_{3} f{\left (x_{0} \right )} + x_{1}^{2} x_{2} x_{3}^{3} f{\left (x_{0} \right )} + x_{1} x_{2}^{3} x_{3}^{2} f{\left (x_{0} \right )} - x_{1} x_{2}^{2} x_{3}^{3} f{\left (x_{0} \right )}\right)$$

Suponemos ahora puntos equidistantes de la forma $x_i \rightarrow x_0 + ih$ y simplificamos, factorizando $h$ con la fracción requerida para que el interior solo tenga números enteros.

$$\int_{{x_0}}^{{x_{}}}f(x)dx\approx\frac{3 h}{8} \left(f{\left (x_{0} \right )} + 3 f{\left (h + x_{0} \right )} + 3 f{\left (2 h + x_{0} \right )} + f{\left (3 h + x_{0} \right )}\right)$$