Sale!

Math 152 – Python Lab 7

$30.00

Category:
Rate this product

Python Lab 7
Math 152 – Python Lab 7
Directions: Use Python to solve each problem. (Template link)
1. Euler found the sum of the p-series with p = 4:
X∞
n=1
1
n4
=
π
4
90
(a) Find the partial sum s10 of the series X∞
n=1
1
n4
. Estimate the error in using s10 as an
approximation to the sum of the series.
(b) A variation of the Remainder Estimate tells us that:
sn +
Z ∞
n+1
f(x) dx ≤ s ≤ sn +
Z ∞
n
f(x) dx
Use n = 10 to give an improved estimate of the sum.
(c) Compare your estimates in part (b) with Euler’s estimate.
(d) Find a value of n so that sn is within 10−6 of the sum.
2. Given the series X∞
n=2
n
2
e
−n
and the function f(x) = x
2
e
−x
:
(a) Compute Z
f(x) dx and Z ∞
1
f(x) dx.
(b) In a print statement, state your conclusion about the convergence or divergence of the
series based on your answer to a).
(c) Compute s10, s50, s100, and s.
(d) Use the Remainder Estimate for the Integral Test to estimate s−s100. Compare the actual
value of s − s100. Does the actual error fall in the expected range?
(e) According to the Remainder Estimate, how many terms are needed to sum the series to
within 10−10? Compute the sum to confirm |s − sN | < 10−10. (NOTE: To expedite the
computation, convert the terms to floating point before summing)
(NOTE: #3 on the next page)
© 2023 TAMU Department of Mathematics MATH 152 Python Lab 7: Page 1 of 2
3. Given the series X∞
n=1
n sin2
(n)
1 + n3
:
(a) Let an =
n sin2
(n)
1 + n3
. Define a series bn with which to compare it.
(b) Plot the first 50 terms of an and bn on the same graph to determine which is larger. If
the graph is not clear, use the logical test an < bn to test the logical value comparing each
term.
(c) Determine whether X∞
n=1
bn converges or not, and state whether any conclusion can be made
about the convergence of X∞
n=1
an as a result.
(d) If (c) is conclusive, skip to (e). If (c) is inconclusive, determine whether an
bn
converges
or not, and state your conclusion about the convergence of X∞
n=1
an. (NOTE: If you still
cannot conclude anything, start over with a different bn!)
(e) Repeat parts (a) – (d) for an =
e
n + 1
nen + 1
© 2023 TAMU Department of Mathematics MATH 152 Python Lab 7: Page 2 of 2

Scroll to Top