Frontmatter

If you are publishing this notebook on the web, you can set the parameters below to provide HTML metadata. This is useful for search engines and social media.

@htl("""
<style>
@import url("https://mmogib.github.io/math102/custom.css");

</style>
""")
56.1 μs
TableOfContents(title="MATH102")
12.4 μs
cm"""
<div style="color:red;font-size:16pt;">

[Syllabus](https://www.dropbox.com/scl/fi/blnlbqsaxakwoexafg4uq/Math102SyllabusT231.pdf?rlkey=fzy43rthbvpb9lnq0seiu4qb4&raw=1)

</div>
"""
410 μs
begin
cm"""
<div class="img-container">

$(Resource("https://www.dropbox.com/s/cat9ots4ausfzyc/qrcode_itempool.com_kfupm.png?raw=1",:width=>300))

</div>
"""
@htl("")
end
456 ms

5.2: Area

Objectives

  1. Use sigma notation to write and evaluate a sum.

  2. Understand the concept of area.

  3. Approximate the area of a plane region.

  4. Find the area of a plane region using limits.

Sigma Notation

md"""
# 5.2: Area
__Objectives__
> 1. Use sigma notation to write and evaluate a sum.
> 2. Understand the concept of area.
> 3. Approximate the area of a plane region.
> 4. Find the area of a plane region using limits.
## Sigma Notation
"""
7.6 ms

Sigma Notation

The sum of n terms a1,a2,,an is written as

i=1nai=a1+a2++an

where i is the index of summation, ai is the th ith term of the sum, and the upper and lower bounds of summation are n and 1.

cm"""
$(beginBlock("Sigma Notation",""))

The sum of ``n`` terms ``a_1, a_2, \cdots, a_n`` is written as
```math
\sum_{i=1}^n a_i = a_1+ a_2+ \cdots+ a_n
```
where ``i`` is the __index of summation__, ``a_i`` is the th __``i``th term__ of the sum, and the upper and lower bounds of summation are ``n`` and ``1``.
$(endBlock())
"""
513 μs

Summation Properties

i=1nkai=ki=1naii=1n(ai±bi)=i=1nai±i=1nbi

Theorem
Summation Formulas

(1)i=1nc=cn,c is a constant(2)i=1ni=n(n+1)2(3)i=1ni2=n(n+1)(2n+1)6(4)i=1ni3=[n(n+1)2]2

cm"""
$(beginBlock("Summation Properties",""))

```math

\begin{array}{lcl}
\displaystyle\sum_{i=1}^n k a_i &=& \displaystyle k\sum_{i=1}^n a_i \\
\\
\displaystyle\sum_{i=1}^n (a_i\pm b_i) &=& \displaystyle\sum_{i=1}^n a_i\pm\sum_{i=1}^n b_i \\
\\

\end{array}
```
$(endBlock())

$(beginTheorem("Summation Formulas"))
```math
\displaystyle
\begin{array}{ll}
(1) & \displaystyle\sum_{i=1}^n c = cn, \quad c \text{ is a constant} \\
\\
(2) & \displaystyle\sum_{i=1}^n i = \frac{n(n+1)}{2} \\
\\
(3) &\displaystyle \sum_{i=1}^n i^2 = \frac{n(n+1)(2n+1)}{6} \\
\\
(4) & \displaystyle\sum_{i=1}^n i^3 = \left[\frac{n(n+1)}{2}\right]^2 \\
\\
\end{array}
```

$(endTheorem())
556 μs

Example 1:
Evaluating a Sum
Evaluate i=1ni+1n for n=10,100,1000 and 10,000.

cm"""
$(example("Example 1","Evaluating a Sum"))
Evaluate ``\displaystyle \sum_{i=1}^n\frac{i+1}{n}`` for ``n=10, 100, 1000`` and ``10,000``.
"""
503 μs

Area

In Euclidean geometry, the simplest type of plane region is a rectangle. Although people often say that the formula for the area of a rectangle is

A=bh

it is actually more proper to say that this is the definition of the area of a rectangle.

For a triangle A=12bh

md"""
## Area


In __Euclidean geometry__, the simplest type of plane region is a rectangle. Although people often say that the *formula* for the area of a rectangle is
```math
A = bh
```
it is actually more proper to say that this is the *definition* of the __area of a rectangle__.

For a triangle ``A=\frac{1}{2}bh``

$(Resource("https://www.dropbox.com/s/sfsg0d4ha1m2gc6/triangle_area.jpg?raw=1", :width=>300))
"""
48.7 ms

The Area of a Plane Region

Example

Use five rectangles to find two approximations of the area of the region lying between the graph of

f(x)=5x2

and the x-axis between x=0 and x=2.

md"""
## The Area of a Plane Region

__Example__

Use __five__ rectangles to find two approximations of the area of the region lying between the graph of
```math
f(x)=5-x^2
```
and the $x$-axis between $x=0$ and $x=2$.
"""
339 μs
f (generic function with 1 method)
f(x) = 5 - x^2
348 μs

n = a = b = method =

begin
ns = @bind n NumberField(2:4000, default=5)
as = @bind a NumberField(0:1)
bs = @bind b NumberField(a+2:10)
lrs = @bind lr Select(["l" => "Left", "r" => "Right", "m" => "Midpoint", "rnd" => "Random"])

md"""
n = $ns a = $as b = $bs method = $lrs

"""
end
216 ms
@bind showPlot Radio(["show" => "✅", "hide" => "❌"], default="hide")
125 ms
begin
if showPlot == "show"
Δx = (b - a) / n
xx1 = a:0.1:b
pp1,s = reimannSum(f, n, a, b; method=lr, color=:green, plot_it=true)
# # plot(f;xlim=(-2π,2π), xticks=(-2π:(π/2):2π,["$c π" for c in -2:0.5:2]))

# # recs= [rect(sample(p,Δx),Δx,p,f) for p in partition]
# pp1=plot(xx1,f.(xx1);legend=nothing)
# pp1 = plot!(xx1, f.(xx1), fillrange=zero, fillalpha=0.35, c=:blue, framestyle=:origin, label=nothing)
anck1 = (b - a) / 2
anck2 = f(anck1) / 2
annotate!(pp1, [(anck1, anck2, L"$S$", 12)])
annotate!(pp1, [(anck1, f(anck1), L"$y=%$f(x)$", 12)])
end
end
120 μs
# @bind showConnc Radio(["show" => "✅", "hide" => "❌"], default="hide")
7.9 μs
# (showConnc == "show") ? md"""
# $$A=\lim_{n\to \infty} R_n =\lim_{n\to \infty} L_n =\frac{22}{3}$$
# """ : ""
7.1 μs

Finding Area by the Limit Definition

md"## Finding Area by the Limit Definition"
154 μs

Find the area of a plane region bounded above by the graph of a nonnegative, continuous function

y=f(x)

The region is bounded below by the x-axis and the left and right boundaries of the region are the vertical lines x=a and x=b

begin
findingAreaP = plot(0.2:0.1:4, x -> 0.6x^3 - (10 / 3) * x^2 + (13 / 3) * x + 1.4, fillrange=zero, fillalpha=0.35, c=:red, framestyle=:origin, label=nothing, ticks=nothing)
plot!(findingAreaP, -0.1:0.1:4.1, x -> 0.6x^3 - (10 / 3) * x^2 + (13 / 3) * x + 1.4, c=:green, label=nothing)
annotate!(findingAreaP, [
(0.1, 4, text(L"y", 14)),
(4.1, 0.1, text(L"x", 14)),
(0.2, -0.1, text(L"a", 14)),
(4, -0.1, text(L"b", 14)),
(3.9, 4, text(L"f", 14))
])
cm"""
Find the area of a plane region bounded above by the graph of a nonnegative, __continuous__ function
```math
y=f(x)
```
The region is bounded below by the `x-`axis and the left and right boundaries of the region are the vertical lines ``x=a`` and ``x=b``
<div class="img-container">

$(Resource("https://www.dropbox.com/s/hnspiptmyybneqn/area_with_lower_and_upper.jpg?raw=1",:width=>400))
</div>
1.3 s
  • To approximate the area of the region, begin by subdividing the interval into subintervals, each of width
Δx=ban
  • The endpoints of the intervals are
a+0(Δx)a=x0<a+1(Δx)a=x1<a+2(Δx)a=x2<<a+n(Δx)a=xn.
  • Let
f(mi)=Minimum value of f(x) on the ith subintervalf(Mi)=Maximum value of f(x) on the ith subinterval
  • Define an inscribed rectangle lying inside the ith subregion
  • Define an circumscribed rectangle lying outside the ith subregion
(Area of inscribed rectangle)=f(mi)Δxf(Mi)Δx=(Area of circumscribed rectangle)
  • The sum of the areas of the inscribed rectangles is called a lower sum, and the sum of the areas of the circumscribed rectangles is called an upper sum.
Lower sum=s(n)=i=1nf(mi)ΔxArea of inscribed rectangleUpper sum=S(n)=i=1nf(Mi)ΔxArea of circumscribed rectangle
  • The actual area of the region lies between these two sums.
s(n)(Area of region)S(n).
cm"""
- To approximate the area of the region, begin by subdividing the interval into subintervals, each of width
```math
\Delta x = \frac{b-a}{n}
```
- The endpoints of the intervals are
```math
{\color{purple}{\overset{a=x_0}{\overbrace{\color{black}{a+0(\Delta x)}}}}} <
{\color{purple}{\overset{a=x_1}{\overbrace{\color{black}{a+1(\Delta x)}}}}} <
{\color{purple}{\overset{a=x_2}{\overbrace{\color{black}{a+2(\Delta x)}}}}} <
\cdots <
{\color{purple}{\overset{a=x_n}{\overbrace{\color{black}{a+n(\Delta x)}}}}}.
```
- Let
```math
\begin{array}{lcl}
\displaystyle f(m_i) & = & \text{Minimum value of } f(x) \text{ on the }i^{\text{th}}\text{ subinterval} \\
\\
\displaystyle f(M_i) & = & \text{Maximum value of } f(x) \text{ on the }i^{\text{th}}\text{ subinterval} \\
\\
310 μs

Example 4:
Finding Upper and Lower Sums for a Region
Find the upper and lower sums for the region bounded by the graph of f(x)=x2 and the xaxis between x=0 and x=2.

cm"""
$(example("Example 4","Finding Upper and Lower Sums for a Region"))
Find the upper and lower sums for the region bounded by the graph of ``f(x)=x^2`` and the ``x-``axis between ``x=0`` and ``x=2``.
"""
344 μs

n = a = b = method =

begin
ns4 = @bind n4 NumberField(2:4000, default=5)
as4 = @bind a4 NumberField(0:1)
bs4 = @bind b4 NumberField(a4+2:10)
lrs4 = @bind lr4 Select(["l" => "Left", "r" => "Right"])

md"""
n = $ns4 a = $as4 b = $bs4 method = $lrs4

"""
end
2.3 ms
f4 (generic function with 1 method)
f4(x) = x^2
445 μs
begin
Δx4 = (b4 - a4) / n4
xx14 = a4:0.1:b4
pp14,s4 = reimannSum(f4, n4, a4, b4; method=lr4, color=:green, plot_it=true)
anck14 = (b4 - a4) / 3
anck24 = f4(anck14)+1
sumlabel = lr4 == "r" ? L"S(%$n4)=%$s4" : L"s(%$n4)=%$s4"
annotate!(pp14, [(0.5, 2.5, sumlabel, 12)])
annotate!(pp14, [(1.6, f4(1.8), L"$y=%$(f4(x))$", 12)])
end
894 ms

Theorem
Limits of the Lower and Upper Sums

Let f be continuous and nonnegative on the interval [a,b]. The limits as n of both the lower and upper sums exist and are equal to each other. That is,

limns(n)=limni=1nf(mi)Δx=limni=1nf(Mi)Δx=limnS(n)

‍ ‍ where

Δx=ban

and f(mi) and f(Mi) are the minimum and maximum values of f on the ith subinterval.

cm"""
$(beginTheorem("Limits of the Lower and Upper Sums"))

Let ``f`` be continuous and nonnegative on the interval ``[a,b]``. The limits as ``n\to\infty`` of both the lower and upper sums exist and are equal to each other. That is,
```math
\displaystyle \lim_{n\to\infty}s(n)=
\displaystyle \lim_{n\to\infty}\sum_{i=1}^nf(m_i)\Delta x
=\displaystyle \lim_{n\to\infty}\sum_{i=1}^nf(M_i)\Delta x
=\displaystyle \lim_{n\to\infty}S(n)
```
where
```math
\Delta x = \frac{b-a}{n}
```
and ``f(m_i)`` and ``f(M_i)`` are the minimum and maximum values of ``f`` on the ``i``th subinterval.
$(endTheorem())
"""
639 μs

Definition
Area of a Region in the Plane

Let f be continuous and nonnegative on the interval [a,b]. The area of the region bounded by the graph of f , the x-axis, and the vertical lines x=a and y=b is

Area=limni=1nf(ci)Δx

where

xi1cixiandΔx=ban.

See the grpah

cm"""
$(beginBlock("Definition","Area of a Region in the Plane"))

Let ``f`` be continuous and nonnegative on the interval ``[a,b]``. The area of the region bounded by the graph of ``f`` , the ``x``-axis, and the vertical lines ``x=a`` and ``y=b`` is
```math
\textrm{Area} = \displaystyle \lim_{n\to\infty}\sum_{i=1}^nf(c_i)\Delta x
```
where
```math
x_{i-1}\leq c_i\leq x_i\quad \textrm{and}\quad \Delta x =\frac{b-a}{n}.
```
See the grpah
<div class="img-container">

$(Resource("https://www.dropbox.com/s/a3sjz8m9vspp5ec/area_def.jpg?raw=1"))

</div>

$(endBlock())
"""
757 μs

Example 5:
Finding Area by the Limit Definition

Find the area of the region bounded by the graph of f(x)=x3 , the x-axis, and the vertical lines x=0 and x=1.

cm"""
$(example("Example 5","Finding Area by the Limit Definition"))

Find the area of the region bounded by the graph of ``f(x)=x^3`` , the ``x``-axis, and the vertical lines ``x=0`` and ``x=1``.

"""
413 μs

Example 7:
A Region Bounded by the y-axis
Find the area of the region bounded by the graph of f(y)=y2 and the y-axis for 0y1.))

cm"""
$(example("Example 7","A Region Bounded by the <i>y</i>-axis"))
Find the area of the region bounded by the graph of ``f(y)=y^2`` and the ``y``-axis for ``0\leq y\leq 1``.))
"""
31.6 ms

Midpoint Rule

Areai=1nf(xi1+xi2)Δx.

Example 8:
Approximating Area with the Midpoint Rule

Use the Midpoint Rule with n=4 to approximate the area of the region bounded by the graph of f(x)=sinx and the x-axis for 0xπ.

cm"""
### Midpoint Rule
```math
\textrm{Area} \approx \sum_{i=1}^n f\left(\frac{x_{i-1}+x_i}{2}\right)\Delta x.
```
$(example("Example 8","Approximating Area with the Midpoint Rule"))

Use the Midpoint Rule with ``n=4`` to approximate the area of the region bounded by the graph of ``f(x)=\sin x`` and the ``x``-axis for ``0\leq x\leq \pi``.
"""
381 μs
2.0523443059540623
begin
f8(x)=sin(x)
Δx28 = π/4
A = Δx28*(f8(π/8)+f8(3π/8)+f8(5π/8)+f8(7π/8))
end
13.1 ms

5.3: Riemann Sums and Definite Integrals

Objectives

  1. Understand the definition of a Riemann sum.

  2. Evaluate a definite integral using limits and geometric formulas.

  3. Evaluate a definite integral using properties of definite integrals.

md"""# 5.3: Riemann Sums and Definite Integrals

> __Objectives__
> 1. Understand the definition of a Riemann sum.
> 2. Evaluate a definite integral using limits and geometric formulas.
> 3. Evaluate a definite integral using properties of definite integrals.

"""
201 μs

Riemann Sums

md"## Riemann Sums"
134 μs
g (generic function with 1 method)
g(x) = √x
288 μs

n = a = b = method =

begin
ns2 = @bind n2 NumberField(2:2000,default=4)
as2 = @bind a2 NumberField(-10:10, default=0)
bs2 = @bind b2 NumberField(a+1:10)
lrs2 = @bind lr2 Select(["l" => "Left", "r" => "Right", "m" => "Midpoint", "rnd" => "Random"])
md"""
n = $ns2 a = $as2 b = $bs2 method = $lrs2


"""
end
2.3 ms
begin
Δx2 = (b2 - a2) / n2
xx12 = a2:0.001:b2
pp12,s2 = reimannSum(g, n2, a2, b2; method=lr2, color=:green, plot_it=true)
sumlabel2 = lr2 == "r" ? L"S(%$n2)=%$s2" : L"s(%$n2)=%$s2"
annotate!(pp12, [(0.2, 0.8, sumlabel2, 12)])
annotate!(pp12, [(1.6, g(1.8), L"$y=%$(g(x))$", 12)])
end
111 ms

Definition of Riemann Sum

Let f be defined on the closed interval [a,b], and let Δ be a partition of [a,b] given by

a=x0<x1<x2<<xn1<xn=b

where Δxi is the width of the th subinterval

[xi1,xi]ith subinterval

‍ ‍ If ci is any point in the th subinterval, then the sum

i=1nf(ci)Δxi,xi1cixi

is called a Riemann sum of f for the partition Δ.

cm"""

$(beginBlock("Definition of Riemann Sum",""))

Let ``f`` be defined on the closed interval ``[a,b]``, and let ``\Delta`` be a partition of ``[a,b]`` given by

```math

a=x_0 < x_1 < x_2 < \cdots < x_{n-1} < x_n = b

