0% found this document useful (0 votes)
37 views

Integration: Module 4-Part 1 CS 132 - Mathematics For Computer Science

This document provides an introduction to integration. Integration is the reverse process of differentiation, where the goal is to find the original function given its derivative. The document defines indefinite and definite integration. It provides examples of simple indefinite integrals and uses the trapezoidal rule to approximate definite integrals numerically using Python. Key concepts covered include the integral sign, finding antiderivatives using formulas, and evaluating definite integrals between limits.

Uploaded by

Dhuanne Estrada
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Integration: Module 4-Part 1 CS 132 - Mathematics For Computer Science

This document provides an introduction to integration. Integration is the reverse process of differentiation, where the goal is to find the original function given its derivative. The document defines indefinite and definite integration. It provides examples of simple indefinite integrals and uses the trapezoidal rule to approximate definite integrals numerically using Python. Key concepts covered include the integral sign, finding antiderivatives using formulas, and evaluating definite integrals between limits.

Uploaded by

Dhuanne Estrada
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Integration

Module 4- Part 1
CS 132 - Mathematics for Computer Science

1
Objectives

1. Explain the meaning of Integration

2. Illustrate how Definite Integration may be done using


Python Programming
Integration
[Getting f(x) out of its given derivative]

• Integration is the reversed of differentiation.


• Given a derivative of f(x), determine what f(x) is.
• f(x) is then called the integral and the derivative
of f(x) is called the integrand.
Integration

•Consider F(x) = f(x)dx.


•Here F(x) is a function whose derivative with respect
to x is f(x).

• The symbol  is called the integral sign and f(x)dx


denotes that integration should be performed on
f(x)dx.
Integration
(Simple cases to think about)

•Suppose (the derivative of f(x)) is 2, what is f(x)?

•Suppose (the derivative of x is 2x), what is f(x)?


•Suppose (the derivative of f(x)) is ex, what is f(x)?
Integration
(Simple cases to think about)
•Suppose (the derivative of f(x)) = 2, what is f(x)?
•Intuitively, 2 is what we get if we differentiate 2x with respect to x.
•d/dx(2x) = 2dx/dx = 2(1) = 2
•So, if the derivative of f(x) is 2, f(x) can be 2x.
•However, we take note that the derivative of any constant is 0.
•So,
•d/dx(2x+1)= 2,
•d/dx(2x+2)= 2,
•d/dx(2x+3) = 2
•…and so on.
•There are several possibilities. Any expression of the form (2x + any
constant) has 2 as its derivative.
•Then we can say, if the derivative of f(x) is 2,
then, f(x)=2x + an arbitrary constant
• This case illustrates that (the integral of 2) is (2x + c) where c is an
arbitrary constant
Integration
(Simple cases to think about)
•Suppose the (derivative of f(x)) = 2, what is f(x)?
•This case illustrates getting the integral of 2
•We write:
dx =?
and we say dx = 2x + c

The case where an arbitrary constant is included in the


result of the integration is called INDEFINITE Integration.
Integration
(Simple cases to think about)

•Suppose (the derivative of x) is 2x, what is f(x)?


x)dx = ?

Intuitively, we get 2x if we differentiate x2.


But we also get 2x if we differentiate x2+1,
We also get 2x if we differentiate x2+2,

x)dx = x2 + c, where c is an arbitrary constant
Integration
(Simple cases to think about)

•Suppose (the derivative of f(x)) is ex, what is f(x)?


•Recall:
•The derivative with respect to x of eu is eu(du/dx).
•Hence, Intuitively,
exdx = ex + c
Integration

• Integral calculus is a lengthy course that focuses on


Integration and its applications

•For our course (CS 132), we will just get a taste of


Integral Calculus so that we can appreciate a
fundamental application of Differentiation and
Integration
Integration

•It suffices to say, Integration is done by applying an


appropriate formula.

•The formulas for integration are suggestive of the


process of UNDOING the differentiation.
Some Formulas for Integration

