# A Simple Method for Numerical Integration in Python

In this article, we will introduce a simple method for computing integrals in python. We will first derive the integration formula and then implement it on a few functions in python

In this article, we will introduce a simple method for computing integrals in python. We will first derive the integration formula and then implement it on a few functions in python. This article assumes you have a basic understanding of probability and integral calculus, but if you don’t you can always skip ahead to the examples. Enjoy!

## Derivation

We must first state the definition of the expected value of a continuous random variable.

Suppose X is a random variable with with probability density function f(x). The expected value of X is defined as follows:

Expectation of X

Next, we use the expectation formula to derive a simple equation for computing an integral. We would like to estimate the following integral:

## Data Science With Python Training | Python Data Science Course | Intellipaat

🔵 Intellipaat Data Science with Python course: https://intellipaat.com/python-for-data-science-training/In this Data Science With Python Training video, you...

## How To Build A Data Science Career In 2021

In Conversation With Dr Suman Sanyal, NIIT University,he shares his insights on how universities can contribute to this highly promising sector and what aspirants can do to build a successful data science career.

## Data Science with Python Certification Training in Chennai

Enroll in our Data Science with Python training in Chennai. Best Data Science with Python Training courses in Chennai for 100% Job Placements Support.

## Python for Data Science | Data Science With Python | Python Data Science Tutorial

🔥Intellipaat Python for Data Science Course: https://intellipaat.com/python-for-data-science-training/In this python for data science video you will learn e...

## Applied Data Science with Python Certification Training Course -IgmGuru

Master Applied Data Science with Python and get noticed by the top Hiring Companies with IgmGuru's Data Science with Python Certification Program. Enroll Now