```

where ``\Delta x_i`` is the width of the th subinterval

```math
[x_{i-1},x_i]\quad \color{red}i\textrm{{th subinterval}}
```

If ``c_i`` is any point in the th subinterval, then the sum

```math
\sum_{i=1}^n f(c_i)\Delta x_i, \quad x_{i-1}\leq c_i\leq x_i
```
is called a __Riemann sum__ of ``f`` for the partition ``\Delta``.
$(endBlock())
"""

449 μs

Remark

The width of the largest subinterval of a partition Δ is the norm of the partition and is denoted by Δ.

  • If every subinterval is of equal width, then the partition is regular and the norm is denoted by
Δ=Δx=banRegular partition
  • For a general partition, the norm is related to the number of subintervals of [a,b] in the following way.
baΔnGeneral partition
  • Note that
Δ0implies thatn.
cm"""
__Remark__

The width of the largest subinterval of a partition ``\Delta`` is the __norm__ of the partition and is denoted by ``\|\Delta\|``.

- If every subinterval is of equal width, then the partition is __regular__ and the norm is denoted by
```math
\|\Delta\| = \Delta x =\frac{b-a}{n} \quad \color{red}{\textrm{Regular partition}}
```

- For a general partition, the norm is related to the number of subintervals of ``[a,b]`` in the following way.
```math
\frac{b-a}{\|\Delta\|}\leq n \quad \color{red}{\textrm{General partition}}
```

- Note that
```math
\|\Delta\|\to 0 \quad \textrm{implies that}\quad n\to \infty.
```

"""
275 μs

Definite Integrals

md"## Definite Integrals"
133 μs

Definition of Definite Integral

If f is defined on the closed interval [a,b] and the limit of Riemann sums over partitions Δ

limΔ0i=1nf(ci)Δxi

‍ exists, then f is said to be integrable on [a,b] and the limit is denoted by

limΔ0i=1nf(ci)Δxi=abf(x)dx.

‍ ‍The limit is called the definite integral of f from a to b. The number a is the lower limit of integration, and the number b is the upper limit of integration.

cm"""
$(beginBlock("Definition of Definite Integral",""))
If ``f`` is defined on the closed interval ``[a,b]`` and the limit of Riemann sums over partitions ``\Delta``
```math
\lim_{\|\Delta\|\to 0}\sum_{i=1}^nf(c_i)\Delta x_i
```
exists, then ``f`` is said to be __integrable__ on ``[a,b]`` and the limit is denoted by
```math
\lim_{\|\Delta\|\to 0}\sum_{i=1}^nf(c_i)\Delta x_i = \int_a^b f(x) dx.
```
‍The limit is called the __definite integral__ of ``f`` from ``a`` to ``b``. The number ``a`` is the __lower limit__ of integration, and the number ``b`` is the __upper limit__ of integration.

$(endBlock())
"""
511 μs

Theorem
Continuity Implies Integrability

If a function f is continuous on the closed interval [a,b], then f is integrable on [a,b]. That is,

abf(x)dxexists.

cm"""
$(beginTheorem("Continuity Implies Integrability"))

If a function ``f`` is continuous on the closed interval ``[a,b]``, then ``f`` is integrable on ``[a,b]``. That is,

```math
\int_a^b f(x) dx \quad \textrm{exists}.
```
$(endTheorem())
"""
499 μs

Theorem
The Definite Integral as the Area of a Region

If f is continuous and nonnegative on the closed interval [a,b], then the area of the region bounded by the graph of f, the x-axis, and the vertical lines x=a and x=b is

Area=abf(x)dx

cm"""
$(beginTheorem("The Definite Integral as the Area of a Region"))

If ``f`` is continuous and nonnegative on the closed interval ``[a,b]``, then the area of the region bounded by the graph of ``f``, the ``x``-axis, and the vertical lines ``x=a`` and ``x=b`` is
```math
\textrm{Area} = \int_a^b f(x) dx
```
‍$(endTheorem())
"""
552 μs

Example 3:
Areas of Common Geometric Figures

Evaluate each integral using a geometric formula.

  • 134dx
  • 03(x+2)dx
  • 224x2dx
cm"""
$(example("Example 3", "Areas of Common Geometric Figures"))

Evaluate each integral using a geometric formula.
- ``\displaystyle\int_1^3 4 dx``
- ``\displaystyle\int_0^3 (x+2) dx``
- ``\displaystyle\int_{-2}^2 \sqrt{4-x^2} dx``
"""
330 μs

Remark
The definite integral is a **number**

  • It does not depend on x. In fact, we could use any letter in place of x without changing the value of the integral:
abf(x)dx=abf(y)dy=abf(w)dw=abf(😀)d😀
  • If f(x)0, the integral abf(x)dx is the area under the curve y=f(x) from a to b.

  • abf(x)dx is the net area

begin
f2(x) = sin(x) + 2
theme(:wong)
x521 = 1:0.1:5
y = f2.(x521)
p3 = plot(x521, y, label=nothing)
plot!(p3, x521, y / 2, ribbon=y / 2, linestyle=:dot, linealpha=0.1, framestyle=:origin, xticks=(1:5, [:a, "", "", "", :b]), label=nothing, ylims=(-1, 4))
annotate!(p3, [(3.5, 2.5, L"y=f(x)"), (5.2, 0, L"x"), (0.2, 4, L"y")])
cm"""
$(beginBlock("Remark","The definite integral is a **number**"))
- It does not depend on ``x``. In fact, we could use any letter in place of ``x`` without changing the value of the integral:

```math
\int_a^b f(x) dx = \int_a^b f(y) dy =\int_a^b f(w) dw =\int_a^b f(😀) d😀
```
- If ``f(x)\ge 0``, the integral ``\int_a^b f(x) dx`` is the area under the curve ``y=f(x)`` from ``a`` to ``b``.

$p3

- ``\int_a^b f(x) dx`` is the net area
<div class="img-container" >

68.5 ms

Properties of Definite Integrals

md"## Properties of Definite Integrals"
133 μs

Definitions
Two Special Definite Integrals

  • If f is defined at x=a, then aaf(x)dx=0.
  • If f is integrable on [a,b], then baf(x)dx=abf(x)dx.

cm"""
$(beginBlock("Definitions","Two Special Definite Integrals"))
- If ``f`` is defined at ``x=a``, then ``\displaystyle \int_a^a f(x) dx =0``.
- If ``f`` is integrable on ``[a,b]``, then ``\displaystyle \int_b^a f(x) dx =- \int_a^b f(x) dx``.
$(endBlock())
"""
75.6 ms

Theorem
Additive Interval Property

If f is integrable on the three closed intervals determined by a,b and c, then

abf(x)dx=acf(x)dx+cbf(x)dx.

cm"""
$(beginTheorem("Additive Interval Property"))
If ``f`` is integrable on the three closed intervals determined by ``a, b`` and ``c``, then
```math
\int_a^b f(x) dx = \int_a^c f(x) dx + \int_c^b f(x) dx.
```
$(endTheorem())
"""
527 μs

Theorem
Properties of Definite Integrals

  • If f and g are integrable on [a,b] and k is a constant, then the functions kf and f±g are integrable on [a,b], and
    1. abkf(x)dx=kabf(x)dx.
    2. ab[f(x)±g(x)]dx=abf(x)dx±abg(x)dx.

cm"""

$(beginTheorem("Properties of Definite Integrals"))
- If ``f`` and ``g`` are integrable on ``[a,b]`` and ``k`` is a constant, then the functions ``kf`` and ``f\pm g`` are integrable on ``[a,b]``, and
1. ``\displaystyle \int_a^b kf(x) dx = k \int_a^b f(x) dx``.
2. ``\displaystyle \int_a^b \left[f(x)\pm g(x)\right] dx = \int_a^b f(x) dx\pm \int_a^b g(x) dx``.
$(endTheorem())
"""
539 μs

Theorem
Preservation of Inequality

  • If f is integrable and nonnegative on the closed interval [a,b], then
0abf(x)dx.
  • If f and g are integrable on the closed interval [a,b] and f(x)g(x) for every x in [a,b] , then
abf(x)dxabg(x)dx.

cm"""
$(beginTheorem("Preservation of Inequality"))
- If ``f`` is integrable and nonnegative on the closed interval ``[a,b]``, then
```math
0\leq \int_a^b f(x) dx.
```
- If ``f`` and ``g`` are integrable on the closed interval ``[a,b]`` and ``f(x)\leq g(x)`` for every ``x`` in ``[a,b]`` , then
```math
\int_a^b f(x) dx \leq \int_a^b g(x) dx.
```
$(endTheorem())

"""
404 μs

Examples:

cm"""
$(example("Examples",""))

<div class="img-container">

$(Resource("https://www.dropbox.com/s/cat9ots4ausfzyc/qrcode_itempool.com_kfupm.png?raw=1",:width=>300))

</div>
"""
665 μs

5.4: The Fundamental Theorem of Calculus

Objectives

  1. Evaluate a definite integral using the Fundamental Theorem of Calculus.

  2. Understand and use the Mean Value Theorem for Integrals.

  3. Find the average value of a function over a closed interval.

  4. Understand and use the Second Fundamental Theorem of Calculus.

  5. Understand and use the Net Change Theorem.

md"""
# 5.4: The Fundamental Theorem of Calculus
> __Objectives__
> 1. Evaluate a definite integral using the Fundamental Theorem of Calculus.
> 2. Understand and use the Mean Value Theorem for Integrals.
> 3. Find the average value of a function over a closed interval.
> 4. Understand and use the Second Fundamental Theorem of Calculus.
> 5. Understand and use the Net Change Theorem.

"""
204 μs

The Fundamental Theorem of Calculus

md"## The Fundamental Theorem of Calculus"
138 μs

Antidifferentiation and Definite Integration

  • abf(x)dx
    • definite integral
    • number
  • f(x)dx
    • indefinite integral
    • function
cm"""
__Antidifferentiation and Definite Integration__

<div class="img-container">

$(Resource("https://www.dropbox.com/s/8f52dty2aywwr92/diff_vs_antidiff.jpg?raw=1",:width=>600))

</div>

* ✒ ``\displaystyle \int_a^b f(x) dx``
* definite integral
* number
* ✒ ``\displaystyle \int f(x) dx``
* indefinite integral
* function
"""
451 μs

Theorem
The Fundamental Theorem of Calculus

If a function f is continuous on the closed interval [a,b] and F is an antiderivative of f on the interval [a,b], then

abf(x)dx=F(b)F(a).

cm"""
$(beginTheorem("The Fundamental Theorem of Calculus"))

If a function ``f`` is continuous on the closed interval ``[a,b]`` and ``F`` is an antiderivative of ``f`` on the interval ``[a,b]``, then
```math
\int_a^b f(x) dx = F(b) - F(a).
```
$(endTheorem())

"""
376 μs

Remark

We use the notation

abf(x)dx=F(x)|ab=F(b)F(a)orabf(x)dx=[F(x)]ab=F(b)F(a)

cm"""

$(beginBlock("Remark",""))

We use the notation
```math
\int_a^b f(x) dx = \bigl. F(x)\Biggr|_a^b= F(b)-F(a) \quad \textrm{or}\quad
\int_a^b f(x) dx =\Bigl[F(x)\Bigr]_a^b = F(b)-F(a)
```
$(endBlock())
"""
386 μs

Example 1:
Evaluating a Definite Integral

Evaluate each definite integral.

  • 12(x23)dx

  • 143xdx

  • 0π/4sec2xdx

  • 02|2x1|dx
cm"""
$(example("Example 1", "Evaluating a Definite Integral"))

Evaluate each definite integral.

- ``\displaystyle \int_1^2 (x^2-3) dx``

$(" ")
- ``\displaystyle \int_1^4 3\sqrt{x} dx``

$(" ")
- ``\displaystyle \int_{0}^{\pi/4} \sec^2 x dx``

$(" ")
- ``\displaystyle \int_{0}^{2} \Big|2x-1\Big| dx``
"""
556 μs

cm"""


<div class="img-container">

$(Resource("https://www.dropbox.com/s/cat9ots4ausfzyc/qrcode_itempool.com_kfupm.png?raw=1",:width=>300))

</div>
"""
670 μs

Example 3:
Using the Fundamental Theorem to Find Area

Find the area of the region bounded by the graph of

y=1x

the x-axis, and the vertical lines x=1 and x=e.

begin
theme(:wong)
s54e3_f(x) = 1 / x
s54e3_x = 1:0.1:exp(1)
s54e3_p = plot(s54e3_x, s54e3_f.(s54e3_x), label=nothing, c=:green)
plot!(s54e3_p, s54e3_x, s54e3_f.(s54e3_x) / 2, ribbon=s54e3_f.(s54e3_x) / 2, linestyle=:dot, linealpha=0.1, framestyle=:origin, xticks=(1:4, [:1, :2, :3]), label=nothing, ylims=(-0.1, 1.5), xlims=(-0.1, 3))
annotate!(s54e3_p, [(2, 1, L"y=\frac{1}{x}"), (exp(1), -0.1, L"e")])
cm"""
$(example("Example 3","Using the Fundamental Theorem to Find Area"))

Find the area of the region bounded by the graph of
```math
y=\frac{1}{x}
```
the ``x``-axis, and the vertical lines ``x=1`` and ``x=e``.


$s54e3_p

"""
end
376 ms

The Mean Value Theorem for Integrals

md"## The Mean Value Theorem for Integrals"
141 μs

Theorem
The Mean Value Theorem for Integrals

If f is continuous on the closed interval [a,b], then there exists a number c in the closed interval [a,b] such that

abf(x)dx=f(c)(ba).

cm"""
$(beginTheorem("The Mean Value Theorem for Integrals"))

If ``f`` is continuous on the closed interval ``[a,b]``, then there exists a number ``c`` in the closed interval ``[a,b]`` such that
```math
\int_a^b f(x) dx =f(c)(b-a).
```

<div class="img-container">

$(Resource("https://www.dropbox.com/s/7fnr2kfq082kq0y/mvt.jpg?raw=1",
:style=>"display:flex;align-items:center;flex-direction: column;"))
</div>

$(endTheorem())

"""

570 μs

Average Value of a Function

Definition
the Average Value of a Function on an Interval

If f is integrable on the closed interval [a,b], then the average value of f on the interval is

Avergae value=1baabf(x)dx

Example 4:
Finding the Average Value of a Function

Find the average value of f(x)=3x22x on the interval [1,4].

begin
ttt = md"## Average Value of a Function"
cm"""
$ttt

$(beginBlock("Definition","the Average Value of a Function on an Interval"))

If ``f`` is integrable on the closed interval ``[a,b]``, then the __average value__ of ``f`` on the interval is
```math
\textbf{Avergae value} = \frac{1}{b-a}\int_a^b f(x) dx
```
$(endBlock())

$(example("Example 4","Finding the Average Value of a Function"))

Find the average value of ``f(x)=3x^2-2x`` on the interval ``[1,4]``.

"""
end
573 μs

The Second Fundamental Theorem of Calculus

md"## The Second Fundamental Theorem of Calculus"
137 μs

cm"""

<div class="img-container">

$(Resource("https://www.dropbox.com/s/knjbngrqs2r2h1z/ftc2.jpg?raw=1",
:style=>"margin-top:20px;"
))

</div>

"""
385 μs

Consider the following function

F(x)=axf(t)dt

where f is a continuous function on the interval [a,b] and x[a,b].

md"""
Consider the following function

```math
F(x) = \int_a^x f(t) dt
```
where ``f`` is a continuous function on the interval ``[a,b]`` and ``x \in [a,b]``.

"""
207 μs

x =

begin
Slider4 = @bind slider4 Slider(1:0.1:5, show_value=false)
md"x = $Slider4"
end
70.5 ms
begin
f54(x) = sin(x) + 2
theme(:wong)
x4 = 1:0.1:5
y4 = f54.(x4)
xVar = 1:0.1:slider4
yVar = f54.(xVar) / 2
p4 = plot(x4, y4, label=nothing, grid=false)

plot!(p4, xVar, yVar, ribbon=yVar, linestyle=:dot, linealpha=0.1, framestyle=:origin, xticks=(1:5, [:a, "", "", "", :b]), label=nothing, ylims=(-1, 4))
plot!(p4, xticks=(x4, [:a, ["" for i in 2:length(xVar)-1]..., :x, ["" for i in length(xVar):length(x4)-2]..., :b]))
annotate!(p4, [(3.5, 2.5, L"y=f(t)"), (5.2, 0, L"t"), (0.2, 4, L"y")])
slider4 > 1 && annotate!(p4, [(slider4 * 0.7, 1, (L"$F(x)=\int_a^x f(t) dt$", 12))])

md"""

$p4
"""

end
1.2 s

Example If g(x)=0xf(t)dt

Find g(2)

begin
img = load("./imgs/5.3/ex1.png") |> im -> imresize(im, ratio=0.7)
md"""
**Example**
If ``g(x) = \int_0^x f(t) dt``

$img

Find ``g(2)``

"""
end
852 ms

Theorem
The Second Fundamental Theorem of Calculus

If f is continuous on an open interval I containing a, then, for every x in the interval,

ddx[axf(t)]=f(x).

cm"""
$(beginTheorem("The Second Fundamental Theorem of Calculus"))

If ``f`` is continuous on an open interval ``I`` containing ``a``, then, for every ``x`` in the interval,

```math

\frac{d}{dx}\left[\int_a^x f(t) \right] = f(x).
```
$(endTheorem())

"""
404 μs

Remarks

  • ddx(axf(u)du)=f(x)

  • g(x) is an antiderivative of f

Examples

Find the derivative of

(1) g1(x)=0x1+tdt.

(2) g2(x)=x01+tdt.

(3) g3(x)=0x21+tdt.

(4) g4(x)=sin(x)cos(x)1+tdt.

md"""

__Remarks__
* ``{\large \frac{d}{dx}\left( \int_a^x f(u) du\right) = f(x)}``
* ``g(x)`` is an **antiderivative** of ``f``

__Examples__

Find the derivative of
(1) ``g_1(x) = \int_0^x \sqrt{1+t} dt``.

(2) ``g_2(x) = \int_x^0 \sqrt{1+t} dt``.
(3) ``g_3(x) = \int_0^{x^2} \sqrt{1+t} dt``.
(4) ``g_4(x) = \int_{\sin(x)}^{\cos(x)} \sqrt{1+t} dt``.
"""
4.6 ms

💣 BE CAREFUL:

Evaluate 361xdx

md"""
💣 BE CAREFUL:

Evaluate ``\large \int_{-3}^6 \frac{1}{x}dx``
"""
196 μs

Net Change Theorem

md"## Net Change Theorem"
137 μs

Question: If y=F(x), then what does F(x) represents?

Theorem
The Net Change Theorem

If F(x) is the rate of change of a quantity F(x) , then the definite integral of F(x) from a to b gives the total change, or net change, of F(x) on the interval [a,b].

abF(x)dx=F(b)F(a)Net change of F(x)

cm"""
**Question:** If ``y=F(x)``, then what does ``F'(x)`` represents?

$(beginTheorem("The Net Change Theorem"))

If ``F'(x)`` is the rate of change of a quantity ``F(x)`` , then the definite integral of ``F'(x)`` from ``a`` to ``b`` gives the total change, or __net change__, of ``F(x)`` on the interval ``[a,b]``.

```math
\int_a^b F'(x) dx = F(b) - F(a) \qquad \color{red}{\textrm{Net change of } F(x)}
```
$(endTheorem())
"""
476 μs
  • There are many applications, we will focus on one

If an object moves along a straight line with position function s(t), then its velocity is v(t)=s(t), so

t1t2v(t)dt=s(t2)s(t1)
  • Remarks
displacement=t1t2v(t)dttotal distance traveled=t1t2|v(t)|dt
  • The acceleration of the object is a(t)=v(t), so
t1t2a(t)dt=v(t2)v(t1) is the change in velocity from time to time .
cm"""
- There are many applications, we will focus on one

If an object moves along a straight line with position function ``s(t)``, then its velocity is ``v(t)=s'(t)``, so
```math
\int_{t_1}^{t_2}v(t) dt = s(t_2)-s(t_1)
```

- **Remarks**
```math
\begin{array}{rcl}
\text{displacement} &=& \displaystyle \int_{t_1}^{t_2}v(t) dt\\
\\
\text{total distance traveled} &=& \displaystyle \int_{t_1}^{t_2}|v(t)| dt \\ \\
\end{array}
```
- The acceleration of the object is ``a(t)=v'(t)``, so
```math
\int_{t_1}^{t_2}a(t) dt = v(t_2)-v(t_1) \quad \text { is the change in velocity from time to time .}
```
"""
236 μs

Example 10:
Solving a Particle Motion Problem
A particle is moving along aline. Its velocity function (in m/s2) is given by

v(t)=t310t2+29t20,
  • What is the displacement of the particle on the time interval 1≤ t≤ 5?
  • What is the total distance traveled by the particle on the time interval 1≤ t≤ 5?
cm"""
$(example("Example 10","Solving a Particle Motion Problem"))
A particle is moving along aline. Its velocity function (in ``m/s^2``) is given by
```math
v(t)=t^3-10t^2+29t-20,
```
<ul style="list-style-type: lower-alpha;">

<li> What is the <b>displacement</b> of the particle on the time interval 1≤ t≤ 5?</li>
<li>What is the <b>total distance</b> traveled by the particle on the time interval 1≤ t≤ 5?</li>

</ul>
"""
315 μs
v (generic function with 1 method)
v(t) = t^3 - 10 * t^2 + 29 * t - 20
384 μs
begin

u = symbols("u", real=true)
v1(t) = v(t)
s1(t) = convert(Float64, integrate(v1(u), (u, 0, t)).n())

theme(:default)
a1, b1 = 1, 5
t1 = a1:0.1:b1
timeLength = length(t1)
xxx = s1.(t1)
vvv = v1.(t1)
myXlims = s1(a1) .+ (0, 20)
myYlims = vvv |> ff -> (min(ff...) - 1, max(ff...) + 1)
anim = @animate for i1:timeLength
pp = plot(; layout=(2, 1))
scatter!(pp, (xxx[i], 0),
markersize=5,
grids=:none,
framestyle=:origin,
showaxis=:x,
yticks=nothing,
ylims=(-0.4, 0.4),
xlims=myXlims,
label=nothing,
xticks=nothing,
Saved animation to E:\Dropbox\KFUPMWork\Teaching\OldSemesters\Sem231\MATH102\lessons\src\example_fps15.gif
7.1 s

5.5: The Substitution Rule

Objectives

  1. Use pattern recognition to find an indefinite integral.

  2. Use a change of variables to find an indefinite integral.

  3. Use the General Power Rule for Integration to find an indefinite integral.

  4. Use a change of variables to evaluate a definite integral.

  5. Evaluate a definite integral involving an even or odd function.

solve
2x1+x2dxudu
md"""
# 5.5: The Substitution Rule
> __Objectives__
> 1. Use pattern recognition to find an indefinite integral.
> 2. Use a change of variables to find an indefinite integral.
> 3. Use the General Power Rule for Integration to find an indefinite integral.
> 4. Use a change of variables to evaluate a definite integral.
> 5. Evaluate a definite integral involving an even or odd function.


||||
|------|------|-------|
||solve|||
|$$\int 2x \sqrt{1+x^2} \;\; dx$$| | $$\int \sqrt{u} \;\; du$$|

"""
427 μs

Pattern Recognition

md"## Pattern Recognition"
151 μs

Theorem
Antidifferentiation of a Composite Function

Let g be a function whose range is an interval I, and let f be a function that is continuous on I. If g is differentiable on its domain and F is an antiderivative of f on I, then

f(g(x))g(x)dx=F(g(x))+C.

Letting u=g(x) gives du=g(x)dx and

f(u)du=F(u)+C.

Substitution Rule says: It is permissible to operate with dx and du after integral signs as if they were differentials.

Example Find

(i)(x2+1)2(2x)dx(ii)5e5xdx(iii)x14x2dx(iv)1+x2x5dx(v)tanxdx
# f155(x) = x / sqrt(1 - 4 * x^2)
# ex1_55=plot(-0.49:0.01:0.49,f155.(-0.49:0.01:0.49), framestyle=:origin)
cm"""
$(beginTheorem("Antidifferentiation of a Composite Function"))
Let ``g`` be a function whose range is an interval ``I``, and let ``f`` be a function that is continuous on ``I``. If ``g`` is differentiable on its domain and ``F`` is an antiderivative of ``f`` on ``I``, then
```math
\int f(g(x))g'(x)dx = F(g(x)) + C.
```
Letting ``u=g(x)`` gives ``du=g'(x)dx`` and
```math
\int f(u) du = F(u) + C.
```
$(endTheorem())
<div class="img-container">

$(Resource("https://www.dropbox.com/s/uua8vuahfxnp48c/subs_th.jpg?raw=1"))

</div>

**Substitution Rule says:** It is permissible to operate with ``dx`` and ``du`` after integral signs as if they were differentials.

**Example**
Find
```math
610 μs

cm"""


<div class="img-container">

$(Resource("https://www.dropbox.com/s/cat9ots4ausfzyc/qrcode_itempool.com_kfupm.png?raw=1",:width=>300))

</div>
"""
868 μs

Change of Variables for Indefinite Integrals

Example: Find

(i)2x1dx(ii)x2x1dx(iii)sin23xcos3xdx

md"""
## Change of Variables for Indefinite Integrals
__Example__: Find
```math
\begin{array}{ll}
(i) & \int \sqrt{2x-1} dx \\ \\
(ii) & \int x\sqrt{2x-1} dx \\ \\
(iii) & \int \sin^23x\cos3x dx \\ \\
\end{array}
```
"""
219 μs

The General Power Rule for Integration

md"""
## The General Power Rule for Integration
"""
134 μs

Theorem
The General Power Rule for Integration

If g is a differentiable function of x, then

[g(x)]ng(x)dx=[g(x)]n+1n+1+C,n1.

‍Equivalently, if u=g(x), then

undu=un+1n+1+C,n1.

Example: Find

(i)3(3x1)4dx(ii)(ex+1)(ex+x)dx(iii)3x2x32dx(iv)4x(12x2)2dx(v)cos2xsinxdx
cm"""
$(beginTheorem("The General Power Rule for Integration"))
If ``g`` is a differentiable function of ``x``, then
```math
\int\bigl[g(x)\bigr]^ng'(x) dx = \frac{\bigl[g(x)\bigr]^{n+1}}{n+1} + C, \quad n\neq -1.
```
‍Equivalently, if ``u=g(x)``, then
```math
\int u^n du = \frac{u^{n+1}}{n+1} + C, \quad n\neq -1.
```
$(endTheorem())
__Example__: Find
```math
\begin{array}{ll}
(i) & \int 3(3x-1)^4 dx \\ \\
(ii) & \int (e^x+1)(e^x+x) dx \\ \\
(iii) & \int 3x^2\sqrt{x^3-2} \;dx \\ \\
(iv) & \displaystyle \int \frac{-4x}{(1-2x^2)^2}\; dx \\ \\
(v) & \int \cos^2 x\sin x \;dx \\ \\
\end{array}
```

"""
560 μs

cm"""


<div class="img-container">

$(Resource("https://www.dropbox.com/s/cat9ots4ausfzyc/qrcode_itempool.com_kfupm.png?raw=1",:width=>300))

</div>
"""
351 μs
x = symbols("x", real=true);
181 μs

Change of Variables for Definite Integrals

md"""
## Change of Variables for Definite Integrals
"""
134 μs

Substitution: Definite Integrals

Example: Evaluate

1elnxxdx

begin
ex2fun1(x) = log(x) / x
ex2fun2(x) = x
ex2x1 = 1:0.1:exp(1)
ex2x12 = 0:0.1:1
ex2x2 = 0.6:0.1:4
ex2x22 = log(0.6):0.1:log(4)

ex2y1 = ex2fun1.(ex2x1)
ex2y12 = ex2fun2.(ex2x12)
ex2y2 = ex2fun1.(ex2x2)
ex2y22 = ex2fun2.(ex2x22)
theme(:wong)
ex2plt1 = plot(ex2x1, ex2y1, framestyle=:origin, xlims=(0, exp(1)), ylims=(-1, 1), fillrange=0, fillalpha=0.5, c=:red, label=nothing)
plot!(ex2plt1, ex2x2, ex2y2, c=:red, label=nothing)
xlims!(ex2plt1, -1, 4)
annotate!(ex2plt1, [(2, 0.5, L"y=\frac{\ln x}{x}"), (exp(1), -0.05, text(L"e", 12))])
plot!(ex2plt1, [exp(1), exp(1)], [0, ex2fun1(exp(1))], c=:red, linewidth=3, label=nothing)

