Today we reviewed Taylor’s theorem from calculus. We also talked about using list comprehensions in Python.
Today we continued talking about Taylor series and polynomials. We used the Maclaurin series \[\ln(1+x) = \sum_{k = 0}^\infty \frac{(-1)^k x^{k+1}}{k+1}\] to calculate \(\ln(\frac{3}{2})\). Here is how I would do this using Python:
from scipy.special import factorial
x = 1/2
sum([(-1)**k*x**(k+1)/(k+1) for k in range(6)]) # 0.4046875Of course, you would get a better approximation with more than six terms. After that example, we worked on the lab from Monday which is due on Friday.
Today we introduced the bisection method for finding the roots of a continuous function.