Calculus II

Lecture 21

Dr. Greg Chism

University of Arizona
INFO 511 - Fall 2024

Summary of Derivative Rules

Differentiation rules

  • Constant rule: \(\frac{d}{dx} (c) = 0\)

  • Power rule: \(\frac{d}{dx} (x^n) = nx^{n-1}\)

  • Constant multiple rule: \(\frac{d}{dx} [c \cdot f(x)] = c \cdot f'(x)\)

  • Sum rule: \(\frac{d}{dx} [f(x) + g(x)] = f'(x) + g'(x)\)

  • Difference rule: \(\frac{d}{dx} [f(x) - g(x)] = f'(x) - g'(x)\)

Integrals

Integration

From last time:

  • Measures the accumulation of quantities and the area under a curve.

  • Example: Used to compute the area under probability distribution functions, which is essential in statistics and data analysis.

  • Symbol: \(\int f(x) dx\)

  • Practical Application: Calculating Cumulative Distribution Functions (CDFs)

Accumulating quantities

Area under the curve

  • The integral of a function represents the area under the curve of that function on a graph, between two points.

  • Example: Finding the total distance traveled given a speed-time graph.

The integral

Integrals in Python

Calculating integrals using SymPy

from sympy import symbols, integrate

x = symbols('x')
f = x**2 + 1
area = integrate(f, (x, 0, 1))
print(area)  # Output: 4/3
4/3

Solving integrals

Integration rules

  • Constant rule: \(\int c , dx = cx + C\)

  • Power rule: \(\int x^n , dx = \frac{x^{n+1}}{n+1} + C\)

  • Constant multiple rule: \(\int c \cdot f(x) , dx = c \cdot \int f(x) , dx\)

  • Sum rule: \(\int [f(x) + g(x)] , dx = \int f(x) , dx + \int g(x) , dx\)

  • Difference rule: \(\int [f(x) - g(x)] , dx = \int f(x) , dx - \int g(x) , dx\)

Example 1: Integrating a Constant

  • Function: \(f(x) = 7\)

  • Integral: \(\int 7 , dx = 7x + C\)

Example 2: Power rule

  • Function: \(f(x) = x^3\)

  • Integral: \(\int x^3 , dx = \frac{x^{4}}{4} + C\)

Example 3: Constant multiple rule

  • Function: \(f(x) = 5x^2\)

  • Integral: \(\int 5x^2 , dx = 5 \cdot \frac{x^{3}}{3} + C = \frac{5x^{3}}{3} + C\)

Example 4: Sum and difference rule

  • Function: \(f(x) = x^3 + 4x - 5\)

  • Integral: \(\int (x^3 + 4x - 5) , dx = \frac{x^{4}}{4} + 2x^2 - 5x + C\)

Solving complex integrals

Complex Integrals:

  • Involves functions composed of multiple simpler functions.

  • Requires application of rules like integration by parts and substitution for integration.

Example Function:

\[ \int_{a}^{b} \left( e^{cx} + \frac{1}{x^n} \right) \, dx \]

  • Objective: Find the integral

Integration by parts

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

  • Used when integrating the product of two functions.

Integration by parts

Function: \(\int x e^x , dx\)

  1. Identify the functions
  • \(u = x \quad \Rightarrow \quad du = dx\)

  • \(dv = e^x , dx \quad \Rightarrow \quad v = e^x\)

  1. Apply Integration by Parts

\(\int xe^x \space dx=xe^x-\int e^x \space dx=xe^x-e^x + C\)

Integration by parts: Example

Function: \(\int xe^x \space dx\)

  1. Identify the functions
  • \(\text{Let } u=x\) and \(dv=e^x \space dx\)
  1. Differentiate and integrate
  • Differentiate: \(u\colon du=dx\)

  • Integrate: \(dv\colon v = e^x\)

Integration by parts: Example

Function: \(\int xe^x \space dx\)

  1. Apply the integration by parts formula

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

  1. Substitute the values

\[ \int x e^x \, dx = x e^x - \int e^x \, dx \]

Integration by parts: Example

Function: \(\int xe^x \space dx\)

  1. Simplify the integral

\[ \int x e^x \, dx = x e^x - e^x + C \]

  1. Final answer

\[ \int x e^x \, dx = e^x (x - 1) + C \]

Integration by substitution

Function: \(\int f(g(x))g^{'}(x)dx=\int f(u)\space du\)

  • Used when integrating a composite function.

Integration by substitution: Example 1

Function: \(\int 2x \sqrt{x^2 + 1} , dx\)

  1. Identify the substitution
  • Let \(u = x^2 + 1 \quad \Rightarrow \quad du = 2x , dx\)
  1. Apply the substitution

\[ \int 2x \sqrt{x^2 + 1} \space dx=\int \sqrt{u} \space du = \frac{2}{3}(x^2 + 1)^{3/2} + C \]

Integration by substitution: Example 2

Function: \[\int x \ln(x) , dx\]

  1. Identify the functions
  • \(u = \ln(x) \quad \Rightarrow \quad du = \frac{1}{x} , dx\)

  • \(dv = x , dx \quad \Rightarrow \quad v = \frac{x^2}{2}\)

Integration by substitution: Example 2

Function: \[\int x \ln(x) , dx\]

  1. Apply integration by parts

\[ \int x \ln(x) , dx = \frac{x^2}{2}\ln(x) - \int \frac{x^2}{2} \cdot \frac{1}{x} \space dx = \frac{x^2}{2} \ln(x) - \frac{1}{2} \int x \space dx \]

\[ = \frac{x^2}{2} \ln(x) - \frac{x^2}{4} + C \]

Regularization

You’ll learn more about this in INFO 521: Introduction to Machine Learning and/or INFO 523: Data Mining and Discovery

ae-14-integration

Practice integration (you will be tested on this in Exam 2)