<jupyter_start><jupyter_text>---author: <NAME> (<EMAIL>)---This answer assumes you have imported SymPy as follows.<jupyter_code>from sympy import *                   # load all math functions
init_printing( use_latex='mathjax' )  # use pretty math output<jupyter_output><empty_output><jupyter_text>Let's compute the area under $\sin x$ from $x=0$ to $x=\pi$.We use the same technique as in how to write and evaluate indefinite integrals,except that we add the lower and upper bounds together with $x$, as shown below.<jupyter_code>var( 'x' )
formula = sin(x)
Integral( formula, (x,0,pi) )<jupyter_output><empty_output><jupyter_text>The above code just displays the definite integral.To evaluate it, use the `integrate` command.<jupyter_code>integrate( formula, (x,0,pi) )<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1136079900124844, 'fraction_numerical': 0.003745318352059925, 'mean_word_length': 5.628099173553719, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '644106', 'license': 'MIT', 'n_tokens_mistral': 266, 'n_tokens_neox': 256, 'n_words': 83, 'path': 'database/tasks/How to write and evaluate definite integrals/Python, using SymPy.ipynb', 'repo_name': 'nathancarter/how2data', 'size': '820'}