<jupyter_start><jupyter_text>Problem 3<jupyter_code>from math import exp
def f(x): return exp(x) #define the trigonometric function

a = -1
b = 1
n = 10
h = (b-a)/n #Width of the trapezoid
S = h * (f(a)+f(b)) #starting value of summation

for i in range (1,n):
    S += f(a+i*h)
Integral = S*h
print ('Integral = %0.4f' %Integral)<jupyter_output>Integral = 2.1731
{'fraction_non_alphanumeric': 0.15426997245179064, 'fraction_numerical': 0.03581267217630854, 'mean_word_length': 4.432835820895522, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '68428', 'license': 'Apache-2.0', 'n_tokens_mistral': 171, 'n_tokens_neox': 156, 'n_words': 46, 'path': 'Final_Exam_in_Numerical_Methods.ipynb', 'repo_name': 'roneljr/Numerical-Methods-58011', 'size': '363'}