<jupyter_start><jupyter_text><jupyter_code>from math import sin
def f(x): return sin(3*x)

x1 = 0
x2 = 0.6
n = 7
h = (x2 - x1)/n
S = h*(f(x1)+f(x2))
for i in range(1,n):
  S = S+f(x1+i*h)
integral = h*S
print('Integral = %f' %integral)<jupyter_output>Integral = 0.372229
{'fraction_non_alphanumeric': 0.1962962962962963, 'fraction_numerical': 0.07407407407407407, 'mean_word_length': 4.645833333333333, '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': '286858', 'license': 'Apache-2.0', 'n_tokens_mistral': 151, 'n_tokens_neox': 140, 'n_words': 31, 'path': 'Numerical_Integration.ipynb', 'repo_name': 'M-Angeles/Numerical-Methods-58012', 'size': '270'}