Commit e966b94b authored by sumet's avatar sumet

Qiuz2

parent e5862e8f
def f(x):
return 3*x**2+9*x+2
return 3*x**2 + 9*x+2
def trapezoidf4(a=0,b=3,n=100):
h=(b-a)/n
return sum ([(f(a+i*h)+f(a+(i+1)*h))*(h/2) for i in range(n)])
trapezoidf4(a=0,b=3,n=4)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment