
// Question 1
function s = calculint(f,a,b,n)
    s=0
    X=linspace(a,b,n)
    for i=1:n-1
        s=s+(X(i+1)-X(i))*f((X(i)+X(i+1))/2)
    end
endfunction

// Question 2
function y=f(x)
    y=sin(x).*exp(cos(x))
endfunction

// Question 4
function L = primitive(f,a,T)
    L=[]
    for i=1:length(T)
        L=[L,calculint(f,a,T(i),100)]
    end
endfunction

function y=g(x)
    y=1/x
endfunction