ex2plt2 = plot(ex2x12, ex2y12, framestyle=:origin, xlims=(0, 1), ylims=(-1, 1), fillrange=0, fillalpha=0.5, c=:red, label=nothing)
plot!(ex2plt2, ex2x22, ex2y22, c=:red, label=nothing)
xlims!(ex2plt2, -1, 4)
annotate!(ex2plt2, [(2, 0.5, L"v=u")])
1.5 s

Example: Evaluate

(i)12dx(35x)2(iii)01x(x2+1)3dx(iv)15x2x1dx
cm"""
**Example:**
Evaluate

```math
\begin{array}{ll}
(i) & \int_1^2 \frac{dx}{\left(3-5x\right)^2} \\ \\
(iii) & \int_0^1 x(x^2+1)^3 \;dx \\ \\
(iv) & \int_1^5 \frac{x}{\sqrt{2x-1}}\;dx \\ \\
\end{array}
```
"""
1.6 s

Integration of Even and Odd Functions

md"""
## Integration of Even and Odd Functions
"""
134 μs

Theorem
Integration of Even and Odd Functions

Let f be integrable on [a,a].

  • If f is even [f(x)=f(x)], then
aaf(x)dx=20af(x)dx
  • If f is odd [f(x)=f(x)], then
aaf(x)dx=0

Example Find

11tanx1+x2+x4dx
cm"""
$(beginTheorem("Integration of Even and Odd Functions"))
Let ``f`` be integrable on **``[-a,a]``**.

* If ``f`` is **even** ``\left[f(-x)=f(x)\right]``, then
```math
\int_{-a}^a f(x) dx = 2\int_0^a f(x) dx
```

* If ``f`` is **odd** ``\left[f(-x)=-f(x)\right]``, then
```math
\int_{-a}^a f(x) dx = 0
```
$(endTheorem())

**Example**
Find
```math
\int_{-1}^1 \frac{\tan x}{1+x^2+x^4} dx
```

"""
447 μs

5.7: The Natural Logarithmic Function: Integration

Objectives

  1. Use the Log Rule for Integration to integrate a rational function.

  2. Integrate trigonometric functions.

Log Rule for Integration

md"""# 5.7: The Natural Logarithmic Function: Integration
> __Objectives__
> 1. Use the Log Rule for Integration to integrate a rational function.
> 2. Integrate trigonometric functions.

## Log Rule for Integration
"""
204 μs

Theorem
Log Rule for Integration

Let u be a differentiable function of x.

(i) 1xdx=ln|x|+C(ii) 1udu=ln|u|+C

Remark

uudx=ln|u|+C

cm"""
$(bth("Log Rule for Integration"))

Let ``u`` be a differentiable function of ``x``.
```math
\begin{array}{llll}
\textrm{(i) }& \displaystyle \int \frac{1}{x} dx &=& \ln|x| + C \\ \\
\textrm{(ii) }& \displaystyle \int \frac{1}{u} du &=& \ln|u| + C \\ \\
\end{array}
```
$(eth())

$(bbl("Remark",""))

```math
\displaystyle \int \frac{u'}{u} dx = \ln|u| + C
```

$(ebl())
"""
465 μs

Example 1:
Using the Log Rule for Integration

2xdx

Example 3:
Finding Area with the Log Rule
Find the area of the region bounded by the graph of

y=xx2+1

the x-axis, and the line x=3.


Example 5:
Using Long Division Before Integrating

x2+x+1x2+1dx

cm"""
$(ex(1,s="Using the Log Rule for Integration"))
```math
\int \frac{2}{x}dx
```
$(ex(3,s="Finding Area with the Log Rule"))
Find the area of the region bounded by the graph of
```math
y = \frac{x}{x^2+1}
```
the ``x``-axis, and the line ``x=3``.

<hr>

$(ex(5,s="Using Long Division Before Integrating"))
```math
\int \frac{x^2+x+1}{x^2+1}dx
```
$(poolcode())
"""
835 μs

Examples Find

(i) 14x1dx(ii) 3x2+1x3+xdx(iii) sec2xtanxdx(iv) x2+x+1x2+1dx(v) 2x(x+1)2dx
cm"""
__Examples__ Find
```math
\begin{array}{llll}
\textrm{(i) }& \displaystyle \int \frac{1}{4x-1} dx \\ \\
\textrm{(ii) }& \displaystyle \int \frac{3x^2+1}{x^3+x} dx \\ \\
\textrm{(iii) }& \displaystyle \int \frac{\sec^2x}{\tan x} dx \\ \\
\textrm{(iv) }& \displaystyle \int \frac{x^2+x+1}{x^2+1} dx \\ \\
\textrm{(v) }& \displaystyle \int \frac{2x}{(x+1)^2} dx \\ \\
\end{array}
```
"""
327 μs
begin
rect(x, Δx, xs, f) = Shape([(x, 0), (x + Δx, 0), (x + Δx, f(xs)), (x, f(xs))])
function reimannSum(f, n, a, b; method="l", color=:green, plot_it=false)
Δx = (b - a) / n
x = a:0.01:b
# plot(f;xlim=(-2π,2π), xticks=(-2π:(π/2):2π,["$c π" for c in -2:0.5:2]))

(partition, recs) = if method == "r"
parts = (a+Δx):Δx:b
rcs = [rect(p - Δx, Δx, p, f) for p in parts]
elseif method == "m"
parts = (a+(Δx/2)):Δx:(b-(Δx/2))
rcs = [rect(p - Δx / 2, Δx, p, f) for p in parts]
elseif method == "l"
parts = a:Δx:(b-Δx)
rcs = [rect(p, Δx, p, f) for p in parts]
else
parts = a:Δx:(b-Δx)
rcs = [rect(p, Δx, rand(p:0.1:p+Δx), f) for p in parts]
5.2 ms

Example 7:
Solve the differential equation
Solve

dydx=1xlnx
cm"""
$(ex(7,s="Solve the differential equation"))
Solve
```math
\frac{dy}{dx}=\frac{1}{x\ln x}
```

"""
306 μs

Integrals of Trigonometric Functions

md"""
## Integrals of Trigonometric Functions
"""
135 μs

Example 8:
Using a Trigonometric Identity

tanxdx

Example 9:
Derivation of the Secant Formula

secxdx
cm"""
$(ex(8,s="Using a Trigonometric Identity"))

```math
\int \tan x dx
```

$(ex(9,s="Derivation of the Secant Formula"))

```math
\int \sec x dx
```
"""
438 μs

5.8:Inverse Trigonometric Functions: Integration

Objectives

  1. Integrate functions whose antiderivatives involve inverse trigonometric functions.

  2. Use the method of completing the square to integrate a function.

  3. Review the basic integration rules involving elementary functions.

Integrals Involving Inverse Trigonometric Functions

md"""# 5.8:Inverse Trigonometric Functions: Integration
> __Objectives__
> 1. Integrate functions whose antiderivatives involve inverse trigonometric functions.
> 2. Use the method of completing the square to integrate a function.
> 3. Review the basic integration rules involving elementary functions.
## Integrals Involving Inverse Trigonometric Functions
"""
220 μs

Theorem
Integrals Involving Inverse Trigonometric Functions

Let u be a differential function of x, and let a>0.

1.dua2u2=arcsinua+C2.dua2+u2=1aarctanua+C3.duuu2a2=1aarcsec|u|a+C

cm"""
$(bth("Integrals Involving Inverse Trigonometric Functions"))

Let ``u`` be a differential function of ``x``, and let ``a>0``.
```math
\begin{array}{lllll}
\textrm{1.} & \displaystyle \int\frac{du}{\sqrt{a^2-u^2}} &=&\arcsin\frac{u}{a} + C \\ \\

\textrm{2.} & \displaystyle \int\frac{du}{a^2+u^2} &=&\frac{1}{a}\arctan\frac{u}{a} + C \\ \\

\textrm{3.} & \displaystyle \int\frac{du}{u\sqrt{u^2-a^2}} &=&\frac{1}{a}\text{arcsec}\frac{|u|}{a} + C \\ \\
\end{array}
```
$(eth())
"""
579 μs

Examples Find

dx4x2,dx2+9x2,dxx4x29,dxe2x1,x+24x2dx.
cm"""

__Examples__
Find
```math
\begin{array}{lllll}
\textrm{➡} & \displaystyle \int\frac{dx}{\sqrt{4-x^2}}, \\ \\
\textrm{➡} & \displaystyle \int\frac{dx}{2+9x^2}, \\ \\
\textrm{➡} & \displaystyle \int\frac{dx}{x\sqrt{4x^2-9}}, \\ \\
\textrm{➡} & \displaystyle \int\frac{dx}{\sqrt{e^{2x}-1}}, \\ \\
\textrm{➡} & \displaystyle \int\frac{x+2}{\sqrt{4-x^2}}dx. \\ \\
\end{array}
```
"""
225 μs

Completing the Square

md" ## Completing the Square"
131 μs

Example 5:
Completing the Square
Find

dxx24x+7.

Example 6:
Completing the Square
Find the area of the region bounded by the graph of

f(x)=13xx2

the x-axis, and the lines x=32 and x=94.

cm"""
$(ex(5,s="Completing the Square"))
Find
```math
\int\frac{dx}{x^2-4x+7}.
```
$(ex(6, s="Completing the Square"))
Find the area of the region bounded by the graph of
```math
f(x) = \frac{1}{\sqrt{3x-x^2}}
```
the ``x``-axis, and the lines ``x=\frac{3}{2}`` and ``x=\frac{9}{4}``.

"""
528 μs

5.9: Hyperbolic Functions

Objectives

  1. Develop properties of hyperbolic functions (MATH101).

  2. Differentiate (MATH101) and integrate hyperbolic functions.

  3. Develop properties of inverse hyperbolic functions (Reading only).

  4. Differentiate and integrate functions involving inverse hyperbolic functions. (Reading only).

md"""
# 5.9: Hyperbolic Functions

> __Objectives__
> 1. Develop properties of hyperbolic functions (MATH101).
> 2. Differentiate (MATH101) and integrate hyperbolic functions.
> 3. Develop properties of inverse hyperbolic functions (Reading only).
> 4. Differentiate and integrate functions involving inverse hyperbolic functions. (Reading only).
"""
196 μs

Circle: x2+y2=1

Hyperbola: x2+y2=1

cm"""
__Circle__: ``x^2+y^2=1``

<div class="img-container">

$(Resource("https://www.dropbox.com/s/c53yvdcyul4vvlz/circle.jpg?raw=1"))

</div>

__Hyperbola__: ``-x^2+y^2=1``

<div class="img-container">

$(Resource("https://www.dropbox.com/s/iy6fw024c6r50f8/hyperbola.jpg?raw=1"))

</div>


"""
461 μs

Definitions of the Hyperbolic Functions

sinhx=exex2cschx=1sinhx,x0coshx=ex+ex2sechx=1coshxtanhx=sinhxcoshxcothx=1tanhx,x0

cm"""
__Definitions of the Hyperbolic Functions__
```math
\begin{array}{lllllll}
\sinh x &=& \displaystyle \frac{e^x-e^{-x}}{2} &\qquad&
\text{csch}\; x &=& \displaystyle \frac{1}{\sinh x},\; x\neq 0\\ \\
\cosh x &=& \displaystyle \frac{e^x+e^{-x}}{2} &\qquad&
\text{sech}\; x &=& \displaystyle \frac{1}{\cosh x}\\ \\
\tanh x &=& \displaystyle \frac{\sinh x}{\cosh x} &\qquad&
\text{coth}\; x &=& \displaystyle \frac{1}{\tanh x},\; x\neq 0\\ \\
\end{array}
```

<div class="img-container">

$(Resource("https://www.dropbox.com/s/0q1vcqb77u0ft1t/hyper_graphs.jpg?raw=1"))

</div>
"""
358 μs

Hyperbolic Identities

cosh2xsinh2x=1,sinh(x+y)=sinhxcoshy+coshxsinhytanh2x+sech2x=1,sinh(xy)=sinhxcoshycoshxsinhycoth2xcsch2x=1,cosh(x+y)=coshxcoshy+sinhxsinhycosh(xy)=coshxcoshysinhxsinhysinh2x=cosh2x12,cosh2x=cosh2x+12sin2x=2sinhxcoshx,cosh2x=cosh2x+sinh2x
cm"""
__Hyperbolic Identities__
```math
\begin{array}{rllllll}
\cosh^2 x - \sinh^2 x &=& 1, &\qquad&
\sinh (x+y)\; &=& \sinh x\cosh y +\cosh x\sinh y\\ \\

\tanh^2 x + \text{sech}^2 x &=& 1, &\qquad&
\sinh (x-y)\; &=& \sinh x\cosh y -\cosh x\sinh y\\ \\


\coth^2 x - \text{csch}^2 x &=& 1, &\qquad&
\cosh (x+y)\; &=& \cosh x\cosh y +\sinh x\sinh y\\ \\

&& &\qquad&
\cosh (x-y)\; &=& \cosh x\cosh y -\sinh x\sinh y\\ \\

\sinh^2 x &=& \displaystyle\frac{\cosh 2x -1}{2}, &\qquad&
\cosh^2 x\; &=& \displaystyle\frac{\cosh 2x +1}{2}\\ \\


\sin 2x &=& 2\sinh x\cosh x, &\qquad&
\cosh 2x\; &=& \cosh^2 x +\sinh^2 x\\ \\


\end{array}
```
"""
250 μs

Theorem
Differentiation and Integration of Hyperbolic Functions

Theorem Let u be a differentiable function of x.

ddx(sinhu)=(coshu)u,coshudu=sinhu+Cddx(coshu)=(sinhu)u,sinhudu=coshu+Cddx(tanhu)=(sech2u)u,sech2udu=tanhu+Cddx(cothu)=(csch2u)u,csch2udu=cothu+Cddx(sechu)=(sech utanhu)u,sech utanhudu=sech u+Cddx(cschu)=(csch ucothu)u,csch ucothudu=csch u+C

cm"""
$(bth("Differentiation and Integration of Hyperbolic Functions"))

__Theorem__ Let ``u`` be a differentiable function of ``x``.
```math
\begin{array}{rllllll}
\displaystyle \frac{d}{dx}\left(\sinh u\right) &=& \left(\cosh u\right)u', &\qquad&
\displaystyle \int \cosh u du &=& \sinh u \; +\; C\\ \\

\displaystyle \frac{d}{dx}\left(\cosh u\right) &=& \left(\sinh u\right)u', &\qquad&
\displaystyle \int \sinh u du &=& \cosh u \; +\; C\\ \\

\displaystyle \frac{d}{dx}\left(\tanh u\right) &=& \left(\text{sech}^2 u\right)u', &\qquad&
\displaystyle \int \text{sech}^2 u du &=& \tanh u \; +\; C\\ \\

\displaystyle \frac{d}{dx}\left(\coth u\right) &=& -\left(\text{csch}^2 u\right)u', &\qquad&
\displaystyle \int \text{csch}^2 u du &=& -\coth u \; +\; C\\ \\

\displaystyle \frac{d}{dx}\left(\text{sech} u\right) &=& -\left(\text{sech }u \tanh u\right)u', &\qquad&
\displaystyle \int \text{sech } u\tanh u du &=& -\text{sech } u \; +\; C\\ \\
452 μs

Example 4:
Integrating a Hyperbolic Function
Find

cosh2xsinh22xdx
cm"""
$(ex(4,s="Integrating a Hyperbolic Function"))
Find
```math
\int \cosh 2x \sinh^2 2x dx
```
"""
340 μs

7.1: Area of a Region Between Two Curves

Objectives

  1. Find the area of a region between two curves using integration.

  2. Find the area of a region between intersecting curves using integration.

  3. Describe integration as an accumulation process.

md"""# 7.1: Area of a Region Between Two Curves

__Objectives__
> 1. Find the area of a region between two curves using integration.
> 2. Find the area of a region between intersecting curves using integration.
> 3. Describe integration as an accumulation process.

"""
234 μs
......
begin
struct PlotData
x::StepRangeLen
fun::Function
lb::Union{Integer,Vector{Float64}}
end
PlotData(x,f)=PlotData(x,f,0)
@recipe function f(t::PlotData; customcolor = :green, fillit=true)
x, fun, lb = t.x, t.fun, t.lb
xrotation --> 45
zrotation --> 6, :quiet
aspect_ratio --> 1
framestyle --> :origin
label-->nothing
fill --> (fillit ? (lb,0.5,customcolor) : nothing)
x, fun.(x)
end
# x, y = symbols("x,y", real=true)
p1Opt = (framestyle=:origin, aspectration=1)
function plot_implicit(F, c=0;
xrng=(-5,5), yrng=xrng, zrng=xrng,
nlevels=6, # number of levels in a direction
slices=Dict(:x => :blue,
:y => :red,
:z => :green), # which directions and color
kwargs... # passed to initial `plot` call
148 ms

Area of a Region Between Two Curves

md"## Area of a Region Between Two Curves"
133 μs
move n = 1
begin
cnstSlider = @bind cnstslider Slider(-2:1:2, default=0)
n1Slider = @bind n1slider Slider(1:200, default=1,show_value=true)
md"""
| | |
|---|---|
|move $cnstSlider| ``n`` = $n1Slider|
|||
"""
end


436 ms

How can we find the area between the two curves?

Area=ab[f(x)g(x)]dx

begin
f71(x) = sin(x)+3+cnstslider
f72(x) = cos(2x)+1+cnstslider
f73(x) = cos(2x)+4+cnstslider
poi1=solve(f71(x)-f73(x),x) .|> p -> p.n()
theme(:wong)
a71,b71 = 1, 5
Δx1 = (b71-a71)/n1slider
x1Rect =a71:Δx1:b71
x1 = a71:0.1:b71
y1 = f71.(x1)
y2 = f72.(x1)
y3 = f73.(x1)
p1=plot(x1,y1, fill=(y2,0.25,:green), label=nothing,c=:red)
p2=plot(x1,y1, fill=(y3,0.25,:green), label=nothing,c=:red)
plot!(p1,x1,y2,label=nothing)
plot!(p2,x1,y3,label=nothing)
annotate!(p1,[
(3.5,3.5+cnstslider,L"y=f(x)",:red),
(5.9,0,L"x"),
(0.2,6,L"y"),
(3.2,1+cnstslider,L"y=g(x)",:blue)
]
)
annotate!(p2,[
4.6 s

Remark

  • Area = ytopybottom.

Example 1:
Finding the Area of a Region Between Two Curves

Find the area of the region bounded above by y=ex, bounded below by y=x, bounded on the sides by x=0 and x=1.


cm"""

**Remark**
- Area = ``y_{top}-y_{bottom}``.

$(ex(1,s="Finding the Area of a Region Between Two Curves"))

Find the area of the region bounded above by ``y=e^x``, bounded below by ``y=x``, bounded on the sides by ``x=0`` and ``x=1``.

---
"""


511 μs

Solution

begin
ex1x=0:0.01:1
ex1y=exp.(ex1x)
ex1plt=plot(ex1x,ex1y,label=nothing,fill=(0,0.5,:red))
plot!(ex1plt,ex1x,ex1x,fill=(0,0,:white),label=nothing)
plot!(;p1Opt...,xlims=(-0.4,1.5),ylims=(-0.4,3.5),label=nothing,xticks=[0,0,1])
ex1Rect = Shape([(0.5,0.55),(0.55,0.55),(0.55,exp(0.55)),(0.5,exp(0.55))])
plot!(ex1Rect,label=nothing)
annotate!([ (0.77,0.6,L"y=x")
, (0.7,exp(0.7)+0.2,L"y=e^x")
, (1.1,1.7,L"x=1")
, (-0.1,0.5,L"x=0")
, (0.54,0.44,text(L"\Delta x",10))
])
md"""
**Solution**
$ex1plt
"""
end


168 ms

Area of a Region Between Intersecting Curves

In geberal,

Area=ab|f(x)g(x)|dx

md"""## Area of a Region Between Intersecting Curves

In geberal,

$p2
```math
Area = \int_a^b \left|f(x) - g(x)\right| dx
```

"""


249 μs

Example 2:
A Region Lying Between Two Intersecting Graphs

Find the area of the region enclosed by the graphs of f(x)=2x2 and g(x)=x.

Solution in class


cm"""
$(ex(2,s="A Region Lying Between Two Intersecting Graphs"))

Find the area of the region enclosed by the graphs of ``f(x)=2-x^2`` and ``g(x)=x``.

*Solution in class*

---
"""


65.0 ms

Example 3:
A Region Lying Between Two Intersecting Graphs

Find the area of the region bounded by the curves

y=cos(x),y=sin(x),x=0,x=π2

cm"""
$(ex(3,s="A Region Lying Between Two Intersecting Graphs"))

Find the area of the region bounded by the curves

```math
y=\cos(x), \;\; y=\sin(x), \;\; x=0, \;\; x=\frac{\pi}{2}
```


---
"""


308 μs

Example 4:
Curves That Intersect at More than Two Points
Find the area of the region between the graphs of

f(x)=3x3x210x,g(x)=x2+2x.
cm"""
$(ex(4,s="Curves That Intersect at More than Two Points"))
Find the area of the region between the graphs of
```math
f(x) = 3x^3-x^2 -10x, \qquad g(x)=-x^2+2x.
```
"""
417 μs

Integrating with Respect to y

begin
img1 = load(download("https://www.dropbox.com/s/r39ny15umqafmls/wrty.png?raw=1"))
img1 = imresize(img1,ratio=1.5)
md"""
__Integrating with Respect to ``y``__
$img1
"""
end


3.0 s

Example 5:
Horizontal Representative Rectangles
Find the area of the region bounded by the graphs of x=3y2 and x=y+1.

cm"""
$(ex(5,s="Horizontal Representative Rectangles"))
Find the area of the region bounded by the graphs of ``x=3-y^2`` and ``x=y+1``.
"""
310 μs

7.2: Volume: The Disk Method

Objectives

  • Find the volume of a solid of revolution using the disk method.

  • Find the volume of a solid of revolution using the washer method.

  • Find the volume of a solid with known cross sections.

The Disk Method

md"""# 7.2: Volume: The Disk Method
> __Objectives__
> - Find the volume of a solid of revolution using the disk method.
> - Find the volume of a solid of revolution using the washer method.
> - Find the volume of a solid with known cross sections.

## The Disk Method


"""
208 μs

Solids of Revolution

Volume of a disk

V=πR2w

Disk Method

Volume of solidi=1nπ[R(xi)]2Δx=πi=1n[R(xi)]2Δx

Taking the limit Δ0(n), we get

Volume of solid=limΔ0πi=1n[R(xi)]2Δx=πab[R(x)]2dx.

Disk Method

To find the volume of a solid of revolution with the disk method, use one of the formulas below

cm"""
**Solids of Revolution**
<div class="img-container">

