from math import exp def f(x): return(x/(exp(x)-x)) def aireinf(N): A=0 x=0 h=1/N for i in range (1,N+1): A=A+h*f(x) x=x+h return(A) def EncadrAire(N): A=0 B=0 x=0 h=1/N for i in range (1,N+1): A=A+h*f(x) x=x+h B=B+h*f(x) return(A,B)
Create, edit, and import your Python scripts
from math import exp def f(x): return(x/(exp(x)-x)) def aireinf(N): A=0 x=0 h=1/N for i in range (1,N+1): A=A+h*f(x) x=x+h return(A) def EncadrAire(N): A=0 B=0 x=0 h=1/N for i in range (1,N+1): A=A+h*f(x) x=x+h B=B+h*f(x) return(A,B)