Integrals#

Integrals are a fundamental concept in calculus that measure the accumulation of quantities and the area under curves. They provide essential tools for analyzing continuous functions and are widely used in various applications in mathematics, physics, engineering, and machine learning.

Definition#

The integral of a function \(f(x)\) with respect to \(x\) over an interval \([a, b]\) is defined as the limit of the sum of the areas of rectangles under the curve of \(f(x)\) as the width of the rectangles approaches zero. Mathematically, the definite integral is expressed as:

\[ \int_{a}^{b} f(x) \, dx \]

This represents the area under the curve \(f(x)\) from \(x = a\) to \(x = b\).

Notation#

Integrals can be denoted in several ways:

  • \(\int f(x) \, dx\) for the indefinite integral (antiderivative)

  • \(\int_{a}^{b} f(x) \, dx\) for the definite integral

Basic Rules of Integration#

Integration is the process of finding the integral of a function. Several basic rules can simplify this process:

Power Rule#

The integral of \(x^n\) is \(\frac{x^{n+1}}{n+1} + C\) for \(n \neq -1\).

\[ \int x^n \, dx = \frac{x^{n+1}}{n+1} + C \]

Sum Rule#

The integral of the sum of two functions is the sum of their integrals.

\[ \int [f(x) + g(x)] \, dx = \int f(x) \, dx + \int g(x) \, dx \]

Constant Multiple Rule#

The integral of a constant multiplied by a function is the constant multiplied by the integral of the function.

\[ \int k f(x) \, dx = k \int f(x) \, dx \]

Substitution Rule#

The substitution rule (or change of variables) is used to simplify integrals by substituting a new variable \(u = g(x)\).

\[ \int f(g(x)) g'(x) \, dx = \int f(u) \, du \]

Integration by Parts#

Integration by parts is used to integrate the product of two functions and is given by:

\[ \int u \, dv = uv - \int v \, du \]

Applications of Integrals#

Integrals have numerous applications in various fields. In machine learning, integrals are used in:

  • Probability and Statistics: Integrals are used to compute probabilities, expectations, and variances of continuous random variables.

  • Optimization: Integrals can be used to find areas under curves, which are often related to cost functions in machine learning models.

  • Signal Processing: Integrals are used to analyze continuous signals and compute transformations like the Fourier transform.

Examples of Integration#

Example 1: Integrating a Polynomial#

Consider the polynomial function:

\[ f(x) = 3x^2 + 5x - 2 \]

The indefinite integral is found using the power rule:

\[ \int (3x^2 + 5x - 2) \, dx = x^3 + \frac{5x^2}{2} - 2x + C \]

Example 2: Definite Integral of a Polynomial#

Consider the polynomial function:

\[ f(x) = 3x^2 + 5x - 2 \]

The definite integral from \(x = 1\) to \(x = 3\) is:

\[ \int_{1}^{3} (3x^2 + 5x - 2) \, dx \]

First, find the indefinite integral:

\[ F(x) = x^3 + \frac{5x^2}{2} - 2x \]

Then, evaluate \(F(x)\) at the bounds:

\[ F(3) - F(1) = \left(3^3 + \frac{5 \cdot 3^2}{2} - 2 \cdot 3\right) - \left(1^3 + \frac{5 \cdot 1^2}{2} - 2 \cdot 1\right) \]
\[ = \left(27 + \frac{45}{2} - 6\right) - \left(1 + \frac{5}{2} - 2\right) \]
\[ = \left(27 + 22.5 - 6\right) - \left(1 + 2.5 - 2\right) \]
\[ = 43.5 - 1.5 = 42 \]

Summary#

Integrals measure the accumulation of quantities and the area under curves, serving as a cornerstone of calculus. Understanding the rules of integration and how to apply them is crucial for analyzing continuous functions and solving various problems in mathematics, physics, engineering, and machine learning.

In the next sections, we will delve deeper into the concepts of gradient and Hessian, which are essential for optimization in machine learning.