$(Resource("https://www.dropbox.com/s/z2k777veuxiaorq/solids_of_revs.png?raw=1"))
</div>


<div class="img-container">

$(Resource("https://www.dropbox.com/s/ik73cokibh1fuj6/disk_volume.png?raw=1"))

__Volume of a disk__
```math
V = \pi R^2 w
```
</div>

<div class="img-container">

__Disk Method__

$(Resource("https://www.dropbox.com/s/odttq795nrpcznw/disk_method.png?raw=1"))
</div>

```math
\begin{array}{lcl}
\textrm{Volume of solid} & \approx &\displaystyle \sum_{i=1}^n\pi\bigl[R(x_i)\bigr]^2 \Delta x \\
1.0 ms

Example 1:
Using the Disk Method
Find the volume of the solid formed by revolving the region bounded by the graph of

f(x)=sinx

and the x-axis (0xπ) about the x-axis

cm"""
$(ex(1,s="Using the Disk Method"))
Find the volume of the solid formed by revolving the region bounded by the graph of
```math
f(x) = \sqrt{\sin x}
```
and the ``x``-axis (``0\leq x\leq \pi``) about the ``x``-axis
"""
366 μs

Example 2:
Using a Line That Is Not a Coordinate Axis
Find the volume of the solid formed by revolving the region bounded by the graphs of

f(x)=2x2

and g(x)=1 about the line y=1.

cm"""
$(ex(2,s="Using a Line That Is Not a Coordinate Axis"))
Find the volume of the solid formed by revolving the region bounded by the graphs of
```math
f(x)=2-x^2
```
and ``g(x)=1`` about the line ``y=1``.
"""
368 μs

The Washer Method

md"## The Washer Method"
135 μs

Volume of washer=π(R2r2)w

Washer Method

V=πab[(R[x])2(r[x])2)dx
cm"""
<div class="img-container">

$(Resource("https://www.dropbox.com/s/ajra8g5fr8ssewe/washer_volume.png?raw=1"))

```math
\textrm{Volume of washer} = \pi(R^2-r^2)w
```
</div>

__Washer Method__


<div class="img-container">

$(Resource("https://www.dropbox.com/s/hvwa3707bftjir0/washer_method.png?raw=1"))

```math
V = \pi\int_a^b \bigl[\left(R[x]\right)^2-\left(r[x]\right)^2) dx
```
</div>
"""
484 μs

Example 3:
Using the Washer Method
Find the volume of the solid formed by revolving the region bounded by the graphs of

y=xandy=x2

about the x-axis.

cm"""
$(ex(3,s="Using the Washer Method"))
Find the volume of the solid formed by revolving the region bounded by the graphs of
```math
y=\sqrt{x} \qquad \textrm{and}\qquad y = x^2
```
about the ``x``-axis.
"""
566 μs

Example 4:
Integrating with Respect to `y`: Two-Integral Case
Find the volume of the solid formed by revolving the region bounded by the graphs of

y=x2+1,y=0,x=0,andx=1

about the y-axis

cm"""
$(ex(4,s="Integrating with Respect to `y`: Two-Integral Case"))
Find the volume of the solid formed by revolving the region bounded by the graphs of
```math
y=x^2+1, \quad y=0, \quad x=0, \quad \textrm{and}\quad x=1
```
about the ``y``-axis
"""
425 μs

Solids with Known Cross Sections

md"## Solids with Known Cross Sections"
136 μs

Example 1 | Example 2

Volumes of Solids with Known Cross Sections

  1. For cross sections of area A(x) taken perpendicular to the x-axis,
V=abA(x)dx
  1. For cross sections of area A(y) taken perpendicular to the y-axis,
V=cdA(y)dy

Example 6:
Triangular Cross Sections
The base of a solid is the region bounded by the lines

f(x)=1x2,g(x)=1+x2andx=0.

The cross sections perpendicular to the x-axis are equilateral triangles.

cm"""

[Example 1](https://www.geogebra.org/m/XFgMaKTy) | [Example 2](https://www.geogebra.org/m/XArpgR3A)

$(bbl("Volumes of Solids with Known Cross Sections",""))
1. For cross sections of area ``A(x)`` taken perpendicular to the ``x``-axis,
```math
V = \int_a^b A(x) dx
```
2. For cross sections of area ``A(y)`` taken perpendicular to the ``y``-axis,
```math
V = \int_c^d A(y) dy
```
$(ebl())

$(ex(6,s="Triangular Cross Sections"))
The base of a solid is the region bounded by the lines
```math
f(x)=1-\frac{x}{2},\quad g(x)=-1+\frac{x}{2}\quad \textrm{and}\quad x=0.
```
The cross sections perpendicular to the ``x``-axis are equilateral triangles.
"""

401 ms

Exercise Find the volume of the solid obtained by rotating the region bounded by y=x3, y=8 , and x=0 about the y-axis.

Exercise The region R enclosed by the curves y=x and y=x2 is rotated about the x-axis. Find the volume of the resulting solid.

Exercise Find the volume of the solid obtained by rotating the region in the previous Example about the line y=2.

Exercise Find the volume of the solid obtained by rotating the region in the previous Example about the line x=1.

cm"""
**Exercise**
Find the volume of the solid obtained by rotating the region bounded by ``y=x^3``, ``y=8`` , and ``x=0`` about the ``y``-axis.

**Exercise** The region ``\mathcal{R}`` enclosed by the curves ``y=x`` and ``y=x^2`` is rotated about the ``x``-axis. Find the volume of the resulting solid.

**Exercise** Find the volume of the solid obtained by rotating the region in the previous Example about the line ``y=2``.

**Exercise** Find the volume of the solid obtained by rotating the region in the previous Example about the line ``x=-1``.

"""
222 μs

Exercise Figure below shows a solid with a circular base of radius 1. Parallel cross-sections perpendicular to the base are equilateral triangles. Find the volume of the solid.

md"""
**Exercise** Figure below shows a solid with a circular base of radius ``1``. Parallel cross-sections perpendicular to the base are equilateral triangles. Find the volume of the solid.
$(load(download("https://www.dropbox.com/s/bbxedang718jvvp/img4.png?dl=0")))
"""
2.3 s

7.3: Volume: The Shell Method

Objectives

  1. Find the volume of a solid of revolution using the shell method.

  2. Compare the uses of the disk method and the shell method.

Problem Find the volume of the solid generated by rotating the region bounded by y=2x2x3 and y=0 about the yaxis.

md"""
# 7.3: Volume: The Shell Method
> __Objectives__
> 1. Find the volume of a solid of revolution using the shell method.
> 2. Compare the uses of the disk method and the shell method.

**Problem**
Find the volume of the solid generated by rotating the region bounded by ``y=2x^2-x^3`` and ``y=0`` about the ``y-``axis.
"""
252 μs

Step 1: Step 2: Step 3:

begin
show_graph_s = @bind show_graph CheckBox()
show_rect_s = @bind show_rect CheckBox()
show_labels_s = @bind show_labels CheckBox()
md"""
Step 1: $show_graph_s
Step 2: $show_rect_s
Step 3: $show_labels_s
"""
end
32.3 ms
""
begin
f30(x)=2*x^2-x^3
s3e0= PlotData(0:0.01:2,f30)
s3e0p0 = plot(s3e0)
annotate!(s3e0p0,[(1,1.2,L"y=2x^2-x^3")])
recty=Shape([ (0.75,f30(0.75))
, (1.75,f30(0.75))
, (1.75,f30(0.75)+0.05)
, (0.75,f30(0.75)+0.05)])
ux, lx = Plots.unzip(Plots.partialcircle(0,π,100,-0.1))
plot!(ux,lx .+ 1.15,c=:red)
anns = [(0.65,f30(0.76),L"x_L=?",10),(1.88,f30(0.76),L"x_R=?",10)]
s3e0p = if show_labels
plot!(s3e0p0,recty,label=nothing)
annotate!(anns)
elseif show_rect
plot!(s3e0p0,recty,label=nothing)
elseif show_graph
else
""
end
end
248 ms

The Shell Method

md"## The Shell Method"
133 μs

A shell is a hallow circular cylinder

begin
shellImg=load(download("https://www.dropbox.com/s/8a2njc50e2hptok/shell.png?dl=0"))
md"""
A shell is a hallow circular cylinder
$shellImg

"""
end
2.1 s
V=2πrhΔr=[circumference][height][thickness]
cm"""
```math
V = 2 \pi r h \Delta r = \text{[circumference][height][thickness]}