1. un du = (un+1/(n+1)) + C where C is an arbitrary constant and n is not equal to -1

2.  (1/u) du = du/u = ln u + C where C is an arbitrary constant and u>0

3.  eudu = eu+C where e is that mathematical constant e and C is an arbitrary constant.

4.  cos u du = sin u + C

5.  sin u du = -cos u + C

6.  sec2u du = tan u + C

7.  csc2udu = -cot u + C

* f(x)du = cf(x)du where c is a constant


(2x)dx= ?
(2x)dx = 2(x)dx = 2 ( x2 + c) = 2x2 + 2c Since c is an
arbitrary constant, 2c is also an arbitrary constant. 2c
can be represent by a single letter, say d.

Therefore,
(2x)dx = 2x2 + 2c = 2x2 + d, d is an arbitrary constant.
An example

(1/x)dx = dx/x = ln(x) + c, where ln(x)=loge(x)


Definite Integration

• Definite Integration is done by evaluating the integral of


f(x) for a range of values for x.

• Notation:denotes integral from x=a to x=b of f(x)


Definite Integration

=(f(x)dx at x=b) - (f(x)dx at x=a)

• Apply appropriate integration formula for f(x).


Definite Integration
=(f(x)dx at x=b) - (f(x)dx at x=a)

• What is the integral from 1 to 2 of xdx?

xdx = ( xdx x=2) - (xdx at x=1)

= [(X2/2 + C) at x=2 ] - [(X2/2 + C) at x=1]

=[ (2)2/2 + C] - [ (1)2/2 +C]

= 2 + C -1/2 -C

= 3/2
Definite Integration
=(f(x)dx at x=b) - (f(x)dx at x=a)

• What is the integral from 1 to 2 of xdx?

xdx = ( xdx x=2) - (xdx at x=1)

= [(X2/2 + C) at x=2 ] - [(X2/2 + C) at x=1]

=[ (2)2/2 + C] - [ (1)2/2 +C]

= 2 + C -1/2 -C

= 3/2

*** In practice, the arbitrary constants are simply disregarded when doing definite integration because they can cancel out each other anyway.
Definite Integration
=(f(x)dx at x=b) - (f(x)dx at x=a)

• What is the integral from 1 to 2 of 2xdx?

2xdx = ( xdx x=2) - (xdx at x=1)

= [(2X2/2 + C) at x=2 ] - [(2X2/2 + C) at x=1]

= [(X2 + C) at x=2 ] - [X2 + C) at x=1]

=[ (2)2 + C] - [ (1)2 +C]

= 4 + C -1 -C

=3

*** In practice, the arbitrary constants are simply disregarded when doing definite integration because they can cancel out each other anyway.
Definite Integration

• is the area under the curve y=f(x) bounded by vertical


line x=a and the vertical line x =b
Indefinite Integration Using Python

Analytically, (x3-2x)dx = x4/4 -(2x2)/2 + c

=x4/4 -x2 + c

Program in Python

import simpy as sp

def f(x):

return x**3 - 2x

x=sp.symbol(‘x’)

print(“indefinite integral =“ , sp.integrate(f(x)))


Indefinite Integration Using Python
Indefinite Integration Using Python
(Because the program’s output does not include the addition of an arbitrary
constant, it is up for the user to include the arbitrary constant)
Definite Integration
(Trapezoidal Rule)

Subdivide the area under the curve y=f(x) from x=a to x=b into several small
trapezoids.

The integral of f(x) from a to b is the sum of the areas of small trapezoids:
Definite Integration Using Python
(Trapezoidal Rule)

Determining the integral of f(x) from x=0 to x=1 of (x2+4)dx .


Definite Integration Using Python
(Trapezoidal Rule)

The area under the curve is divided into 100 small trapezoids.
Next Thing to do

• Do additional readings and be guided by the brief course


notes

• Find and watch the short video on an elementary


application of differentiation and integration

You might also like