Responsive Navbar with Google Search
Introduction to Scipy: Integration

Integration: Program 1

Single Definite Integral

Integrating a simple function \( f(x) = x^2 \) over the interval [0, 1]:

\[ \int_0^1 x^2 \, dx \]

Output 1

Integration: Program 2

Indefinite Integral Example

Let the function be defined as:

\[ f(x) = e^{-x^2} \]

The indefinite integration of this function over the range \( [0, \infty] \) is:

\[ \int_0^{\infty} e^{-x^2} \, dx \]

This integral has a known solution, which is \( \frac{\sqrt{\pi}}{2} \).

Output 2

Integration: Program 3

Double Integral

Integrating a function \( f(x, y) = x \cdot y \) over the region \([0, 1]\) for both \( x \) and \( y \), we have:

\[ \int_0^1 \int_0^1 x \cdot y \, dx \, dy \]

In this case, the result of the double integral is:

\[ \left( \int_0^1 x \, dx \right) \cdot \left( \int_0^1 y \, dy \right) = \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{4} \]

Output 3

Output 4

Integration: Program 5

Double Integral with Custom Range

Let the function be defined as:

\[ f(x, y) = \sin(x) \cdot \cos(y) \]

We can perform double integration of this function over the range:

\[ \int_0^{\pi} \int_0^{\frac{\pi}{2}} \sin(x) \cdot \cos(y) \, dy \, dx \]

Output 5

Integration: Program 6

Double Integral Example

Let the function be defined as:

\[ f(x, y) = x^2 y + xy^2 \]

We can perform double integration of this function over the following ranges:

  • For \( x \) from 0 to 1
  • For \( y \) from 0 to 2 (with the bounds depending on \( x \))

The double integral can be expressed as:

\[ \int_0^1 \int_0^2 (x^2 y + xy^2) \, dy \, dx \]

Output 6