Commit a0a18a0a authored by somyos's avatar somyos

Initial commit

parent c3c9bc14
import math
def f(x) : return 9*math.sin(x) + 6*math.cos(x)
def trapezoidf (a=0,b=3,n=100):
h = (b-a)/n
return sum = ([ (1/2)*h*(f(a+i*h))*f*(a+(i+1)*h)) for i in range (n) ])
print (trapezoidf(0,3,100))
\ No newline at end of file
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