Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Image: ubuntu2204
Infinite Series
An infinite series, or series, is the sum of an sequence
Example:
For series, we need to invest the sum of the infinity many numbers.
Consider its th partial sum which is a sequence.
Given a series The number is the th term of the series. If the sequence of partial sums converges to a limit , we say that the series converges and its sum is . In this case, we aslo write If the sequence of partial sums of the series does not converge, we say that the series diverges.
There are different notations for a serie:
Geometric Series ( and are fixed)
Let , then we have Thus we have
Examples:
We have and , then the series converges to .
Telescoping Example:
The th-Term Test for a Divergent Series
If converges, then . (This is a necessary condition for convergence.)
diverges if fails to exists or is different from zero. (This is a sufficient condition for divergence.)
Examples: Divergence or Convergence
divergence because .
divergence because does not convergence.
divergence because converges to .
does not mean converges
Example:
Combing Series
If and are convergent series, then
Sum rule:
Difference rule:
Constant Multiple rule:
Corollary
If diverges, then for ?
If diverges and converges, then ?
Example:
Adding or Deleting Terms
Adding or deleting a finite number of terms does not change the series's convergence or divergence.
Reindexing
The following four notations are equivalent.
Nondecreasing Partial Sums
Consider with for all . We have
Corollary
A series of nonnegative terms converges if and only if its partial sums are bounded from above.
Does the harmonic series converge or not? (Check the Comparison Test)
The Integral Test (Theorem 9--The integral test)
Let be a sequence of positive terms. Suppose that , where is a continuous, positive, decreasing function of for all . Then the series and the integral both converge or both diverge.
-series:
Consider If , we have that If , we have that It converges when and diverges when .
Consider
Consider
Integral Test: Approximation
Though we can show that the series converges, we can not easily find the total sum . But, we can estimate it with the parital sum with the remainder
Estimate with
We have that
The Comparison Test
Let , , and be series with nonnegative terms. Suppose that for some integer , we have Then
If converges, then also converges, because its partial sum is increasing and bounded.
If diverges, then also diverges, because its partial sum is unbounded.
Examples
diverges because
converges because
Harmonic series
We can find a lower bound of the series.
The Limit Comparison Test
Suppose that and for
If , then both and converge or both diverge. (Note for large )
If and converges, then converges. (Note for large )
If and diverges, then diverges. (Note for large )
Example
What happens with negative terms?
A series converges absolutely (is absolutely convergent) if converges.
A absolutely convergent series converges, i.e., if converges, then converges.
Because , and both and converges.
The Ratio Test (Important)
Suppose that
If , then the series converges.
Compare with
If or , the series diverges
If , the test is inconclusive.
Examples
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
, in MaximaLib.sr_sum(self, *args)
890 try:
--> 891 return max_to_sr(maxima_eval([[max_ratsimp],[[max_simplify_sum],([max_sum],[sr_to_max(SR(a)) for a in args])]]))
892 except RuntimeError as error:
, in sage.libs.ecl.EclObject.__call__()
829 lispargs = EclObject(list(args))
--> 830 return ecl_wrap(ecl_safe_apply(self.obj,(<EclObject>lispargs).obj))
831
, in sage.libs.ecl.ecl_safe_apply()
352 else:
--> 353 raise RuntimeError("ECL says: {}".format(message))
354 else:
RuntimeError: ECL says: Sum is divergent!
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
Cell In [2], line 5
2 __tmp__=var("n"); f = symbolic_expression(factorial(Integer(2)*n)/factorial(n)/factorial(n)).function(n)
3 n_end = Infinity
----> 5 print('The sum of the first', n_end, 'terms of', f(n) ,'is', N(sum(f(n), n, Integer(1), n_end)))
, in symbolic_sum(expression, *args, **kwds)
410 r"""
411 Return the symbolic sum `\sum_{v = a}^b expression` with respect
412 to the variable `v` with endpoints `a` and `b`.
(...)
580
581 """
582 if hasattr(expression, 'sum'):
--> 583 return expression.sum(*args, **kwds)
584 elif max(len(args),len(kwds)) <= 1:
585 return sum(expression, *args, **kwds)
, in sage.symbolic.expression.Expression.sum()
13168 """
13169 from sage.calculus.calculus import symbolic_sum
> 13170 return symbolic_sum(self, *args, **kwds)
13171
13172 def prod(self, *args, **kwds):
, in symbolic_sum(expression, v, a, b, algorithm, hold)
630 return ssum(expression, v, a, b)
632 if algorithm == 'maxima':
--> 633 return maxima.sr_sum(expression,v,a,b)
635 elif algorithm == 'mathematica':
636 try:
, in MaximaLib.sr_sum(self, *args)
893 s = str(error)
894 if "divergent" in s:
895 # in pexpect interface, one looks for this;
896 # could not find an example where 'Pole encountered' occurred, though
897 # if "divergent" in s or 'Pole encountered' in s:
--> 898 raise ValueError("Sum is divergent.")
899 elif "Is" in s: # Maxima asked for a condition
900 self._missing_assumption(s)
ValueError: Sum is divergent.
Another example
The Root Test
Suppose that
If , then the series converges
Compare with
If or , then the series diverges
If , then the test is inconclusive.
Alternating Series
An alternating series has terms that are alternatively positive and negative.
The series converges if the following are satisfied
for .
.
WLOG, assume that . Consider
is increasing, while is decreasing.
.
Both and converge, and .
Example
Use derivative to check monotonicity
Define such that .
Alternating Series Estimation Theorem
If the alternating series satisfies the conditions of Theorem 15, then for , then we have approximates the total sum of the series with an error whose absolute values is less than . Furthermore, the sum lies between any two successive partial sums and , and the remainder has the same sign as the first unused term.
Example
Code for showing a series and comput the sum of the series
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In [43], line 5
2 p = RealNumber('2.5')
4 __tmp__=var("n"); f = symbolic_expression(Integer(1)/n**p).function(n)
----> 5 print('The total sum of', f(n), 'is', N(sum(f(n), n, Integer(1), Infinity)))
, in numerical_approx(x, prec, digits, algorithm)
1588 return numerical_approx_generic(x, prec)
1589 else:
-> 1590 return n(prec, algorithm=algorithm)
, in sage.symbolic.expression.Expression.numerical_approx()
6724 res = x.pyobject()
6725 else:
-> 6726 raise TypeError("cannot evaluate symbolic expression numerically")
6727
6728 # Important -- the we get might not be a valid output for numerical_approx in
TypeError: cannot evaluate symbolic expression numerically