```
"""
172 μs
Cylindrical Shells Illustration
html"""
<div style="display: flex; justify-content:center; padding:20px; border: 2px solid rgba(125,125,125,0.2);">
<div>
<h5>Cylindrical Shells Illustration</h5>
<iframe width="560" height="315" src="https://www.youtube.com/embed/JrRniVSW9tg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
"""
5.9 ms
Horizontal Axis of Revolution
Volume=V=2πcdp(y)h(y)dy

Vertical Axis of Revolution
Volume=V=2πabp(x)h(x)dx

cm"""
<div style="display: flex; justify-content: center;">
<div style="margin-right:12px;padding:4px;border: 2px solid white; border-radius: 10px;background: #eee;">
<span style="font-size:1.5M; font-weight: 800;">Horizontal Axis of Revolution</span>

```math
\text{Volume}=V = 2\pi \int_c^d p(y) h(y) dy
```
<div class="img-container">

$(Resource("https://www.dropbox.com/s/6qmijrhprht4kqj/shell_y.png?raw=1"))

</div>

</div>

<div style="margin-right:12px;padding:4px;border: 2px solid white; border-radius: 10px;background: #eee;"><span style="font-size:1.5M; font-weight: 800;">Vertical Axis of Revolution</span>

```math
\text{Volume}=V = 2\pi \int_a^b p(x) h(x) dx
```

<div class="img-container">

$(Resource("https://www.dropbox.com/s/ivbwuge5ti8vrff/shell_x.png?raw=1"))

525 μs

Example: Find the volume of the solid generated by rotating the region bounded by y=2x2x3 and y=0 about the yaxis.

Solution:

begin
s3e0p1 = plot(s3e0)
annotate!(s3e0p1,[(1,1.2,L"y=2x^2-x^3")])
plot!(s3e0p1,
Shape(
[ (1.2,0),(1.3,0),(1.3,f30(1.3)),(1.2,f30(1.3))
]
)
, label=nothing
)
md"""
**Example:**
Find the volume of the solid generated by rotating the region bounded by ``y=2x^2-x^3`` and ``y=0`` about the ``y-``axis.

Solution:
$s3e0p1
"""
end
14.2 ms

Example : Find the volume of the solid obtained by rotating about the yaxis the region between y=x and y=x2.

md"""
**Example :**
Find the volume of the solid obtained by rotating about the ``y-``axis the region between ``y=x`` and ``y=x^2``.

"""
214 μs

Example: Find the volume of the solid obtained by rotating the region bounded by y=xx2 and y=0 about the line x=2.

md"""
**Example:**
Find the volume of the solid obtained by rotating the region bounded by ``y=x-x^2`` and ``y=0`` about the line ``x=2``.

"""
188 μs

Example 4:
Shell Method Preferable
Find the volume of the solid formed by revolving the region bounded by the graphs of

y=x2+1,y=0,x=0,andx=1.

about the y-axis.

cm"""
$(ex(4,s="Shell Method Preferable"))
Find the volume of the solid formed by revolving the region bounded by the graphs of
```math
y=x^2+1, \quad y=0, \quad x=0, \quad \text{and}\quad x=1.
```
about the ``y``-axis.
"""
316 μs

Example 5:
Shell Method Necessary
Find the volume of the solid formed by revolving the region bounded by the graphs of y=x3+x+1, y=1, and x=1 about the line x=2.

cm"""
$(ex(5,s="Shell Method Necessary"))
Find the volume of the solid formed by revolving the region bounded by the graphs of ``y=x^3+x+1``, ``y=1``, and ``x=1`` about the line ``x=2``.
"""
113 ms

7.4: Arc Length and Surfaces of Revolution

Objectives

  1. Find the arc length of a smooth curve.

  2. Find the area of a surface of revolution.

Arc Length

md"""
# 7.4: Arc Length and Surfaces of Revolution
> __Objectives__
> 1. Find the arc length of a smooth curve.
> 2. Find the area of a surface of revolution.
## Arc Length
"""
200 μs

Definition
Arc Length

Let the function y=f(x) represents a smooth curve on the interval [a,b]. The arc length of f between a and b is

s=ab1+[f(x)]2dx.

Similarly, for a smooth curve x=g(y), the arc length of g between c and d is

s=cd1+[g(y)]2dy.

cm"""
$(bbl("Definition","Arc Length"))

Let the function ``y=f(x)`` represents a smooth curve on the interval ``[a,b]``. The __arc length__ of ``f`` between ``a`` and ``b`` is
```math
s = \int_a^b\sqrt{1+[f'(x)]^2} dx.
```

Similarly, for a smooth curve ``x=g(y)``, the arc length of ``g`` between ``c`` and ``d`` is
```math
s = \int_c^d\sqrt{1+[g'(y)]^2} dy.
```
$(ebl())
"""
404 μs

Example 2:
Finding Arc Length
Find the arc length of the graph of y=x36+12x on the interval [12,2].

cm"""
$(ex(2, s="Finding Arc Length"))
Find the arc length of the graph of ``y=\displaystyle \frac{x^3}{6}+\frac{1}{2x}`` on the interval ``[\frac{1}{2},2]``.
"""
284 μs

Example 3:
Finding Arc Length
Find the arc length of the graph of (y1)3=x2 on the interval [0,8].

cm"""
$(ex(3, s="Finding Arc Length"))
Find the arc length of the graph of ``\displaystyle (y-1)^3=x^2`` on the interval ``[0,8]``.
"""
296 μs

Example 4:
Finding Arc Length
Find the arc length of the graph of y=ln(cosx) from x=0 to x=π/4.

cm"""
$(ex(4, s="Finding Arc Length"))
Find the arc length of the graph of ``y=\ln(\cos x)`` from ``x=0`` to ``x=\pi/4``.
"""
389 μs

Area of a Surface of Revolution

md"## Area of a Surface of Revolution"
131 μs

Definition
Surface of Revolution

When the graph of a continuous function is revolved about a line, the resulting surface is a surface of revolution.

cm"""
$(bbl("Definition","Surface of Revolution"))
When the graph of a continuous function is revolved about a line, the resulting surface is a __surface of revolution__.
$(ebl())
"""
341 μs

Surface Area of frustum

S=2πrL,wherer=r1+r22

Consider a function f that has a continuous derivative on the interval [a,b]. The graph of f is revolved about the x-axis

Surface Area Formula

S=2πabx1+[f(x)]2dx.

Definition
Area of a Surface of Revolution

Let y=f(x) have a continuous derivative on the interval [a,b].

The area S of the surface of revolution formed by revolving the graph of f about a horizontal or vertical axis is

S=2πabr(x)1+[f(x)]2dx,y is a function of x .

where r(x) is the distance between the graph of f and the axis of revolution.

If x=g(y) on the interval [c,d] , then the surface area is

S=2πabr(y)1+[g(y)]2dy,x is a function of y .

where r(y) is the distance between the graph of g and the axis of revolution.

cm"""

<div class="img-container">

$(Resource("https://www.dropbox.com/s/199tfveph8mi2kz/surface_rev.png?raw=1"))

__Surface Area of *frustum*__
```math
S=2\pi r L, \quad \text{where}\quad r=\frac{r_1+r_2}{2}
```
</div>

Consider a function ``f`` that has a continuous derivative on the interval ``[a,b]``. The graph of ``f`` is revolved about the ``x``-axis

<div class="img-container">

$(Resource("https://www.dropbox.com/s/f454ldbfk1z3o2z/surface_rev2.png?raw=1"))

__Surface Area Formula__
```math
S=2\pi \int_a^b x \sqrt{1+[f'(x)]^2} dx.
```
</div>

$(bbl("Definition","Area of a Surface of Revolution"))
946 μs

Remark

The formulas can be written as

S=2πabr(x)ds,y is a function of x .

and

S=2πcdr(y)ds,x is a function of y .

where

ds=1+[f(x)]2dxandds=1+[g(y)]2dyrespectively.
cm"""
__Remark__

The formulas can be written as

```math
S=2\pi \int_a^b r(x) ds, \quad {\color{red} y \text{ is a function of x }}.
```
and
```math
S=2\pi \int_c^d r(y) ds, \quad {\color{red} x \text{ is a function of y }}.
```
where
```math
ds = \sqrt{1+\big[f'(x)\big]^2}dx \quad \text{and}\quad ds = \sqrt{1+\big[g'(y)\big]^2}dy \quad \text{respectively}.
"""
6.0 ms

Example 6:
The Area of a Surface of Revolution
Find the area of the surface formed by revolving the graph of f(x)=x3 on the interval [0,1] about the x-axis.

Example 7:
The Area of a Surface of Revolution
Find the area of the surface formed by revolving the graph of f(x)=x2 on the interval [0,2] about the y-axis.

cm"""
$(ex(6,s="The Area of a Surface of Revolution"))
Find the area of the surface formed by revolving the graph of ``f(x)=x^3`` on the interval ``[0,1]`` about the ``x``-axis.


$(ex(7,s="The Area of a Surface of Revolution"))
Find the area of the surface formed by revolving the graph of ``f(x)=x^2`` on the interval ``[0,\sqrt{2}]`` about the ``y``-axis.
"""

641 μs

8.1: Basic Integration Rules

Objectives

  1. Review procedures for fitting an integrand to one of the basic integration rules.

md"""# 8.1: Basic Integration Rules

> __Objectives__
> 1. Review procedures for fitting an integrand to one of the basic integration rules.

"""
165 μs

Review of Basic Integration Rules (a>0)

cm"""
<div style="background-color:#FF9733;color:white;font-weight:800;padding:2px 10px;width:350px;">

Review of Basic Integration Rules (``a>0``)
</div>
<div class="img-container">

$(Resource("https://www.dropbox.com/s/56svdxjfgowjojk/int_table.png?raw=1"))

</div>
"""
340 μs

Example 3:
Find x216x6dx.

Example 4:
A Disguised Form of the Log Rule
Find dx1+ex.

cm"""
$(ex(3,s=""))
Find ``\displaystyle \int \frac{x^2}{\sqrt{16-x^6}} dx``.

$(ex(4,s="A Disguised Form of the Log Rule"))
Find ``\displaystyle \int \frac{dx}{1+e^x} ``.

"""
488 μs

8.2: Integration by Parts

Objectives

  1. Find an antiderivative using integration by parts.

The integration rule that corresponds to the Product Rule for differentiation is called integration by parts

md"""# 8.2: Integration by Parts
> __Objectives__
> 1. Find an antiderivative using integration by parts.
*The integration rule that corresponds to the Product Rule for differentiation is called __integration by parts__*
"""
3.6 ms

Indefinite Integrals

f(x)g(x)dx=f(x)g(x)g(x)f(x)dx
cm"""
__Indefinite Integrals__
```math
\int f(x)g'\,(x) dx = f(x) g(x) - \int g(x) f'\,(x) dx
```
"""
225 μs

Theorem
Integration by Parts

If u and v are functions of x and have continuous derivatives, then

udv=uvvdu.

cm"""
$(bth("Integration by Parts"))
If ``u`` and ``v`` are functions of ``x`` and have continuous derivatives, then
```math
\int u dv = uv -\int v du.
```

$(eth())
"""
364 μs

Example 1:
Integration by Parts
Find xexdx.

Example 2:
Integration by Parts
Find x2lnxdx.

Example 3:
An Integrand with a Single Term
Evaluate 01arcsinxdx.

Example 4:
Repeated Use of Integration by Parts
Find x2sinxdx.

Example 5:
Integration by Parts
Find sec3xdx.s

Example 7:
Using the Tabular Method
Find x2sin4xdx.

cm"""
$(ex(1,s="Integration by Parts"))
Find ``\displaystyle \int x e^x dx``.

$(ex(2,s="Integration by Parts"))
Find ``\displaystyle \int x^2 \ln x dx``.

$(ex(3,s="An Integrand with a Single Term"))
Evaluate ``\displaystyle \int_0^1 \arcsin x dx``.


$(ex(4,s="Repeated Use of Integration by Parts"))
Find ``\displaystyle \int x^2 \sin x dx``.

$(ex(5,s="Integration by Parts"))
Find ``\displaystyle \int\sec^3 x dx``.s

$(ex(7,s="Using the Tabular Method"))
Find ``\displaystyle \int x^2 \sin 4x dx``.
"""
865 μs

8.3: Trigonometric Integrals

Objectives

  1. Solve trigonometric integrals involving powers of sine and cosine.

  2. Solve trigonometric integrals involving powers of secant and tangent.

  3. Solve trigonometric integrals involving sine-cosine products.

RECALL

sin2x+cos2x=1,tan2x+1=sec2x,1+cot2x=csc2x,

cos2x=1+cos2x2,sin2x=1cos2x2

sinmxsinnx=12[cos(mn)xcos(m+n)x],sinmxcosnx=12[sin(mn)x+sin(m+n)],cosmxcosnx=12[cos(mn)+cos(m+n)],

tanxdx=ln|secx|+C,secxdx=ln|secx+tanx|+C

cotxdx=ln|cscx|+C,cscxdx=ln|cscxcotx|+C

md"""# 8.3: Trigonometric Integrals
> __Objectives__
> 1. Solve trigonometric integrals involving powers of sine and cosine.
> 2. Solve trigonometric integrals involving powers of secant and tangent.
> 3. Solve trigonometric integrals involving sine-cosine products.

**RECALL**

```math



\displaystyle
\sin^2 x + \cos^2 x =1, \quad \tan^2 x + 1 =\sec^2 x, \quad 1+\cot^2 x =\csc^2 x,

```

```math
\displaystyle
\cos^2 x = \frac{1 +\cos 2x }{2}, \quad \sin^2 x = \frac{1 -\cos 2x }{2}
```

```math
\displaystyle
\begin{array}{ccc}
\sin mx\sin nx & = & \frac{1}{2}\left[\cos(m-n)x-\cos(m+n)x\right], \\[0.2cm]
\sin mx\cos nx & = & \frac{1}{2}\left[\sin(m-n)x+\sin(m+n)\right], \\[0.2cm]
287 μs

Integrals of Powers of Sine and Cosine

sinmxcosnxdx

  • m is odd, write as sinm1xcosnxsinxdx. Example: sin5xcos2xdx

  • n is odd, write as sinmxcosn1cosxdx. Example sin5xcos3xdx

  • m and n are even, use formulae (Example cos2xdx and sin4xdx)

sin2(x)=1cos(2x)2,cos2(x)=1+cos(2x)2.

md"""
## Integrals of Powers of Sine and Cosine
```math
\int \sin^mx \cos^n x dx
```

* ``m`` is ``{\color{red}\text{odd}}``, write as ``\int \sin^{m-1}x \cos^n x \sin x dx``. _Example_: $\int \sin^5x \cos^2 x dx$


* ``n`` is ``{\color{red}\text{odd}}``, write as ``\int \sin^mx \cos^{n-1}\cos x dx``. _Example_ ``\int \sin^5x \cos^3 x dx``


* ``m`` and ``n`` are ``{\color{red}\text{even}}``, use formulae (_Example_ ``\int \cos^2 x dx`` and ``\int \sin^4 x dx``)
```math
\sin^2(x)=\frac{1-\cos(2x)}{2}, \quad \cos^2(x)=\frac{1+\cos(2x)}{2}.
```
"""
620 μs

Example 1:
Power of Sine Is Odd and Positive
Find sin3xcos4xdx.

cm"""
$(ex(1,s="Power of Sine Is Odd and Positive"))
Find ``\displaystyle \int \sin^3 x \cos^4 x dx``.
"""
364 μs

Example 2:
Power of Cosine Is Odd and Positive
Evaluate π/6π/3cos3xsinxdx.

cm"""
$(ex(2,s="Power of Cosine Is Odd and Positive"))
Evaluate ``\displaystyle \int_{\pi/6}^{\pi/3}\frac{\cos^3 x}{\sqrt{\sin x}} dx``.
"""
366 μs

Example 3:
Power of Cosine Is Even and Nonnegative
Find cos4xdx.

cm"""
$(ex(3,s="Power of Cosine Is Even and Nonnegative"))
Find ``\displaystyle \int \cos^4 x dx``.
"""
308 μs

Integrals of Powers of Secant and Tangent

tanmxsecnxdx

  • n is even, write as tanmxsecn2sec2xdx. Example tan6xsec4xdx

  • m is odd, write as tanm1xsecn1tanxsecxdx. Example tan5xsec7xdx.

md"""
## Integrals of Powers of Secant and Tangent

```math
\int \tan^mx \sec^n x dx
```

* ``n`` is even, write as ``\int \tan^mx \sec^{n-2}\sec^2 x dx``. _Example_ ``\int \tan^6x \sec^4 x dx``


* ``m`` is odd, write as ``\int \tan^{m-1}x \sec^{n-1}\tan x\sec x dx``. _Example_ ``\int \tan^5x \sec^7 x dx``.


"""
381 μs

Example 4:
Power of Tangent Is Odd and Positive
Find tan3xsecxdx.

cm"""
$(ex(4,s="Power of Tangent Is Odd and Positive"))
Find ``\displaystyle \int \frac{\tan^3x}{\sqrt{\sec x}} dx``.
"""
410 μs

Example 5:
Power of Secant Is Even and Positive
Find sec43xtan33xdx.

cm"""
$(ex(5,s="Power of Secant Is Even and Positive"))
Find ``\displaystyle \int \sec^4 3x \tan^3 3x dx``.
"""
390 μs

Example 6:
Power of Tangent Is Even
Evaluate 0π/4tan4xdx.

cm"""
$(ex(6,s="Power of Tangent Is Even"))
Evaluate ``\displaystyle \int_0^{\pi/4}\tan^4 x dx``.
"""
327 μs

Example 7:
Converting to Sines and Cosines
Find secxtan2xdx.

cm"""
$(ex(7,s="Converting to Sines and Cosines"))
Find ``\displaystyle \int \frac{\sec x}{\sqrt{\tan^2 x}} dx``.
"""
303 μs

Integrals Involving Sine-Cosine Products

md"## Integrals Involving Sine-Cosine Products"
134 μs

Example 8:
Using a Product-to-Sum Formula
Find sin5xcos4xdx.

cm"""
$(ex(8,s="Using a Product-to-Sum Formula"))
Find ``\displaystyle \int \sin 5x \cos 4x dx``.
"""
390 μs

8.4: Trigonometric Substitution

Objectives

  1. Use trigonometric substitution to find an integral.

  2. Use integrals to model and solve real-life applications.

md"""
# 8.4: Trigonometric Substitution
> __Objectives__
> 1. Use trigonometric substitution to find an integral.
> 2. Use integrals to model and solve real-life applications.
"""
174 μs

Trigonometric Substitution

md"""
## Trigonometric Substitution
"""
130 μs

We use trigonometric substitution to find integrals involving the radicals

a2u2,a2+u2,u2a2.
cm"""
We use __trigonometric substitution__ to find integrals involving the radicals
```math
\sqrt{a^2-u^2},\quad \sqrt{a^2+u^2},\quad \sqrt{u^2-a^2}.
```
"""
201 μs

Example 1:
Trigonometric Substitution
Find dxx29x2.

Example 2:
Trigonometric Substitution
Find dx4x2+1.

Example 3:
Trigonometric Substitution: Rational Powers
Find dx(x2+1)3/2.

Example 4:
Converting the Limits of Integration
Find 32x23xdx.

cm"""
$(ex(1,s="Trigonometric Substitution"))
Find ``\displaystyle \int \frac{dx}{x^2\sqrt{9-x^2}}``.

$(ex(2,s="Trigonometric Substitution"))
Find ``\displaystyle \int \frac{dx}{\sqrt{4x^2+1}}``.


$(ex(3,s="Trigonometric Substitution: Rational Powers"))
Find ``\displaystyle \int \frac{dx}{(x^2+1)^{3/2}}``.


$(ex(4,s="Converting the Limits of Integration"))
Find ``\displaystyle \int_{\sqrt{3}}^{2} \frac{\sqrt{x^2-3}}{x}dx``.
"""
728 μs

Applications

md"## Applications"
131 μs

Example 5:
Finding Arc Length
Find the arc length of the graph of f(x)=12x2 from x=0 to x=1.

cm"""
$(ex(5,s="Finding Arc Length"))
Find the arc length of the graph of ``f(x)=\frac{1}{2}x^2`` from ``x=0`` to ``x=1``.


"""
304 μs

8.5: Partial Fractions

Objectives

  1. Understand the concept of partial fraction decomposition.

  2. Use partial fraction decomposition with linear factors to integrate rational functions.

  3. Use partial fraction decomposition with quadratic factors to integrate rational functions.

Partial Fractions

We learn how to integrate rational function: quotient of polunomial.

f(x)=P(x)Q(x),P,Q are polynomials

How?

STEP 0 : if degree of P is greater than or equal to degree of Q goto STEP 1, else GOTO STEP 2.

STEP 1 : Peform long division of P by Q to get

P(x)Q(x)=S(x)+R(x)Q(x)

and apply STEP 2 on R(x)Q(x).

STEP 2 : Write the partial fractions decomposition

STEP 3 : Integrate

md"""
# 8.5: Partial Fractions
> __Objectives__
> 1. Understand the concept of partial fraction decomposition.
> 2. Use partial fraction decomposition with linear factors to integrate rational functions.
> 3. Use partial fraction decomposition with quadratic factors to integrate rational functions.

## Partial Fractions

We learn how to integrate rational function: quotient of polunomial.
```math
f(x) =\frac{P(x)}{Q(x)}, \qquad P, Q \text{ are polynomials}
```
**How?**

◾ __STEP 0__ : if degree of ``P`` is greater than or equal to degree of ``Q`` goto
__STEP 1__, else GOTO __STEP 2__.

◾ __STEP 1__ : Peform long division of ``P`` by ``Q`` to get
```math
\frac{P(x)}{Q(x)} = S(x) + \frac{R(x)}{Q(x)}
```
and apply __STEP 2__ on ``\frac{R(x)}{Q(x)}``.

678 μs

Partial Fractions Decomposition

We need to write R(x)Q(x) as sum of partial fractions by factor Q(x). Based on the factors, we write the decomposition accoding to the following cases

case 1: Q(x) is a product of distinct linear factors. we write

Q(x)=(a1x+b1)(a2x+b2)(akx+bk)

then there exist constants A1,A2,,Ak such that

R(x)Q(x)=A1a1x+b1+A2a2x+b2++Akakx+bk

case 2: Q(x) is a product of linear factors, some of which are repeated. say first one

Q(x)=(a1x+b1)r(a2x+b2)(akx+bk)

then there exist constants B1,B2,Br,A2,,Ak such that

R(x)Q(x)=[B1a1x+b1+B2(a1x+b1)2+Br(a1x+b1)r]+A2a2x+b2++Akakx+bk

case 3: Q(x) contains irreducible quadratic factors, none of which is repeated. say we have (Note: the quadratic factor ax2+bx+c is irreducible if b24ac<0). For eaxmple if

Q(x)=(ax2+bx+c)(a1x+b1)

then there exist constants A,B, and C such that

R(x)Q(x)=Ax+Bax2+bx+c+Ca1x+b1

case 4: Q(x) contains irreducible quadratic factors, some of which are repeated. For example if

Q(x)=(ax2+bx+c)r(a1x+b1)

then there exist constants A1,B1,A2,B2,Ar,Br and C such that

R(x)Q(x)=[A1x+B1ax2+bx+c+A2x+B2(ax2+bx+c)2++Arx+Br(ax2+bx+c)r]+Ca1x+b1

md"""
__Partial Fractions Decomposition__

We need to write ``\frac{R(x)}{Q(x)}`` as sum of __partial fractions__ by __factor__ ``Q(x)``. Based on the factors, we write the decomposition accoding to the following cases

__case 1__: ``Q(x)`` is a product of distinct linear factors.
we write
```math
Q(x)=(a_1x+b_1)(a_2x+b_2)\cdots (a_kx+b_k)
```
then there exist constants ``A_1, A_2, \cdots, A_k`` such that
```math
\frac{R(x)}{Q(x)}= \frac{A_1}{a_1x+b_1}+\frac{A_2}{a_2x+b_2}+\cdots +\frac{A_k}{a_kx+b_k}
```

__case 2__: ``Q(x)`` is a product of linear factors, some of which are repeated.
say first one
```math
Q(x)=(a_1x+b_1)^r(a_2x+b_2)\cdots (a_kx+b_k)
```
then there exist constants ``B_1, B_2, \cdots B_r, A_2, \cdots, A_k`` such that
```math
688 μs

Example:
Partial Fractions
Write out the form of the partial fractions decomposition of the function

x3+x+1x(x1)(x+1)2(x2+x+1)(x2+4)2
cm"""
$(example("Example","Partial Fractions"))
Write out the form of the partial fractions decomposition of the function
```math
\frac{x^3+x+1}{x(x-1)(x+1)^2(x^2+x+1)(x^2+4)^2}
```
"""
326 μs

More Examples

Find

(1)1x25x+6dx.(2)5x2+20x+6x3+2x2+xdx.(3)2x34x8(x2x)(x2+4)dx.(4)8x3+13x(x2+2)2dx.(5)x3+xx1dx.(6)x2+2x12x3+3x22xdx.(7)dxx2a2, where a0(8)x42x2+4x+1x3x2x+1dx(9)2x2x+4x3+4xdx(10)4x23x+24x24x+3dx(11)1x+2x2x3x(x2+1)2dx

md"""
**More Examples**

Find
```math
\begin{array}{lll}
\text{(1)} & \displaystyle \int \frac{1}{x^2-5x+6}dx. \\
\text{(2)} &\displaystyle \int \frac{5x^2+20x+6}{x^3+2x^2+x}dx. \\
\text{(3)} &\displaystyle \int \frac{2x^3-4x-8}{(x^2-x)(x^2+4)}dx. \\
\text{(4)} &\displaystyle \int \frac{8x^3+13x}{(x^2+2)^2}dx. \\
\text{(5)} &\displaystyle \int \frac{x^3+x}{x-1}dx. \\
\text{(6)} &\displaystyle \int \frac{x^2+2x-1}{2x^3+3x^2-2x}dx. \\
\text{(7)} &\displaystyle \int \frac{dx}{x^2-a^2}, \text{ where } a\not = 0 \\
\text{(8)} &\displaystyle \int \frac{x^4-2x^2+4x+1}{x^3-x^2-x+1}dx \\
\text{(9)} &\displaystyle \int \frac{2x^2-x+4}{x^3+4x}dx \\
\text{(10)} &\displaystyle \int \frac{4x^2-3x+2}{4x^2-4x+3}dx \\
\text{(11)} &\displaystyle \int \frac{1-x+2x^2-x^3}{x(x^2+1)^2}dx \\
\end{array}
```

199 μs

Remarks

dxx2a2=12aln|xax+a|

dxx2+a2=1atan1(xa)

md"""
**Remarks**
```math
\int \frac{dx}{x^2-a^2} = \frac{1}{2a}\ln\left|\frac{x-a}{x+a}\right|
```

```math
\int \frac{dx}{x^2+a^2} = \frac{1}{a}\tan^{-1}\left(\frac{x}{a}\right)
```
"""
167 μs

Rationalizing Substitutions Find

(1)x+4xdx.(2)dx2x+3+x.

md"""
__Rationalizing Substitutions__
Find
```math
\begin{array}{lll}
\text{(1)} & \int \frac{\sqrt{x+4}}{x}dx. \\
\text{(2)} & \int \frac{dx}{2\sqrt{x+3}+\;x}. \\
\end{array}
```
"""
469 μs

8.7: Rational Functions of Sine & Cosine

Special Substitution (u=tan(x2),π<x<π) (for rational functions of sinx and cosx)

dx=21+u2du,cosx=1u21+u2,sinx=2u1+u2

(1)dx3sinx4cosx.(2)0π2sin2xdx2+cosx.

md"""
# 8.7: Rational Functions of Sine & Cosine



Special Substitution (``u = \tan \left(\frac{x}{2}\right), \quad -\pi < x < \pi``)
**(for rational functions of ``\sin x`` and ``\cos x``)**
```math
\begin{array}{lll}
dx=\frac{2}{1+u^2}du, & \cos{x}=\frac{1-u^2}{1+u^2}, & \sin{x}=\frac{2u}{1+u^2} \\
\end{array}
```
```math
\begin{array}{lll}
\text{(1)} & \displaystyle\int \frac{dx}{3\sin x - 4 \cos x}. \\
\text{(2)} & \displaystyle\int_0^{\pi\over 2} \frac{\sin 2x \;dx}{2+\cos x}. \\
\end{array}
```

"""
231 μs

8.8: Improper Integrals

Objectives

  • Evaluate an improper integral that has an infinite limit of integration.

  • Evaluate an improper integral that has an infinite discontinuity.

Do you know how to evaluate the following?

(1)11x2dx(Type 1)(2)021x1dx(Type 2)

md"""
# 8.8: Improper Integrals
> __Objectives__
> - Evaluate an improper integral that has an infinite limit of integration.
> - Evaluate an improper integral that has an infinite discontinuity.
*__Do you know how to evaluate the following?__*
```math

\begin{array}{llr}
\text{(1)} & \int_1^{\infty} \frac{1}{x^2} dx & (\text{Type 1}) \\ \\
\text{(2)} & \int_0^{2} \frac{1}{x-1} dx & (\text{Type 2}) \\ \\
\end{array}
```
"""
264 μs

Improper Integrals with Infinite Limits of Integration

md"## Improper Integrals with Infinite Limits of Integration"
134 μs

Definition of an Improper Integral of Type 1

(a) If atf(x)dx exists for every number ta, then

af(x)dx=limtatf(x)dx

provided this limit exists (as a finite number).

(b) If tbf(x)dx exists for every number tb, then

bf(x)dx=limttbf(x)dx

provided this limit exists (as a finite number).

The improper integrals af(x)dx and bf(x)dx are called convergent if the corresponding limit exists and divergent if the limit does not exist.

(c) If both af(x)dx and bf(x)dx are convergent, then we define

f(x)dx=af(x)dx+af(x)dx

In part (c) any real number can be used

cm"""
$(bbl("Definition of an Improper Integral of Type 1",""))

**(a)** If ``\int_a^t f(x) dx`` exists for every number ``t\ge a``, then
```math
\int_a^{\infty} f(x) dx = \lim_{t\to \infty} \int_a^t f(x) dx
```
provided this limit exists (as a finite number).


**(b)** If ``\int_t^b f(x) dx`` exists for every number ``t\le b``, then
```math
\int_{-\infty}^b f(x) dx = \lim_{t\to -\infty} \int_t^b f(x) dx
```
provided this limit exists (as a finite number).

The improper integrals ``\int_a^{\infty} f(x) dx`` and ``\int_{-\infty}^b f(x) dx`` are called *__convergent__* if the corresponding limit exists and *__divergent__* if the limit does not exist.

**(c)** If both ``\int_a^{\infty} f(x) dx`` and ``\int_{-\infty}^b f(x) dx`` are convergent, then we define
```math
\int_{-\infty}^{\infty} f(x) dx = \int_{-\infty}^a f(x) dx +\int_a^{\infty} f(x) dx
```
624 μs

Example: Determine whether the following integrals are convergent or divergent.

(1)11x2dx(2)11xdx(3)0exdx(4)11+x2dx

md"""
**Example:** Determine whether the following integrals are convergent or divergent.

```math
\begin{array}{ll}
\text{(1)} & \displaystyle \int_1^{\infty} \frac{1}{x^2} dx \\ \\
\text{(2)} & \displaystyle\int_1^{\infty} \frac{1}{x} dx \\ \\
\text{(3)} & \displaystyle\int_{0}^{\infty} e^{-x} dx\\ \\
\text{(4)} & \displaystyle\int_{-\infty}^{\infty} \frac{1}{1+x^2} dx\\ \\
\end{array}
```
"""
174 μs

t = 1

begin
tSlider = @bind tslider Slider(1:10000,show_value=true)
md"""
-------------

t = $tSlider
"""
end
11.7 ms
begin
pd1 = PlotData(1:0.1:10,x->1/x)
pd2 = PlotData(1:0.1:10,x->1/x^2)
int1 = round(integrate(1/x,(x,1,tslider)).n(),digits=3)
int2 = round(integrate(1/x^2,(x,1,tslider)).n(),digits=3)
pt1=tslider
pt1=L"\int_1^{%$tslider} \frac{1}{x}dx = %$int1"
pt2=L"\int_1^{%$tslider} \frac{1}{x^2}dx = %$int2"
p881 = plot(pd1,annotation=[(3.5,4.5,pt1,12)],ylims=(-1,6))
p882 = plot(pd2,annotation=[(3.5,4.5,pt2,12)],ylims=(-1,6))
plot(p881,p882,layout=@layout([a b]))
end
556 ms

p =
begin
ttSlider = @bind ttslider Slider(1:1000,show_value=true)
pSlider = @bind pslider NumberField(-10:0.1:10,default=1)
md"""
-------------
|||
|---|---|
|||
|p = $pSlider |
|||
"""
end
39.1 ms

begin
ptxt = pslider==1 ? "x" : "x^{$pslider}"
fn3(p) = p>0 ? 1/x^p : p==0 ? x : x^abs(p)
int3(p,t) = integrate(fn3(p),(x,1,oo))
pt3(t)= t<1000 ? L"\int_1^{\infty} \frac{1}{%$ptxt}dx = %$(int3(pslider,ttslider))" : L"\int_1^{\infty} \frac{1}{%$ptxt}dx = %$(int3(pslider,ttslider))"
p883=plot(-1:3;annotations=[(3,4,pt3(tt),14)], showaxis=:hide,ticks=[],label=:none,
c=:white,ylims=(3,5),size=(600,100))
md"""
-------------
$p883
"""
end
531 ms

Remark

11xpdx is convergent if p>1 and divergent if p1.
cm"""
**Remark**

```math
\int_1^{\infty} \frac{1}{x^p}dx \quad \text{ is convergent if } p > 1 \text{ and divergent if } p\leq 1.
```

"""
164 μs

Improper Integrals with Infinite Discontinuities

md"## Improper Integrals with Infinite Discontinuities"
136 μs

Definition of an Improper Integral of Type 2

(a) If f is continuous on [a,b) and is discontinuous at b, then

abf(x)dx=limtbatf(x)dx

provided this limit exists (as a finite number).

(b) If f is continuous on (a,b] and is discontinuous at a, then

abf(x)dx=limta+tbf(x)dx

provided this limit exists (as a finite number).

The improper integral abf(x)dx is called convergent if the corresponding limit exists and divergent if the limit does not exist.

(c) If f has a discontinuity at c, where a<c<b, and both acf(x)dx and cbf(x)dx are convergent, then we define

abf(x)dx=acf(x)dx+cbf(x)dx

cm"""
$(bbl("Definition of an Improper Integral of Type 2",""))

**(a)** If ``f`` is continuous on ``[a,b)`` and is discontinuous at ``b``, then

```math
\int_a^b f(x) dx = \lim_{t\to b^-} \int_a^t f(x) dx
```

provided this limit exists (as a finite number).


**(b)** If ``f`` is continuous on ``(a,b]`` and is discontinuous at ``a``, then
```math
\int_a^b f(x) dx = \lim_{t\to a^{+}} \int_t^b f(x) dx
```
provided this limit exists (as a finite number).


The improper integral ``\int_a^b f(x) dx`` is called **convergent** if the corresponding limit exists and **divergent** if the limit does not exist.

**(c)** If ``f`` has a discontinuity at ``c``, where ``a < c < b``, and both ``\int_a^c f(x) dx`` and ``\int_c^b f(x) dx`` are convergent, then we define

```math
\int_{a}^{b} f(x) dx = \int_{a}^c f(x) dx +\int_c^b f(x) dx
483 μs

Example:

(1)251x2dx(2)0311xdx(3)01lnxdx
cm"""
**Example:**
```math
\begin{array}{ll}
\text{(1)} & \int_2^5 \frac{1}{\sqrt{x-2}} dx \\ \\
\text{(2)} & \int_0^{3} \frac{1}{1-x} dx \\ \\
\text{(3)} & \int_{0}^{1} \ln x dx\\ \\
\end{array}
```


"""
180 μs

Example 9:
Doubly Improper Integral
Evaluate 0dxx(x+1)

cm"""
$(ex(9,s="Doubly Improper Integral"))
Evaluate ``\displaystyle \int_0^{\infty}\frac{dx}{\sqrt{x}(x+1)}``
"""
328 μs

9.1: Sequences

Objectives

  • Write the terms of a sequence.

  • Determine whether a sequence converges or diverges.

  • Write a formula for the th term of a sequence.

  • Use properties of monotonic sequences and bounded sequences.

Sequence: A sequence can be thought of as a list of numbers written in a definite order:

a1,a2,a3,,an,

  • a1: first term,

  • a2: second term,

  • a3: third term,

  • an: nth term,


For example:

  • 1,2,3,

  • 1,1/2,1/3,

  • 1,1,1,


Notation:

  • {a1,a2,a3,,an,}={an} or

  • {a1,a2,a3,,an,}={an}n=1

md"""
# 9.1: Sequences
> Objectives
> * Write the terms of a sequence.
> * Determine whether a sequence converges or diverges.
> * Write a formula for the th term of a sequence.
> * Use properties of monotonic sequences and bounded sequences.

__Sequence__: A sequence can be thought of as a list of numbers written in a definite order:
```math
a_1, a_2, a_3, \cdots, a_n, \cdots
```

- ``a_1``: first term,
- ``a_2``: second term,
- ``a_3``: third term,
- ``\vdots``
- ``a_n``: ``\text{n}^\text{th}`` term,


---

__For example__:
* ``1, 2, 3, \cdots``
* ``1, 1/2, 1/3, \cdots``
* ``-1, 1, -1, \cdots``

---

897 μs

More examples

  • {nn+1}

  • {(1)n(n+1)5n}

  • {n4}n=4

  • a1=1, a2=1 , an=an1+an2 (Fibonacci sequence)

md"""
__More examples__

- ``\left\{\frac{n}{n+1}\right\}``
- ``\left\{\frac{(-1)^n(n+1)}{5^n}\right\}``
- ``\left\{\sqrt{n-4}\right\}_{n=4}^{\infty}``
- ``a_1=1$, $a_2=1$ , $a_n=a_{n-1}+a_{n-2}`` (__Fibonacci sequence__)
"""
446 μs

n =

n91Slider = @bind n91slider NumberField(1:1000);md"n = $n91Slider"
841 μs
begin
a91(n) = n/(n+1)
d91=1:n91slider
plt91 = scatter(a91.(d91), zeros(10),
frame_style=:origin,
ylimits=(-0.1,1),
xlimits=(0.2,1.2),
yaxis=nothing,
label=L"a_n=\frac{n}{n+1}",
showaxis=:x,
legend=:topleft,
title_location=:left,
grid=:none,
title="Example 1"
)
annotate!(plt91,[(0.4,0.5,L"a_{%$n91slider}=\frac{%$n91slider}{%$(1+n91slider)}=%$(round(a91(n91slider),digits=6))")])
if (n91slider>=99)
lens!(plt91,[0.99, 1.001], [-0.1,1.1], inset = (1, bbox(0.6, 0.0, 0.4, 0.5)),
yaxis=nothing,
frame_style=:origin,
showaxis=:x,
grid=:none,
annotations=[(0.998,0.3,"Zoom",7)]
)
end
md"""
$plt91
"""
413 ms

Visualization

  1. On a number line (as above)

  2. By plotting graph

md"""
__Visualization__

1. On a number line (as above)
2. By plotting graph

"""
305 μs

n =

n92Slider = @bind n92slider NumberField(1:1000);md"n = $n92Slider"
688 μs
begin
d92=1:n92slider
plt92 = scatter(d92, a91.(d92),
frame_style=:origin,
ylimits=(-0.1,1.6),
xlimits=(-0.1,200),
label=L"a_n=\frac{n}{n+1}",
legend=:topleft,
title_location=:left,
title="Example 1 (Graph)"
)
annotate!(plt92,[(100,0.5,L"a_{%$n92slider}=\frac{%$n92slider}{%$(1+n92slider)}=%$(round(a91(n92slider),digits=6))")])
# if (n92slider>=10)
# lens!(plt92,[n92slider-20.1, n92slider+20.1], [0.9,1.01],
# inset = (1, bbox(0.6, -0.1, 0.4, 0.4)),
# grid=:none,
# )
# end
md"""
$plt92
"""
end
64.8 ms

n =

n93Slider = @bind n93slider NumberField(1:1000);md"n = $n93Slider"
707 μs
begin
a93(n)= (-1)^n * (n+1)/5^n
d93=1:n93slider
plt93 = scatter(d93, a93.(d93),
frame_style=:origin,
ylimits=(-1,1),
xlimits=(-0.1,200),
label=L"a_n=\frac{(-1)^n\cdot(n+1)}{5^n}",
legend=:topleft,
title_location=:left,
title="Example 2 (Graph)"
)
annotate!(plt93,[(100,0.5,L"a_{%$n93slider}=\frac{%$((-1)^n93slider) \cdot %$(1+n93slider)}{5^{%$(n93slider)}}=%$(round(a93(n93slider),digits=6))")])
# if (n2slider>=10)
# lens!(plt2,[n2slider-20.1, n2slider+20.1], [0.9,1.01],
# inset = (1, bbox(0.6, -0.1, 0.4, 0.4)),
# grid=:none,
# )
# end
md"""
$plt93
"""
end
99.0 ms

n =

n94Slider = @bind n94slider NumberField(4:1000);md"n = $n94Slider"
688 μs
begin
a94(n)= sqrt(n-4)
d94=4:n94slider
plt94 = scatter(d94, a94.(d94),
frame_style=:origin,
ylimits=(-1,100),
label=L"a_n=\frac{n-4}",
legend=:topleft,
title_location=:left,
title="Example 3 (Graph)"
)
if (n94slider<100)
xlims!(plt94,-0.1,100),
annotate!(plt94,
[(50,50,
L"a_{%$n94slider}=\sqrt{%$(n94slider-4)}=%$(round(a94(n94slider),digits=6))")
]
)
elseif (n94slider>100 && n94slider<=500)
xlims!(plt94,-0.1,500),
annotate!(plt94,
[(250,50,
L"a_{%$n94slider}=\sqrt{%$(n94slider-4)}=%$(round(a94(n94slider),digits=6))")
]
)
else
xlims!(plt94,-0.1,1000),
annotate!(plt94,
[(500,50,
329 ms

What are trying to study?

  • convergence (what happended when n gets larger and larger n)

For Example 1: an=nn+1, it is fair to say and write

limnnn+1=1

md"""
#### What are trying to study?

* __convergence__ (what happended when $n$ gets larger and larger $n\to \infty$)

For **_Example 1_**: ``a_n=\frac{n}{n+1}``, it is fair to say and write
```math
\lim_{n\to \infty}\frac{n}{n+1} =1
```
"""
4.1 ms

ϵ =n =

begin
n95Slider = @bind n95slider NumberField(1:1000)
epsSlider = @bind epsslider NumberField(0:0.01:1, default=1)
md"""
----
|||
|---|---|
|``\epsilon`` =$epsSlider | n = $n95Slider |
----
"""
end
1.3 ms
begin
d95=1:n95slider
plt95 = scatter(d95, a91.(d95),
frame_style=:origin,
ylimits=(-0.1,3),
xlimits=(-0.1,100),
label=L"a_n=\frac{n}{n+1}",
legend=:topleft,
title_location=:left,
title="Example 1 (Graph)"
)
annotate!(plt95,
[
(50,0.5,
L"a_{%$n95slider}=\frac{%$n95slider}{%$(1+n95slider)}=%$(round(a91(n95slider),digits=6))"
)
,(20,1+epsslider+0.1, L"L+\epsilon")
,(20,1-epsslider-0.1, L"L-\epsilon")
]
)
plot!(plt95,
[x->1,x->1-epsslider,x->1+epsslider],
labels=:none
)

md"""
$plt95
"""
end
1.3 s

Example

{(1)n}={1,1,1,1,1,1,}

md"""
**Example**

```math
\{(-1)^n\} = \{-1, 1, -1, 1, -1, 1, \cdots\}
```
"""
193 μs

ϵ =n =
L=

begin
n96Slider = @bind n96slider NumberField(1:100)
eps2Slider = @bind eps2slider NumberField(0:0.01:2, default=0)
limitSlider = @bind limitslider NumberField(-2:0.1:2, default=0)
md"""
----
|||
|---|---|
|``\epsilon`` =$eps2Slider | n = $n96Slider |
|``L =`` $limitSlider | |
----
"""
end
2.4 ms
begin
a96(n)=iseven(n) ? 1 : -1
d96=1:n96slider
plt96 = scatter(d96, a96.(d96),
frame_style=:origin,
ylimits=(-2,2),
xlimits=(-0.1,100),
label=L"a_n=(-1)^n",
legend=:topleft,
title_location=:left,
title="Example "
)
annotate!(plt96,
[
(50,
1.5,
L"a_{%$n96slider}=%$(a96(n96slider))"
)
,(20,limitslider+eps2slider+0.1, L"L+\epsilon")
,(20,limitslider-eps2slider-0.1, L"L-\epsilon")
]
)
plot!(plt96,
labels=:none
)

md"""
$plt96
"""
end
460 ms

Remark:

limn(1)nDNE

md"""
**Remark**:

```math
\lim_{n\to \infty}(-1)^n \quad \text{DNE}
```

"""
166 μs

Limit of a Sequence

md"## Limit of a Sequence"
134 μs

Definition of the Limit of a Sequence

Let L be a real number. The limit of a sequence {an}isL``, written as

limnan=L

if for each ϵ>0, there exists M>0 such that |anL|<ϵ whenever n>M. If the limit L of a sequence exists, then the sequence converges to L. If the limit of a sequence does not exist, then the sequence diverges.

cm"""
$(bbl("Definition of the Limit of a Sequence",""))

Let ``L`` be a real number. The __limit__ of a sequence ``\{a_n\} is ``L``, written as
```math
\lim_{n\to\infty} a_n = L
```
if for each ``\epsilon >0``, there exists ``M>0`` such that ``|a_n-L|<\epsilon`` whenever ``n>M``. If the limit ``L`` of a sequence exists, then the sequence __converges__ to ``L``. If the limit of a sequence does not exist, then the sequence __diverges__.

$(ebl())
"""
390 μs

Theorem
Limit of a Sequence

If

limxf(x)=Landf(n)=anwhenn is an integer,

then

limnan=L.

  • Remark
limn1nr=0ifr>0
cm"""
$(bth("Limit of a Sequence"))
If
```math
\lim_{x\to\infty}f(x)=L \quad \text{and}\quad f(n)=a_n \quad \text{when} \; n \text{ is an integer},
```
then
```math
\lim_{n\to\infty}a_n=L.
```
$(eth())
* **Remark**
```math
\lim_{n\to\infty} \frac{1}{n^r} = 0 \quad \text{if} \quad r>0
"""
513 μs

Limit Laws for Sequences Suppose that {an} and {bn} are convergent sequences and c is a constant. Then

  1. Sum Law

limn(an+bn)=limnan+limnbn

  1. Difference Law

limn(anbn)=limnanlimnbn

  1. Constant Multiple Law

limncan=climnan

  1. Product Law

limn(anbn)=limnanlimnbn

  1. Quotient Law

limnanbn=limnanlimnbn,if limnbn0

md"""
**_Limit Laws for Sequences_**
Suppose that ``\{a_n\}`` and ``\{b_n\}`` are convergent sequences and ``c`` is a constant. Then

1. **Sum Law**
```math
\lim_{n\to\infty} \left(a_n+b_n\right)=\lim_{n\to\infty} a_n+\lim_{n\to\infty}b_n
```

2. **Difference Law**
```math
\lim_{n\to\infty} \left(a_n-b_n\right)=\lim_{n\to\infty} a_n-\lim_{n\to\infty}b_n
```

3. **Constant Multiple Law**
```math
\lim_{n\to\infty} c a_n=c\lim_{n\to\infty} a_n
```

4. **Product Law**
```math
\lim_{n\to\infty} \left(a_nb_n\right)=\lim_{n\to\infty} a_n\cdot\lim_{n\to\infty}b_n
```

5. **Quotient Law**

```math
\lim_{n\to\infty} \frac{a_n}{b_n}=\frac{\lim_{n\to\infty} a_n}{\lim_{n\to\infty}b_n}, \quad \text{if } \lim_{n\to\infty}b_n\not=0
691 μs

Power Law

limnanp=[limnan]p

Squeeze Theorem for Sequences

If anbncn for nn0 and limnan=limncn=L, then

limnbn=L.

Theorem

If

limn|an|=0,

then

limnan=0.

md"""
**Power Law**
```math
\lim_{n\to\infty} a^p_n=\left[\lim_{n\to\infty} a_n\right]^p
```
**Squeeze Theorem for Sequences**

If ``a_n\leq b_n\leq c_n`` for ``n\geq n_0`` and ``\lim_{n\to\infty}a_n=\lim_{n\to\infty}c_n=L``, then
```math
\lim_{n\to\infty}b_n=L.
```

**_Theorem_**

If
```math
\lim_{n\to\infty}|a_n|=0,
```
then
```math
\lim_{n\to\infty}a_n=0.
```
"""
579 μs

Theorem

If limnan=L and the function f is continuous at L, then

limnf(an)=f(L).

md"""
**_Theorem_**

If ``\lim_{n\to\infty}a_n=L`` and the function ``f`` is continuous at ``L``, then
```math
\lim_{n\to\infty}f(a_n)=f(L).
```

"""
261 μs

Remark

The sequence {rn} is convergent if 1<r1 and divergent for all other values of r.

limnrn={0if1<r<1,1ifr=1

md"""
**Remark**

The sequence ``\{r^n\}`` is convergent if ``-1<r\leq 1`` and divergent for all other values of ``r``.
```math
\lim_{n\to\infty}r^n=\left\{\begin{array}{lll}
0 & \text{if} & -1<r<1,\\ \\
1 & \text{if} & r=1
\end{array}
\right.
```

"""
250 μs

Examples

Find

  1. limn(1+1n)n.

  2. limnn22n1.

  3. limnnn+1.

  4. limnnn+1.

  5. limnlnnn.

  6. limn(1)nn.

  7. limnsin(π/n).

  8. limnn!nn.

  9. limn(1)nn!.

Exercise

limnnnn!.

md"""
**Examples**

Find
1. ``\lim_{n\to \infty}\left(1+\frac{1}{n}\right)^n.``
1. ``\lim_{n\to \infty}\frac{n^2}{2^n-1}.``
1. ``\lim_{n\to \infty}\frac{n}{n+1}.``
2. ``\lim_{n\to \infty}\frac{n}{\sqrt{n+1}}.``
3. ``\lim_{n\to \infty}\frac{\ln n}{n}.``
4. ``\lim_{n\to \infty}\frac{(-1)^n}{n}.``
5. ``\lim_{n\to \infty}\sin\left(\pi/n\right).``
6. ``\lim_{n\to \infty}\frac{n!}{n^n}.``
6. ``\lim_{n\to \infty}\frac{(-1)^n}{n!}.``


**Exercise**

```math
\lim_{n\to \infty}\frac{n^n}{n!}.
```
"""
1.1 ms

Pattern Recognition for Sequences

Example

Find a sequence {an} whose first five terms are

21,43,85,167,329,

and then determine whether the sequence you have chosen converges or diverges.

Example

Find a sequence {an} whose first five terms are

21,82,266,8024,242120,

and then determine whether the sequence you have chosen converges or diverges.

md"""
## Pattern Recognition for Sequences

__Example__

Find a sequence ``\{a_n\}`` whose first five terms are
```math
\frac{2}{1},\frac{4}{3},\frac{8}{5},\frac{16}{7},\frac{32}{9},\cdots
```
and then determine whether the sequence you have chosen converges or diverges.


__Example__

Find a sequence ``\{a_n\}`` whose first five terms are
```math
-\frac{2}{1},\frac{8}{2},-\frac{26}{6},\frac{80}{24},-\frac{242}{120},\cdots
```
and then determine whether the sequence you have chosen converges or diverges.

"""
531 μs

Monotonic and Bounded Sequences

Definition

  • A sequence {an} is called increasing if an<an+1 for all n1, that is,a1<a2<a3< .

  • It is called decreasing if an>an+1 for all n1.

  • A sequence is called monotonic if it is either increasing or decreasing.

md"""
## Monotonic and Bounded Sequences

**_Definition_**

* A sequence ``\{a_n\}`` is called **increasing** if ``a_n<a_{n+1}`` for all ``n\geq 1``, that is,``a_1<a_2<a_3<\cdots`` .
* It is called **decreasing** if ``a_n>a_{n+1}`` for all ``n\geq 1``.
* A sequence is called **monotonic** if it is either increasing or decreasing.
"""
520 μs

Examples

Is the following increasing or decreasing?

  1. {3n+5}.

  2. {nn2+1}.

md"""
**Examples**

Is the following increasing or decreasing?
1. ``\left\{\frac{3}{n+5}\right\}``.
2. ``\left\{\frac{n}{n^2+1}\right\}``.
"""
322 μs

Definition

A sequence {an} is bounded above if there is a number M such that

anMfor all n1

A sequence is bounded below if there is a number m such that

manfor all n1

If a sequence is bounded above and below, then it is called a bounded sequence.


Monotonic Sequence Theorem

Every bounded, monotonic sequence is convergent.

In particular, a sequence that is increasing and bounded above converges, and a sequence that is decreasing and bounded below converges.

md"""
**Definition**

A sequence ``\{a_n\}`` is **bounded above** if there is a number ``M`` such that

```math
a_n\leq M\quad \text{for all } n\geq 1
```

A sequence is **bounded below** if there is a number ``m`` such that

```math
m\leq a_n\quad \text{for all } n\geq 1
```

If a sequence is bounded above and below, then it is called a **bounded sequence**.

---

**_Monotonic Sequence Theorem_**

Every bounded, monotonic sequence is convergent.

In particular, a sequence that is increasing and bounded above converges, and a sequence that is decreasing and bounded below converges.
"""

696 μs

Example

a1=2,an+1=12(an+6),for n=1,2,3,

md"""
**Example**

```math
a_1 =2 , \quad a_{n+1}={1\over 2}\left(a_n+6\right), \quad \text{for }n=1,2,3, \cdots
```

"""
180 μs

9.2: Series and Convergence

Objectives

  • Understand the definition of a convergent infinite series.

  • Use properties of infinite geometric series.

  • Use the th-Term Test for Divergence of an infinite series.

md"""
# 9.2: Series and Convergence
> __Objectives__
> - Understand the definition of a convergent infinite series.
> - Use properties of infinite geometric series.
> - Use the th-Term Test for Divergence of an infinite series.
"""
231 μs
# begin
# n98Slider = @bind n98slider Slider(1:1000,show_value=true)
# md"""
# ----
# ||
# |---|
# |n = $n98Slider |
# ----
# """
# end
6.3 μs

Infinite Series

md"## Infinite Series"
145 μs

Consider the sequence {an}n=1. The expression

a1+a2+a3+

is called an infinite series (or simply series) and we use the notation

n=1anoran

To make sense of this sum, we define a related sequence called the sequence of partial sums {sn}n=1 as

s1=a1s2=a1+a2s3=a1+a2+a3sn=a1+a2++an=i=1nai

and give the following definition

md"""

Consider the sequence ``\left\{a_n\right\}_{n=1}^{\infty}``. The expression
```math
a_1 + a_2 + a_3 +\cdots
```
is called an __infinite series__ (or simply __series__) and we use the notation

```math
\sum_{n=1}^{\infty}a_n \qquad \text{or} \qquad \sum a_n
```

To make sense of this sum, we define a related __sequence__ called the sequence of __partial sums__ ``\left\{s_n\right\}_{n=1}^{\infty}`` as
```math
\begin{array}{lll}
s_1 & = & a_1 \\
s_2 & = & a_1 + a_2 \\
s_3 & = & a_1 + a_2 + a_3\\
\vdots \\
s_n & = & a_1 + a_2 + \cdots + a_n =\sum_{i=1}^n a_i \\
\vdots
\end{array}
```
and give the following definition
"""
415 μs

Definition

Given a series n=1an=a1+a2+a3+ , let sndenote its nth partial sum:

sn=i=1nai=a1+a2++an

If the sequence {sn} is convergent and limnsn=s exists as a real number, then the anseries is called convergent and we write

n=1an=a1+a2+a3+=s

The number s is called the sum of the series.

If the sequence {sn} is divergent, then the series is called divergent.

Remark

n=1an=limnsn=limni=1nai

md"""
**Definition**

Given a series ``\sum_{n=1}^{\infty}a_n=a_1+a_2+a_3+\cdots`` , let ``s_n``denote its ``n``th partial sum:
```math
s_n=\sum_{i=1}^{n}a_i = a_1+a_2+\cdots + a_n
```
If the sequence ``\{s_n\}`` is convergent and ``\lim_{n\to \infty}s_n=s`` exists as a real number, then the ``\sum a_n``series is called __convergent__ and we write
```math
\sum_{n=1}^{\infty}a_n=a_1+a_2+a_3+\cdots =s
```

The number ``s`` is called the __sum__ of the series.

If the sequence ``\{s_n\}`` is divergent, then the series is called __divergent__.

**Remark**
```math
\sum_{n=1}^{\infty}a_n=\lim_{n\to\infty}s_n=\lim_{n\to\infty}\sum_{i=1}^{n}a_i
```

"""
473 μs

Exercise Assume that {an}n=1 is a sequence.

  1. Find

n=1an if sn=i=1nai=n+23n5

  1. Can you find an?

md"""
**Exercise**
Assume that ``\left\{a_n\right\}_{n=1}^{\infty}`` is a sequence.
1. Find
```math
\sum_{n=1}^{\infty} a_n \quad \text{ if }\quad s_n = \sum_{i=1}^{n} a_i = \frac{n+2}{3n-5}
```
2. Can you find ``a_n``?

"""
333 μs

Solution

  1. We find first

limnsn=limnn+23n5=13

since the sequence {sn} converges to 13, then the series converges and its sum is

n=1an=13

  1. Note that

an=snsn1=n+23n5(n1)+23(n1)5=n+23n5n+13n8=(n+2)(3n8)(n+1)(3n5)(3n5)(3n8)

so,

an=11(3n5)(3n8)

md"""
__Solution__

1. We find first
```math
\lim_{n\to \infty}s_n =\lim_{n\to \infty}\frac{n+2}{3n - 5} = \frac{1}{3}
```
since the sequence ``\{s_n\}`` converges to ``1 \over 3``, then the series converges and its sum is
```math
\sum_{n=1}^{\infty} a_n = \frac{1}{3}
```

2. Note that
```math
\begin{array}{lll}
a_n &=& s_n - s_{n-1} = \frac{n+2}{3n - 5} - \frac{(n-1)+2}{3(n-1) - 5}\\
&=&\frac{n+2}{3n - 5}- \frac{n+1}{3n - 8} \\
&=& \frac{(n+2)(3n-8)- (n+1)(3n - 5)}{(3n - 5)(3n-8)}
\end{array}
```
so,
```math
a_n = \frac{-11}{(3n - 5)(3n-8)}
```
"""
394 μs

Telescoping sum

Find the sum of the following series

n=11n(n+1)

Solution in class


md"""
### Telescoping sum
Find the sum of the following series
```math
\sum_{n=1}^{\infty} \frac{1}{n(n+1)}
```
__Solution in class__

---
"""
3.8 ms

Recall

limnrn={0if|r|<1(1<r<1),1ifr=1,

So {rn} converges if r(1,1] and diverges otherwise

md"""
**Recall**

```math
\lim_{n\to \infty} r^n =\left\{\begin{array}{lll}
0 & \text{if} & |r|<1 (-1<r<1),\\
1 & \text{if} & r=1 ,\\
\end{array}\right.
```

So ``\{r^n\}`` converges if ``r\in (-1,1]`` and diverges otherwise

"""
241 μs

Geometric Series

The series

a+ar+ar2+=n=1arn1,a0

is called the geometric series with common ration r

It is convergent if |r|<1 and its sum is

n=1arn1=a1r,|r|<1

and divergent if |r|1.

Remark In words: the sum of a convergent geometric series is

first term1common ratio

md"""
## Geometric Series
The series
```math
a + a r + a r^2 + \cdots =\sum_{n=1}^{\infty}ar^{n-1}, \qquad a\not = 0
```
is called the __geometric series__ with __common ration__ ``r``

It is convergent if ``|r|< 1`` and its sum is
```math
\sum_{n=1}^{\infty}ar^{n-1} =\frac{a}{1-r}, \qquad |r|<1
```
and divergent if ``|r|\geq 1``.

**Remark**
In words: the sum of a convergent geometric series is
```math
\frac{\text{first term}}{1-\text{common ratio}}
```

"""
431 μs

Examples

  1. Find the sum of the geomtric series

43+942716+

  1. Is the series

n=122n31nconvergent or divergent?

  1. Write 2.7¯ as rational number (ratio of integers).

  2. Find the sum of the series

n=0xnwhere|x|<1.

md"""
**_Examples_**
1. Find the sum of the geomtric series
```math
4 - 3 + {9\over 4} - {27 \over 16} + \cdots
```
2. Is the series
```math
\sum_{n=1}^{\infty} 2^{2n}\; 3^{1-n} \quad \text{convergent or divergent?}
```
3. Write ``2.\bar{7}`` as rational number (ratio of integers).
4. Find the sum of the series
```math
\sum_{n=0}^{\infty} x^n \quad \text{where}\quad |x|<1.
```

"""
480 μs

Test for Divergence

Example Show that the harmonic series

n=11n=1+12+13+14+

is divergent.

md"""
## Test for Divergence
**Example**
Show that the harmonic series
```math
\sum_{n=1}^{\infty}\frac{1}{n} = 1 + \frac{1}{2}+ \frac{1}{3}+ \frac{1}{4}+\cdots
```
is divergent.

"""
234 μs

Theorem If the series

n=1an

converges, then

limnan=0.

Proof

an=snsn1


Divergence Test

If limnan0or limnan DNE then the series n=1an is divergenet


Example

The series n=1n2+12n2+5is divergent.


md"""
**_Theorem_**
If the series
```math
\sum_{n=1}^{\infty}a_n
```
converges, then
```math
\lim_{n\to \infty}a_n = 0.
```

__Proof__

```math
a_n = s_n - s_{n-1}
```

---

**_Divergence Test_**
```math
\text{If }\lim_{n\to \infty}a_n \not= 0 \quad \text{or } \lim_{n\to \infty}a_n \text{ DNE}\quad \text{ then the series }\quad
\sum_{n=1}^{\infty}a_n \text{ is divergenet}
```

---

**_Example_**

```math
\text{The series }\quad \sum_{n=1}^{\infty}\frac{n^2+1}{2n^2+5} \quad \text{is divergent.}
```
---

"""
530 μs

Properties of Convergent Series

Theorem If an and bn are convergent series, then so are the series can (where c is a constant), (an+bn), and (anbn), and

(i)n=1can=cn=1an(ii)n=1(an+bn)=n=1an+n=1bn(iii)n=1(anbn)=n=1ann=1bn

md"""
### Properties of Convergent Series

**_Theorem_**
If ``\sum a_n`` and ``\sum b_n`` are convergent series, then so are the series ``\sum ca_n`` (where ``c`` is a constant), ``\sum (a_n+b_n)``, and ``\sum (a_n-b_n)``, and

```math
\begin{array}{llcl}
\text{(i)} & \sum_{n=1}^{\infty} c a_n &=& c\sum_{n=1}^{\infty} a_n \\ \\
\text{(ii)} & \sum_{n=1}^{\infty} \left(a_n+b_n\right) &=& \sum_{n=1}^{\infty} a_n+\sum_{n=1}^{\infty} b_n \\ \\
\text{(iii)} & \sum_{n=1}^{\infty} \left(a_n-b_n\right) &=& \sum_{n=1}^{\infty} a_n-\sum_{n=1}^{\infty} b_n \\ \\ \end{array}
```
"""
270 μs

Remark

If it can be shown that

n=100an

is convergent. Then

n=1an

is convergent.

md"""
---

**_Remark_**

If it can be shown that
```math
\sum_{n=100}^{\infty}a_n
```
is convergent. Then
```math
\sum_{n=1}^{\infty}a_n
```
is convergent.

"""
285 μs

9.3: The Integral Test and p-Series

Objectives

  • Use the Integral Test to determine whether an infinite series converges or diverges.

  • Use properties of -series and harmonic series.

The Integral Test and Estimates of Sums

Suppose f a function that is

  1. continuous on [1,),

  2. positive on [1,),

  3. decreasing on [1,)

and let an=f(n). Then the series

n=1an

is convergent if and only if the improper integral

1f(x)dx

is convergent. In other words:

  1. If 1f(x)dx is convergent, then is n=1an convergent.

  2. If 1f(x)dx is divergent, then is n=1an divergent.

Examples

Test for convergence

n=11n2,n=11n

Solution in class

md"""
# 9.3: The Integral Test and $p$-Series
> __Objectives__
> - Use the Integral Test to determine whether an infinite series converges or diverges.
> - Use properties of -series and harmonic series.

**The Integral Test and Estimates of Sums**

Suppose ``f`` a function that is
1. continuous on ``[1, \infty)``,
2. positive on ``[1, \infty)``,
3. decreasing on ``[1, \infty)``

and let ``a_n=f(n)``. Then the series
```math
\sum_{n=1}^{\infty}a_n
```
is convergent if and only if the improper integral
```math
\int_1^\infty f(x) dx
```
is convergent. In other words:
1. If ``\displaystyle\int_1^\infty f(x) dx`` is convergent, then is ``\displaystyle\sum_{n=1}^{\infty}a_n`` convergent.
2. If ``\displaystyle\int_1^\infty f(x) dx`` is divergent, then is ``\displaystyle\sum_{n=1}^{\infty}a_n`` divergent.

853 μs

Remark

The series n=11n2 is convergent but n=11n21.

It sum is actually equal to n=11n2=π26

md"""
**_Remark_**
```math
\text{The series } \sum_{n=1}^{\infty}\frac{1}{n^2} \text{ is convergent but }
\sum_{n=1}^{\infty}\frac{1}{n^2}\not=1.
```
```math
\text{It sum is actually equal to }
\sum_{n=1}^{\infty}\frac{1}{n^2}=\frac{\pi^2}{6}
```

"""
205 μs

P-series and the Harmonic Series

The pseriesn=11npis convergent if p>1 and is divergent if p1.


  1. n=11n13 is divergent; because it is a pseries with p=13<1.

  2. n=11n3 is convergent; because it is a pseries with p=3>1.

Example

Show that

n=1lnnn

is divergent.

md"""
## P-series and the Harmonic Series
```math
\text{The } p-\text{series}\quad \sum_{n=1}^{\infty}\frac{1}{n^p}
\quad \text{is convergent if } p>1 \text{ and is divergent if } p\leq 1.
```

---
1. ``\sum_{n=1}^{\infty}\frac{1}{n^{1\over 3}}`` is divergent; because it is a ``p-``series with ``p={1\over 3}<1``.
2. ``\sum_{n=1}^{\infty}\frac{1}{n^{3}}`` is convergent; because it is a ``p-``series with ``p={3}>1``.

**_Example_**

Show that
```math
\sum_{n=1}^{\infty}\frac{\ln n}{n}
```
is divergent.
"""
460 μs

Estimating the Sum of a Series

Suppose that the integral test is used to show that

n=1an

is convergent. So its sequenc of partial sums {sn=i=1nai} is convergent; that is

limnsn=s.

So we can write

n=1ans=i=1naisn+i=n+1aiRn

Rn is the Remainder or the error when sn is used to approximate s.

md"""
## Estimating the Sum of a Series
Suppose that the __integral test__ is used to show that
```math
\sum_{n=1}^{\infty}a_n
```
is __convergent__. So its sequenc of partial sums ``\left\{s_n=\sum_{i=1}^n a_i\right\}`` is convergent; that is
```math
\lim_{n\to\infty}s_n=s.
```
So we can write
```math
\underset{s}{\underbrace{\sum_{n=1}^{\infty}a_n}} =
\underset{s_n}{\underbrace{\sum_{i=1}^{n}a_i}} + \underset{R_n}{\underbrace{\sum_{i=n+1}^{\infty}a_i}}
```
``R_n`` is the __Remainder__ or the error when ``s_n`` is used to approximate ``s``.
"""

392 μs

Rn=an+1+an+2+an+3+nf(x)dx

Rn=an+1+an+2+an+3+n+1f(x)dx

begin
estF(x) = (sqrt(x)/x+1)
estR=0:0.1:10
estPltstr=(
label=:none,
annotations=[(1,4,L"y=f(x)")],
xlims=(-1,10),
aspect_ratio=1,
frame_style=:origin,
xticks=(1:10,[L"n",[L"n+{%$i}" for i in 1:10]...])
)

gvmePlt(x,y,o)=plot(x,y;o...)
rct(i) =Shape([(i,0),(i+1,0),(i+1,estF(i+1)),(i,estF(i+1))])
rct2(i) =Shape([(i,0),(i+1,0),(i+1,estF(i)),(i,estF(i))])
estP1= plot!(estP,[rct(i) for i in 1:10],c=palette(:BuGn_7)[3], label=:none)
plot!(estP2,[rct2(i) for i in 2:10],c=palette(:BuGn_7)[3], label=:none)
annotate!(estP,[(i+0.5,0.8,L"a_{n+%$i}",10) for i in 1:9])
annotate!(estP2,[(i+0.5,0.8,L"a_{n+%$(i-1)}",10) for i in 2:9])
# palette([:purple, :green], 7)[1]
md"""
$estP1
```math
625 ms
1/200, 1/242
13.7 μs

Remainder Estimate for the Integral Test Suppose f(k)=ak, where f is a continuous, positive, decreasing function for xn and an is convergent. If Rn=ssn, then

n+1f(x)dxRnnf(x)dx

md"""
**_Remainder Estimate for the Integral Test_**
Suppose ``f(k)=a_k``, where ``f`` is a continuous, positive, decreasing function for ``x\geq n`` and ``\sum a_n`` is convergent. If ``R_n=s-s_n``, then

```math
\int_{n+1}^{\infty} f(x) dx \leq R_n \leq \int_n^{\infty} f(x) dx
```

"""
238 μs

9.4: Comparisons of Series

Objectives

  • Use the Direct Comparison Test to determine whether a series converges or diverges.

  • Use the Limit Comparison Test to determine whether a series converges or diverges.

The Comparison Tests

The Direct Comparison Test

Suppose that an and bn are series with positive terms.

  • If bn is convergent and anbn for all n, then an is also convergent.

  • If bn is divergent and anbn for all n , then is an also divergent


Remarks

  • Most of the time we use one of these series:

    • pseries 1np

    • geometric series.

md"""
# 9.4: Comparisons of Series
> __Objectives__
> - Use the Direct Comparison Test to determine whether a series converges or diverges.
> - Use the Limit Comparison Test to determine whether a series converges or diverges.

**The Comparison Tests**

### The Direct Comparison Test

Suppose that ``\sum a_n`` and ``\sum b_n`` are series with positive terms.

* If ``\sum b_n`` is convergent and ``a_n\leq b_n`` for all ``n``, then ``\sum a_n`` is also convergent.
* If ``\sum b_n`` is divergent and ``a_n\geq b_n`` for all ``n`` , then is ``\sum a_n`` also divergent


---

**_Remarks_**
* Most of the time we use one of these series:
- ``p-``series ``\sum \frac{1}{n^p}``
- geometric series.



"""
743 μs

Examples Test for convegence

(1)n=152n2+4n+3(2)n=1lnnn

md"""
**_Examples_**
Test for convegence
```math
\begin{array}{lrrr}
\text{(1)} & \sum_{n=1}^{\infty}\frac{5}{2n^2+4n+3}\\ \\
\text{(2)} & \sum_{n=1}^{\infty}\frac{\ln n}{n}\\
\end{array}
```

"""
210 μs

The Limit Comparison Test

Suppose an that and bn are series with positive terms. If

limnanbn=c

where c is a finite number and c>0, then either both series converge or both diverge.

Remark

Exercises 40 and 41 deal with the cases c=0 and c= .

md"""
## The Limit Comparison Test

Suppose ``\sum a_n`` that and ``\sum b_n`` are series with positive terms. If
```math
\lim_{n\to\infty}\frac{a_n}{b_n} = c
```
where ``c`` is a finite number and ``c>0``, then either both series converge or both diverge.

**_Remark_**

Exercises `40` and `41` deal with the cases ``c=0`` and ``c=\infty`` .

"""
363 μs

Examples Test for convegence

(3)n=112n1(4)n=12n2+3n5+n5

md"""
**_Examples_**
Test for convegence
```math
\begin{array}{llrr}
\text{(3)} & \sum_{n=1}^{\infty}\frac{1}{2^n-1}\\ \\
\text{(4)} & \sum_{n=1}^{\infty}\frac{2n^2+3n}{\sqrt{5+n^5}}\\
\end{array}
```
"""
244 μs
begin
function poolcode()
cm"""
<div class="img-container">

$(Resource("https://www.dropbox.com/s/cat9ots4ausfzyc/qrcode_itempool.com_kfupm.png?raw=1",:width=>300))

</div>"""
end
function bbl(t,s)
end
ebl()=endBlock()
function bth(s)
end
eth()=endTheorem()
ex(n::Int;s::String="")=ex("Example $n",s)
ex(t,s)=example(t,s)
function beginBlock(title,subtitle)
"""<div style="box-sizing: border-box;">
<div style="display: flex;flex-direction: column;border: 6px solid rgba(200,200,200,0.5);box-sizing: border-box;">
<div style="display: flex;">
<div style="background-color: #FF9733;
border-left: 10px solid #df7300;
padding: 5px 10px;
color: #fff!important;
clear: left;
3.4 ms

Exercises

Test for convegence

(5)n=1n+3nn+2n(6)n=11n1+1n

md"""
**_Exercises_**

Test for convegence
```math
\begin{array}{llrr}
\text{(5)} & \sum_{n=1}^{\infty}\frac{n+3^n}{n+2^n}\\ \\
\text{(6)} & \sum_{n=1}^{\infty}\frac{1}{n^{1+{1\over n}}}\\
\end{array}
```
"""
227 μs

9.5: Alternating Series

objectives

  • Use the Alternating Series Test to determine whether an infinite series converges.

  • Use the Alternating Series Remainder to approximate the sum of an alternating series.

  • Classify a convergent series as absolutely or conditionally convergent.

  • Rearrange an infinite series to obtain a different sum.

An alternating series is a series whose terms are alternately positive and negative. For examples:

112+1314+1516+=n=1(1)(n1)1n

12+2334+4556+67=n=1(1)nnn+1

alternating seriesn=1an=n=1(1)n1bn

Alternating Series Test

If the alternating series

n=1(1)n1bn=b1b2+b3b4+b5b6+(bn>0)

satisfies the conditions

(i)bn+1bnfor all n(ii)limnbn=0

then the series is convergent.

md"""
# 9.5: Alternating Series
> **objectives**
> - Use the Alternating Series Test to determine whether an infinite series converges.
> - Use the Alternating Series Remainder to approximate the sum of an alternating series.
> - Classify a convergent series as absolutely or conditionally convergent.
> - Rearrange an infinite series to obtain a different sum.


An __alternating series__ is a series whose terms are alternately __positive__ and __negative__. For examples:

```math
1-\frac{1}{2}+\frac{1}{3}-\frac{1}{4}+\frac{1}{5}-\frac{1}{6}+\cdots = \sum_{n=1}^{\infty}(-1)^{(n-1)}\frac{1}{n}
```

```math
-\frac{1}{2}+\frac{2}{3}-\frac{3}{4}+\frac{4}{5}-\frac{5}{6}+\frac{6}{7}-\cdots = \sum_{n=1}^{\infty}(-1)^{n}\frac{n}{n+1}
```

```math
\text{alternating series}\quad \sum_{n=1}^{\infty}a_n = \sum_{n=1}^{\infty}(-1)^{n-1}b_n
```

**_Alternating Series Test_**
501 μs

n = 1

n9Slider = @bind n9slider Slider(1:1000,show_value=true);md"n = $n9Slider"

788 μs
begin
a9(n) = ((-1)^(n))/(n)
d9=2:(1+n9slider)
bs92 = (n9slider>9) ? "\\sum_{i=1}^{$n9slider}(-1)^{n-1}b_i" : (join([(i==n9slider) ? "b_{$i}" :
iseven(i) ? "b_{$i}+" : "b_{$i}-" for i in 1:n9slider]))
plt9 = scatter(a9.(d9), zeros(10),
frame_style=:origin,
ylimits=(-0.1,1),
xlimits=(-0.36,0.55),
yaxis=nothing,
label=:none,
showaxis=:x,
ticks=[],
legend=:topleft,
title_location=:left,
grid=:none,
title=L"\textrm{Proof}",
annotations=[(0.2,0.8,L"s_{%$n9slider}=%$bs92")]
)
annotate!(plt9,[(a9(d9[i]),0.04,L"s_{%$i}",8) for i in 1:n9slider])
md"""
$plt9
"""
end
325 ms

Example Test for convegrnce

(1)n=1(1)n1n(2)n=1(1)n3n4n1(3)n=1(1)n+1n2n3+1

md"""
**_Example_**
Test for convegrnce
```math
\begin{array}{cl}
\text{(1)} & \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n} \\ \\

\text{(2)} & \sum_{n=1}^\infty (-1)^{n}\frac{3n}{4n-1}\\ \\

\text{(3)} & \sum_{n=1}^\infty (-1)^{n+1}\frac{n^2}{n^3+1}
\end{array}
```
"""
209 μs

Estimating Sums of Alternating Series

If s=(1)n1bn, where bn>0, is the sum of an alternating series that satisfies

(i)bn+1bnand(ii)limnbn=0

then

|Rn|=|ssn|bn+1

md"""
### Estimating Sums of Alternating Series
If ``s=\sum (-1)^{n-1}b_n``, where ``b_n>0``, is the sum of an alternating series that satisfies
```math
\begin{array}{cl}
\text{(i)} & b_{n+1}\leq b_n \quad \text{and} \\ \\
\text{(ii)} & \lim_{n\to\infty}b_n =0
\end{array}
```
then
```math
\left|R_n\right|=\left|s-s_n\right|\leq b_{n+1}

```

"""
236 μs

Example How many terms of the series

n=1(1)n+1n6

do we need to add in order to find the sum accurate with |error|<0.000001?

md"""
**_Example_**
How many terms of the series
```math
\sum_{n=1}^{\infty}{\frac{(-1)^{n+1}}{{n^6}}}
```
do we need to add in order to find the sum accurate with $|error|< 0.000001$?

"""
302 μs
# n10Slider = @bind n10slider NumberField(1:20);md"n = $n10Slider"
6.2 μs

Absolute Convergence and Conditional Convergence

  • A series an is called absolutely convergent if the series of absolute values |an| is convergent.

  • A series an is called conditionally convergent if it is convergent but not absolutely convergent; that is, an if converges but |an| diverges.


Theorem

If a series an is absolutely convergent, then it is convergent.

md"""
### Absolute Convergence and Conditional Convergence
* A series ``\sum a_n`` is called __absolutely convergent__ if the series of absolute values ``\sum |a_n|`` is convergent.
* A series ``\sum a_n`` is called __conditionally convergent__ if it is convergent but not absolutely convergent; that is, ``\sum a_n`` if converges but ``\sum |a_n|`` diverges.

---

**_Theorem_**

If a series ``\sum a_n`` is absolutely convergent, then it is convergent.

"""
562 μs

Examples Determine whether the series is absolutely convergent, conditionally convergent, or divergent

(i)n=1(1)nn(ii)n=1(1)nn2(iii)n=1(1)nn3(v)n=1(1)nn2n+1

md"""
**_Examples_**
Determine whether the series is absolutely convergent, conditionally convergent, or divergent
```math
\begin{array}{lcl}
\text{(i)} & &\sum^{\infty}_{n=1}\frac{(-1)^n}{n} \\ \\
\text{(ii)} & &\sum^{\infty}_{n=1}\frac{(-1)^n}{n^2} \\ \\
\text{(iii)} & &\sum^{\infty}_{n=1}\frac{(-1)^n}{\sqrt[3]{n}} \\ \\
\text{(v)} & &\sum^{\infty}_{n=1}(-1)^n\frac{n}{2n+1} \\ \\
\end{array}
```
"""
230 μs

9.6: The Ratio and Root Tests

Objectives

  • Use the Ratio Test to determine whether a series converges or diverges.

  • Use the Root Test to determine whether a series converges or diverges.

  • Review the tests for convergence and divergence of an infinite series.

The Ratio Test

(i)If limn|an+1an|=L<1, then the series is absolutely convergent(and therefore convergent).(ii)If limn|an+1an|=L>1 or limn|an+1an|=, then the series is divergent(iii)Iflimn|an+1an|=1, the Ratio Test is inconclusive;that is, no conclusion can be drawn aboutthe convergence or divergence ofan.

md"""
# 9.6: The Ratio and Root Tests
> __Objectives__
> - Use the Ratio Test to determine whether a series converges or diverges.
> - Use the Root Test to determine whether a series converges or diverges.
> - Review the tests for convergence and divergence of an infinite series.

## The Ratio Test
```math
\begin{array}{ll}
\text{(i)} &\text{If } \lim_{n\to\infty}\left|\frac{a_{n+1}}{a_n}\right|=L<1,\text{ then the series is absolutely convergent} \\
& \text{(and therefore convergent).} \\ \\

\text{(ii)} &\text{If } \lim_{n\to\infty}\left|\frac{a_{n+1}}{a_n}\right|=L>1 \text{ or }\lim_{n\to\infty}\left|\frac{a_{n+1}}{a_n}\right|=\infty,\\
& \text{ then the series is divergent} \\ \\

\text{(iii)} & If \lim_{n\to\infty}\left|\frac{a_{n+1}}{a_n}\right|=1,
\text{ the Ratio Test is inconclusive;} \\
& \text{that is, no conclusion can be drawn about}\\
& \text{the convergence or divergence of} \sum a_n.
249 μs

The Root Test

(i)If limn|an|n=L<1, then the series is absolutely convergent(and therefore convergent).(ii)If limn|an|n=L>1 or limn|an|n=, then the series is divergent(iii)Iflimn|an|n=1, the Ratio Test is inconclusive.

md"""
## The Root Test
```math
\begin{array}{ll}
\text{(i)} &\text{If } \lim_{n\to\infty}\sqrt[n]{\left|a_n\right|}=L<1,\text{ then the series is absolutely convergent} \\
& \text{(and therefore convergent).} \\ \\

\text{(ii)} &\text{If } \lim_{n\to\infty}\sqrt[n]{\left|a_n\right|}=L>1 \text{ or }\lim_{n\to\infty}\sqrt[n]{\left|a_n\right|}=\infty,\\
& \text{ then the series is divergent} \\ \\

\text{(iii)} & If \lim_{n\to\infty}\sqrt[n]{\left|a_n\right|}=1,
\text{ the Ratio Test is inconclusive}.
\end{array}
```
"""
141 μs

Examples Test for convergence

(1) n=1cosnn3(2) n=1(1)nn33n(3) n=1(2n+55n+2)n

md"""
**_Examples_**
Test for convergence
```math
\begin{array}{lrl}
\text{(1)} & \text{ } & \sum_{n=1}^\infty \frac{\cos n}{n^3}\\ \\
\text{(2)} & \text{ } & \sum_{n=1}^\infty (-1)^n\frac{n^3}{3^n}\\ \\
\text{(3)} & \text{ } & \sum_{n=1}^\infty \left(\frac{2n+5}{5n+2}\right)^n \\
\end{array}
```

"""
204 μs
[cos(π*n) for n in 1:10]
20.3 μs

9.7: Taylor Polynomials and Approximations

Objectives

  • Find polynomial approximations of elementary functions and compare them with the elementary functions.

  • Find Taylor and Maclaurin polynomial approximations of elementary functions.

  • Use the remainder of a Taylor polynomial.

md"""
# 9.7: Taylor Polynomials and Approximations
> __Objectives__
> - Find polynomial approximations of elementary functions and compare them with the elementary functions.
> - Find Taylor and Maclaurin polynomial approximations of elementary functions.
> - Use the remainder of a Taylor polynomial.

"""
189 μs

Polynomial Approximations of Elementary Functions

For the function f(x)=ex, find a first-degree polynomial function P1(x)=a0+a1x whose value and slope agree with the value and slope of at x=0.

begin
p962 = md"""
For the function ``f(x)=e^x``, find a first-degree polynomial function ``P_1(x)=a_0+a_1x`` whose value and slope agree with the value and slope of at ``x=0``.
"""

cm"""
## Polynomial Approximations of Elementary Functions

$p962

"""

end
228 ms

n =

begin
showSn = @bind showsn Radio(["show"=>"Show", "hide"=>"Hide"], default="show")
nStart = @bind nstart NumberField(-1:1, default=0)
nTerms = @bind nterms NumberField(nstart:100)
# n starts from $nStart
md"""
$showSn
n = $nTerms
"""
end
1.8 ms
begin
an(x,n)=x^n/factorial(n)
fn(x)=exp(x)
# an1(x,n)=factorial(big(n))*x^n
intrvl = -4.1:0.01:4.1
plus_or_empty(n,last) = (n<last) ? " + " : ""
term_reps(n,last) = join(
[
n==0 ? "1" : (n==1) ? "x" : "x^{$n}/{$n}!"
])
ps1(x,s,e) = sum([an(x,i) for i in s:e])
plt=plot()
if (showsn=="show")
plt = plot!(plt,
, label=(nterms>=10) ? latexstring("P_{$(nterms)}(x)=\\sum_{n=0}^{$(nterms)}\\frac{x^n}{n!}") : latexstring("P_{$(nterms)}(x)="*
join([term_reps(i,nterms) for i in nstart:nterms])
)
)
end
plot!(plt,intrvl,fn.(intrvl),label=L"f(x)=e^x",c=:green)
plot!(plt;
frame_style=:origin
, ylims=(-0.5,3)
266 ms

Taylor and Maclaurin Polynomials

md"""
## Taylor and Maclaurin Polynomials

"""
135 μs

Definitions
of th Taylor Polynomial and th Maclaurin Polynomial

If f has n derivatives at c, then the polynomial

Pn(x)=f(c)+f(c)(xc)+f(c)2!(xc)2++f(n)(c)n!(xc)n

is called the nth Taylor polynomial for f at c. If c, then

Pn(x)=f(0)+f(0)x+f(0)2!x2++f(n)(0)n!xn

is also called nth th Maclaurin polynomial for f.

cm"""
$(bbl("Definitions","of th Taylor Polynomial and th Maclaurin Polynomial"))
If ``f`` has ``n`` derivatives at ``c``, then the polynomial
```math
P_n(x)=f(c)+f'(c)(x-c)+\frac{f''(c)}{2!}(x-c)^2
+\cdots +\frac{f^{(n)}(c)}{n!}(x-c)^n
```
is called the ``n``th __Taylor polynomial__ for ``f`` at ``c``. If ``c``, then
```math
P_n(x)=f(0)+f'(0)x+\frac{f''(0)}{2!}x^2
+\cdots +\frac{f^{(n)}(0)}{n!}x^n
```
is also called ``n``th th __Maclaurin polynomial__ for ``f``.
$(ebl())
"""
485 μs

Example 3:
A Maclaurin Polynomial for e^x

Example 4:
Finding Taylor Polynomials for lnx
Find the Taylor polynomials P0,P1,P2,P3, and P4 for

f(x)=lnx

centered at c=1.

Example 5:
Finding Maclaurin Polynomials for cosx
Find the Taylor polynomials P0,P2,P4, and P6 to approximate cos(0.1).

Example 6:
Finding Taylor Polynomials for sin x
Find the Taylor polynomial P3for

f(x)=sinx

centered at c=π/6.

Example 7:
Approximation Using Maclaurin Polynomials
Use a fourth Maclaurin polynomial to approximate the value of ln(1.1).

cm"""
$(ex(3,s="A Maclaurin Polynomial for e^x"))

$(ex(4,s="Finding Taylor Polynomials for lnx"))
Find the Taylor polynomials ``P_0, P_1, P_2, P_3``, and ``P_4`` for
```math
f(x)=\ln x
```
centered at ``c=1``.

$(ex(5,s="Finding Maclaurin Polynomials for cosx"))
Find the Taylor polynomials ``P_0, P_2, P_4``, and ``P_6`` to approximate ``\cos(0.1)``.

$(ex(6,s="Finding Taylor Polynomials for sin x"))
Find the Taylor polynomial ``P_3``for
```math
f(x)=\sin x
```
centered at ``c=\pi/6``.

$(ex(7,s="Approximation Using Maclaurin Polynomials"))
Use a fourth Maclaurin polynomial to approximate the value of ``\ln(1.1)``.
"""
1.7 ms

9.8: Power Series

Objectives -Understand the definition of a power series.

  • Find the radius and interval of convergence of a power series.

  • Determine the endpoint convergence of a power series.

  • Differentiate and integrate a power series.

A series of the form

n=0an(xc)n=a0+a1(xc)+a2(xc)2+a3(xc)3+

is called a power series in (xc) or a power series centered at c or a power series about c

We are interested in finding the values of x for which this series is convergent.

md"""
# 9.8: Power Series
> __Objectives__
> -Understand the definition of a power series.
> - Find the radius and interval of convergence of a power series.
> - Determine the endpoint convergence of a power series.
> - Differentiate and integrate a power series.

A series of the form
```math
\sum_{n=0}^{\infty} a_n(x-c)^n = a_0 + a_1(x-c) +a_2(x-c)^2 +a_3(x-c)^3 + \cdots
```
is called a __power series in ``(x-c)``__ or a __power series centered at ``c``__ or a __power series about ``c``__

We are interested in __finding the values of ``x`` for which this series is convergent.__
"""
410 μs

Radius and Interval of Convergence

md"## Radius and Interval of Convergence"
134 μs

Theorem For a power series n=0an(xc)n, there are only three possibilities:

(i) The series converges only when x=c.

(ii)The series converges for all x.

(iii) There is a positive number R such that the series converges if |xc|<R and diverges if |xc|>R.

Remarks

  • The number R is called the radius of convergence of the power series.

    • The radius of convergence is R=0 in case (i)

    • R= in case (ii).

  • The interval of convergence of a power series is the interval that consists of all values of for which the series converges.

    • In case (i) the interval consists of just a single point a.

    • In case (ii) the interval is (,).

md"""
----

__*Theorem*__
For a power series ``\sum_{n=0}^{\infty}a_n(x-c)^n``, there are only three possibilities:

(i) The series converges only when ``x=c``.

(ii)The series converges for all ``x``.

(iii) There is a positive number ``R`` such that the series converges if
``|x-c|<R`` and diverges if ``|x-c|>R``.

__Remarks__

- The number ``R`` is called the __radius of convergence__ of the power series.
- The radius of convergence is ``R=0`` in case (i)
- ``R=\infty`` in case (ii).
- The __interval of convergence__ of a power series is the interval that consists of all values of for which the series converges.
- In case (i) the interval consists of just a single point ``a``.
- In case (ii) the interval is ``(-\infty,\infty)``.
"""
817 μs

Examples:

(1)n=0n!xn(2)n=1(x3)nn(3)n=0(1)nx2n(2n)!
cm"""
$(example("Examples",""))

```math
\begin{array}{l@{\,\,\,\,}l}
(1) & \displaystyle\sum_{n=0}^\infty n! x^n\\ \\
(2) & \displaystyle\sum_{n=1}^\infty \frac{(x-3)^n}{n}\\ \\
(3) & \displaystyle\sum_{n=0}^\infty \frac{(-1)^nx^{2n}}{(2n)!}
\end{array}
```

"""
341 μs

Endpoint Convergence

md"""
## Endpoint Convergence
"""
135 μs

Examples

Find the radius of convergence and interval of convergence of the series

(4)n=0(1)nxnn+1(5)n=0n(x+2)n3n+1

md"""
#### Examples
Find the radius of convergence and interval of convergence of the series
```math
\begin{array}{l@{\,\,\,\,}l}
(4) & \sum_{n=0}^\infty \frac{(-1)^nx^n}{\sqrt{n+1}}\\
(5) & \sum_{n=0}^\infty \frac{n(x+2)^n}{3^{n+1}}\\
\end{array}
```

"""
197 μs

Differentiation and Integration of Power Series

(term-by-term differentiation and integration)

Theorem

If the power series an(xc)n has radius of convergence R>0, then the function f defined by

f(x)=a0+a1(xc)+a2(xc)2+=n=0an(xc)n

is differentiable (and therefore continuous) on the interval (aR,a+R) and

(i)f(x)=a1+2a2(xc)+3a2(xc)2+=n=1nan(xc)n1(ii)f(x)dx=C+a0(xc)+a1(xc)22+a2(xc)33+=C+n=0an(xc)n+1n+1

The radii of convergence of the power series in Equations (i) and (ii) are both R.

md"""
## Differentiation and Integration of Power Series
**(term-by-term differentiation and integration)**

__*Theorem*__

If the power series ``\sum a_n(x-c)^n`` has radius of convergence ``R>0``, then the function ``f`` defined by
```math
f(x) = a_0+a_1(x-c)+a_2(x-c)^2+\cdots = \sum_{n=0}^{\infty}a_n(x-c)^n
```
is differentiable (and therefore continuous) on the interval ``(a-R,a+R)`` and
```math
\begin{array}{lllll}
\text{(i)} &\text{}& f'(x) &=&
a_1+2a_2(x-c)+3a_2(x-c)^2+\cdots \\
&&&=& \sum_{n=1}^{\infty}na_n(x-c)^{n-1} \\ \\
\text{(ii)} &\text{}& \int f(x) dx &=&
C + a_0(x-c)+a_1\frac{(x-c)^2}{2}+a_2\frac{(x-c)^3}{3}+\cdots \\
&&&=&C+\sum_{n=0}^{\infty}a_n\frac{(x-c)^{n+1}}{n+1} \\ \\

\end{array}
```

419 μs

Example 8:
Intervals of Convergence
Consider the function

f(x)=n=1xnn

Find the interval of convergence for each of the following.

  1. f(x)
  2. f(x)
  3. f(x)dx
cm"""
$(ex(8,s="Intervals of Convergence"))
Consider the function
```math
f(x)= \sum_{n=1}^{\infty}\frac{x^n}{n}
```
Find the interval of convergence for each of the following.
1. ``\displaystyle f(x)``
1. ``\displaystyle f'(x)``
1. ``\displaystyle \int f(x) dx``

"""
568 μs

9.9: Representation of Functions by Power Series

Objectives

  • Find a geometric power series that represents a function.

  • Construct a power series using series operations.

Geometric Power Series

11x=1+x+x2+x3+=n=0xn,|x|<1.

md"""
# 9.9: Representation of Functions by Power Series
> **Objectives**
> - Find a geometric power series that represents a function.
> - Construct a power series using series operations.

## Geometric Power Series
```math
\frac{1}{1-x} = 1 + x + x^2 +x^3 +\cdots =\sum_{n=0}^{\infty}x^n, \quad |x|<1.
```
"""
218 μs

Examples

  1. Express as the sum of a power series and find the interval of convergence.

f(x)=11+x2

  1. Find a power series representation for

f(x)=1x+2

  1. Find a power series representation for

f(x)=x3x+2

  1. Find a power series representation around 1 for

f(x)=1x

SOLUTION IN CLASS

md"""
#### Examples
1. Express as the sum of a power series and find the interval of convergence.
```math
f(x)=\frac{1}{1+x^2}
```
2. Find a power series representation for
```math
f(x)=\frac{1}{x+2}
```
3. Find a power series representation for
```math
f(x)=\frac{x^3}{x+2}
```

4. Find a power series representation around ``1`` for
```math
f(x)=\frac{1}{x}
```
__SOLUTION IN CLASS__

"""
598 μs

Operations with Power Series

Let f(x)=n=0anxn and g(x)=n=0bnxn.

  1. f(kx)=n=0anknxn.
  2. f(xN)=n=0anxNn.
  3. f(x)±g(x)=n=0(an±bn)xn.

cm"""
$(bbl("Operations with Power Series",""))
Let ``f(x)=\displaystyle \sum_{n=0}^{\infty}a_n x^n`` and ``g(x)=\displaystyle \sum_{n=0}^{\infty}b_n x^n``.
1. ``f(kx) = \displaystyle \sum_{n=0}^{\infty}a_n k^nx^n``.
1. ``f(x^N) = \displaystyle \sum_{n=0}^{\infty}a_n x^{Nn}``.
1. ``f(x)\pm g(x) = \displaystyle \sum_{n=0}^{\infty}(a_n\pm b_n) x^n``.
$(ebl())
"""
516 μs

Examples

  1. Express as a power series

f(x)=3x1x21

  1. Express as a power series

f(x)=1(1x)2

  1. Express as a power series

f(x)=ln(1+x)

  1. Express as a power series

f(x)=tan1x

  1. Evaluate

dx1+x7

  1. Approximate π

4tan115tan11239=π4(see ex. 44)

SOLUTION IN CLASS

md"""
#### Examples
4. Express as a power series
```math
f(x) = \frac{3x-1}{x^2-1}
```
4. Express as a power series
```math
f(x) = \frac{1}{(1-x)^2}
```
5. Express as a power series
```math
f(x) = \ln(1+x)
```
6. Express as a power series
```math
f(x) = \tan^{-1}x
```

7. Evaluate
```math
\int \frac{dx}{1+x^7}
```

8. Approximate ``\pi``
```math
4\tan^{-1}\frac{1}{5}-\tan^{-1}\frac{1}{239} = \frac{\pi}{4} \quad \text{(see ex. 44)}
```

__SOLUTION IN CLASS__

"""
843 μs

9.10: Taylor and Maclaurin Series [^⭐]

[^⭐]: Students have to memorize the power series representations of the functions f(x)=11+x,ex,sinx,cosx,arctanx,(1+𝑥)𝑘 in page 674.

Objectives

  • Find a Taylor or Maclaurin series for a function.

  • Find a binomial series.

  • Use a basic list of Taylor series to find other Taylor series.

  • By the end of this section we will be able to write the following power series representations of certain functions

(1)11x=n=0xn=1+x+x2+x3+,R=1(2)ln(1+x)=n=0(1)nxn+1n+1=xx22+x33x44+,R=1(3)tan1x=n=0(1)nx2n+12n+1=xx33+x55x77+,R=1(4)ex=n=0xnn!=1+x1!+x22!+x33!+,R=(5)sinx=n=0(1)nx2n+1(2n+1)!=xx33!+x55!x77!+,R=(6)cosx=n=0(1)nx2n(2n)!=1x22!+x44!x66!+,R=(7)(1+x)k=n=0(kn)xn=1+kx+k(k1)2!x2+k(k1)(k2)3!x3+,R=1

md"""# 9.10: Taylor and Maclaurin Series [^⭐]
[^⭐]: Students have to memorize the power series representations of the functions
``f(x) =\frac{1}{1+x}, e^x, \sin x , \cos x , \arctan x , (1 + 𝑥)^𝑘`` in page 674.
> **Objectives**
> - Find a Taylor or Maclaurin series for a function.
> - Find a binomial series.
> - Use a basic list of Taylor series to find other Taylor series.

* By the end of this section we will be able to write the following power series representations of certain functions

```math
{\small
\begin{array}{llcllllr}
{\small \text{(1)}} & \frac{1}{1-x} &=&
\sum_{n=0}^{\infty} x^n &=&
1+x+x^2+x^3+\cdots,&R=1 \\

{\small \text{(2)}} & \ln(1+x) &=&
\sum_{n=0}^{\infty} (-1)^{n} \frac{x^{n+1}}{n+1} &=&
x-\frac{x^2}{2}+\frac{x^3}{3}-\frac{x^4}{4}+\cdots,&R=1 \\

{\small \text{(3)}} & \tan^{-1}x &=&
\sum_{n=0}^{\infty} (-1)^n \frac{x^{2n+1}}{2n+1} &=&
371 μs

Theorem
Taylor Theorem

If f has a power series representation (expansion) at a , that is, if

f(x)=n=0cn(xa)n,|xc|<R

then its coefficients are given by the formula

cn=f(n)(a)n!

Remarks

  • The series is called the Taylor series of the function f at a (or about a or centered at a).
  • (Maclaurin Series) If a=0, Taylor series becomes
f(x)=n=0f(n)(0)n!xn=f(0)+f(0)1!x+f(0)2!x2+f(0)3!x3+

cm"""
$(bth("Taylor Theorem"))
If ``f`` has a power series representation (expansion) at ``a`` , that is, if

```math
f(x) = \sum_{n=0}^{\infty}c_n (x-a)^n, \quad |x-c| < R
```

then its coefficients are given by the formula
```math
c_n = \frac{f^{(n)}(a)}{n!}
```

**_Remarks_**
- The series is called the __Taylor series of the function ``f`` at ``a`` (or about ``a`` or centered at ``a``)__.
- (__Maclaurin Series__) If ``a=0``, Taylor series becomes
```math
{\small
f(x) = \sum_{n=0}^{\infty}\frac{f^{(n)}(0)}{n!} x^n=f(0)+\frac{f'(0)}{1!}x
+\frac{f''(0)}{2!}x^2+\frac{f'''(0)}{3!}x^3+\cdots
}
```
$(eth())
"""
699 μs

Examples (important)

  • Find Maclaurin series for

(1)f(x)=ex(2)f(x)=sinx(3)f(x)=cosx

  • Find Taylor Series of f(x)=sinx about π3.

md"""
#### Examples (important)
- Find __*Maclaurin*__ series for

```math

\begin{array}{lll}
{\small \text{(1)}} & f(x)=e^x \\
{\small \text{(2)}} & f(x)=\sin x \\
{\small \text{(3)}} & f(x)=\cos x \\
\end{array}
```
- Find Taylor Series of ``f(x)=\sin x\quad `` about ``\quad {\pi \over 3}``.


"""
470 μs

The Binomial Series

Example: Find the Maclaurin series for f(x)=(1+x)k, where k is any real number.

Solution: In Class

md"""
### The Binomial Series
**Example**:
Find the Maclaurin series for ``f(x)=(1+x)^k``, where ``k`` is any real number.

__*Solution: In Class*__

"""
307 μs

The Binomial Series (Theorem)

If k is any real number and |x|<1, then

(1+x)k=n=0(kn)xn=1+kx+k(k1)2!x2+k(k1)(k2)3!x3+

where

(kn)=k(k1)(k2)(kn+1)n!

Remarks

  • This is called binomial coefficients. Note that

(kn)=0ifk is integer and k<n

(k0)=1,(k1)=k

  • If 1<k0, it converges at x=1.

  • If k0 it converges at x=±1.

md"""
__*The Binomial Series (Theorem)*__

If ``k`` is any real number and ``|x|<1``, then
```math
(1+x)^k=\sum_{n=0}^{\infty}\begin{pmatrix}
k \\ n
\end{pmatrix}x^n = 1 + k x + \frac{k(k-1)}{2!}x^2 +
\frac{k(k-1)(k-2)}{3!}x^3 +\cdots

```
where
```math
\left(\begin{array}{c} k \\ n\end{array}\right) = \frac{k(k-1)(k-2)\cdots (k-n+1)}{n!}
```
__*Remarks*__

* This is called __binomial coefficients__. Note that
```math
\left(\begin{array}{c} k \\ n\end{array}\right) =0 \qquad \text{if} \quad k \text{ is integer and } k<n
```

```math
\left(\begin{array}{c} k \\ 0\end{array}\right) =1, \quad \left(\begin{array}{c} k \\ 1\end{array}\right) =k
```
* If ``-1<k\leq 0``, it converges at ``x=1``.
743 μs

Example

Find the Maclaurin series for the function

f(x)=14x

and its radius of convergence.

md"""
#### Example
Find the Maclaurin series for the function
```math
f(x)=\frac{1}{\sqrt{4-x}}
```
and its radius of convergence.

"""
297 μs

Deriving Taylor Series from a Basic List

Check the table

Examples

  • Find the Maclaurin series for

(a)f(x)=xcosx(b)f(x)=ln(1+3x2)

  • Find the function represented by the power series

n=0(1)n2nxnn!

  • Find the sum of the series

1121222+13231424+

md"""
## Deriving Taylor Series from a Basic List
__Check the table__
#### Examples
- Find the Maclaurin series for
```math
\begin{array}{lll}
{\small \text{(a)}} & f(x)=x\cos x \\
{\small \text{(b)}} & f(x)=\ln (1+3x^2)\\
\end{array}
```

- Find the function represented by the power series
```math
\sum_{n=0}^{\infty}(-1)^n\frac{2^nx^n}{n!}
```

- Find the sum of the series
```math
\frac{1}{1\cdot 2}-\frac{1}{2\cdot 2^2}+\frac{1}{3\cdot 2^3}-
\frac{1}{4\cdot 2^4}+ \cdots
```

"""
479 μs

More Examples

  • Evaluate

ex2dx

  • Evaluate

limx0ex1xx2

  • Find the first 3 nonzero terms of Maclaurin series for

(a)exsinx(b)tanx

  • Find the sum of

(a)n=0x4nn!(b)n=0(1)nπ2n+142n+1(2n+1)!

md"""
#### More Examples
- Evaluate
```math
\int e^{-x^2} dx
```
- Evaluate
```math
\lim_{x\to 0}\frac{e^x-1-x}{x^2}
```
- Find the first 3 nonzero terms of Maclaurin series for
```math
(a) \quad e^x\sin x \qquad (b)\quad \tan x
```
- Find the sum of
```math
(a) \quad \sum_{n=0}^\infty \frac{x^{4n}}{n!}\qquad (b)\quad \sum_{n=0}^\infty (-1)^n\frac{\pi^{2n+1}}{4^{2n+1}(2n+1)!}
```
"""
440 μs
begin
using FileIO, ImageIO, ImageShow, ImageTransformations
using SymPy
using PlutoUI
using CommonMark
using Plots, PlotThemes, LaTeXStrings
using HypertextLiteral
: @htl, @htl_str

using Colors
using Random
end
12.2 s