
// Question 1
function R = laguerre(n,T)
    R=[]
    for i=1:length(T)
        l0=1
        l1=-T(i)+1
        for k=2:n
            temp=l1
            l1=(-(T(i)-2*k+1)*l1-(k-1)*l0)/k
            l0=temp
        end
        if n <> 0
            R=[R,l1]
        else
            R=[R,l0]
        end
    end
endfunction

// Question 3
function L = derive(F,a,h)
    L=[(F(2)-F(1))/h,(F(3)-F(2))/h]
    for k=3:length(F)-2
        L=[L,(F(k-2)-8*F(k-1)+8*F(k+1)-F(k+2))/(12*h)]
    end
    L=[L,(F(length(F)-1)-F(length(F)-2))/h,(F(length(F))-F(length(F)-1))/h]
endfunction
