%  numint5.m
% Matlab file for Part 5 of Numeric Calculation of 
% Integrals module

disp('**********************************************')
disp('Part 5: Increasing the Number of Subintervals')
disp('**********************************************')
disp('  ')    

    format long
    
    disp('------------------------------------------------')
    disp('Step 1: ')
    disp('Use your LHS approximation results for the ')
    disp('integral of f(x)=1/x on [1,3] from Part 1 ')
    disp('to fill in the table below for the left-hand ')
    disp('sum approximation errors. ')
    disp(' ')
    disp('  n for LHS      Error      Improvement Index ')
    disp('     5       0.1449885549        ----')
    disp('    10       0.0696167046        2.08 ')
    disp('    20       0.0340732550        ____ ')
    disp('    40       ____________        ____ ')
    disp(' ')
    disp(' ')
    disp('To continue, type the word return and ')
    disp('hit enter!')
    disp(' ')

    keyboard;
    disp(' ')

    disp('------------------------------------------------')
    disp('Step 1 (cont.) ')
    disp('Answer the questions in step 1 using MATLAB ')
    disp('comments in your diary file. ')
    disp(' ')
    disp('To continue, type the word return and ')
    disp('hit enter!')
    disp(' ')

    keyboard;
    disp(' ')

    disp('------------------------------------------------')
    disp('Step 2: ')
    disp('Use your TRAP approximation results for the ')
    disp('integral of f(x)=1/x on [1,3] from Part 2 ')
    disp('to fill in the table below for the trapezoidal ')
    disp('sum approximation errors. ')
    disp(' ')
    disp('  n for TRAP      Error      Improvement Index ')
    disp('     5       0.0116552216        ---- ')
    disp('    10       ____________        ____ ')
    disp('    20       ____________        ____ ')
    disp('    40       ____________        ____ ')
    disp(' ')
    disp(' ')
    disp('To continue, type the word return and ')
    disp('hit enter!')
    disp(' ')

    keyboard;
    disp(' ')

    disp('------------------------------------------------')
    disp('Step 2 (cont.) ')
    disp('Answer the questions in step 2 using MATLAB ')
    disp('comments in your diary file. ')
    disp(' ')
    disp('To continue, type the word return and ')
    disp('hit enter!')
    disp(' ')

    keyboard;
    disp(' ')

    disp('------------------------------------------------')
    disp('Step 3: ')
    disp('Use your MID approximation results for the ')
    disp('integral of f(x)=1/x on [1,3] from Part 3 ')
    disp('to fill in the table below for the midpoint ')
    disp('sum approximation errors. ')
    disp(' ')
    disp('  n for MID      Error      Improvement Index ')
    disp('     5       -0.0057551458       ---- ')
    disp('    10       ____________        ____ ')
    disp('    20       ____________        ____ ')
    disp('    40       ____________        ____ ')
    disp(' ')
    disp(' ')
    disp('To continue, type the word return and ')
    disp('hit enter!')
    disp(' ')

    keyboard;
    disp(' ')

    disp('------------------------------------------------')
    disp('Step 3 (cont.) ')
    disp('Answer the questions in step 3 using MATLAB ')
    disp('comments in your diary file. ')
    disp(' ')
    disp('To continue, type the word return and ')
    disp('hit enter!')
    disp(' ')

    keyboard;
    disp(' ')

    disp('------------------------------------------------')
    disp('Step 4: ')
    disp('Use your Simpson''s Rule approximation results')
    disp('for the integral of f(x)=1/x on [1,3] from the')
    disp('table in Part 4 to fill in the table below ')
    disp('for the Simpson''s Rule approximation errors. ')
    disp(' ')
    disp('  n for SIMP      Error      Improvement Index ')
    disp('     5       0.0000483100        ---- ')
    disp('    10       ____________        ____ ')
    disp('    20       ____________        ____ ')
    disp('    40       ____________        ____ ')
    disp(' ')
    disp(' ')
    disp('To continue, type the word return and ')
    disp('hit enter!')
    disp(' ')

    keyboard;
    disp(' ')

    disp('------------------------------------------------')
    disp('Step 4 (cont.) ')
    disp('Answer the questions in step 4 using MATLAB ')
    disp('comments in your diary file. ')
    disp(' ')
    disp(' ')
    disp('-------------------------------------------- ')
    disp('When you are ready to go on to part 6 ')
    disp('of this module, type: numint6.')
    disp(' ')
