clear;
t1 = linspace(0, 10, 4);
f1 = 5 * t1 + 2
s1   ='or';
plot(t1, f1, s1)

%calcuylate rectangle areas for t1, f1

totalArea1 = 0;
for i = 1: length(t1)-1
    w(i) = t1(i+1) - t1(i);
    h(i) = f1(i);
    a(i) = w(i) * h(i);
    totalArea1 = totalArea1 + a(i);
end


% cLCULATE RECTANGLE AREAS FOR T2, F2

t2 = linspace(0, 10, 4);
f2 = 5 * t2 + 2
s2   ='or';
plot(t2, f2, s2)

totalArea2 = 0;
for i = 1: length(t2)-1
    w(i) = t2(i+1) - t2(i);
    h(i) = f2(i);
    a(i) = w(i) * h(i);
    totalArea2 = totalArea2 + a(i);
end


