Lecture 33 Big-\(\mathcal{O}\) Notation
Text References: Course notes pp. 144-151 & Rogawski N/A
33.1 Recap
Last time, we learned some tricks for finding power series, radii of convergence, and intervals of convergence for functions that were built from known basic functions.
Exercise 33.1 Find the Maclaurin series for \(f(x)=x^2e^x\).
Solution. We can multiply the known Maclaurin series for \(e^x\) by \(x^2\):
\[\begin{align*} x^2e^x &= x^2 \left(\sum_{k=0}^\infty \frac{x^k}{k!} \right)\\ &= x^2\left ( 1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots \right )\\ &= 2^+x^3+\frac{x^4}{2!}+\frac{x^5}{3!}+\cdots \\ &= \sum_{k=2}^\infty \frac{x^k}{(k-2)!} \end{align*}\]
33.2 Learning Objectives
- Use Big-\(\mathcal{O}\) notation to calculate Taylor series.
- Use Big-\(\mathcal{O}\) notation to calculate limitss.
33.3 Big-\(\mathcal{O}\) Notation
We’re now going to develop some terminology to describe how quickly a function grows near a given point. This notation will also help us when we’re manipulating Taylor series via our usual operations of addition, multiplication, and taking limits.
Definition 33.1 We say that \(f\) is of order \(g\) as \(x\to x_0\) if there is a constant \(A>0\) such that \[|f(x)|\leq A|g(x)|\] for all \(x\) near \(x_0\) (but not necessarily at \(x_0\)). We write \[f(x)=\mathcal{O}(g(x))\mbox{ as } x\to x_0\]
Example 33.1 Let’s warm up with a few examples:
- \(|x^3|\leq 1\cdot |x^2|\) for all \(x\in [-1,1]\), so we can state that \(x^3=\mathcal{O}(x^2)\) as \(x\to 0\)
- \(|x^3|\leq 1\cdot |x|\) for all \(x\in [-1,1]\), so we can state that \(x^3=\mathcal{O}(x)\) as \(x\to 0\)
- It is not true that \(x^3=\mathcal{O}(x^4)\) as \(x\to 0\); however, it is true that \(x^3=\mathcal{O}(x^4)\) as \(x\to\infty\) since \(|x^3|\leq 1\cdot |x^4|\) when \(|x|\geq 1\)
- \(|\sin(x)|\leq |x|\) for all \(x\), so we can state that \(\sin(x)=\mathcal{O}(x)\) as \(x\to 0\)
33.4 Algebra of Big-\(\mathcal{O}\) Notation
Here are some algebraic results that will help us when we’re thinking about Big-\(\mathcal{O}\) notation.
Theorem 33.1 The following hold as \(x\to 0\):
- \(k\mathcal{O}(x^n) = \mathcal{O}(x^n)\) for any constant \(k\)
- \(\mathcal{O}(x^n)+\mathcal{O}(x^m) = \mathcal{O}(x^q)\) where \(q=min(m,n)\)
- \(\mathcal{O}(x^n)\cdot \mathcal{O}(x^m)=\mathcal{O}(x^{n+m})\)
- \([\mathcal{O}(x^n)]^m = \mathcal{O}(x^{mn})\)
- \(\dfrac{\mathcal{O}(x^m)}{x^n}=\mathcal{O}(x^{m-n})\)
33.5 Big-\(\mathcal{O}\) Notation and Taylor Series
We’re now going to link Big-\(\mathcal{O}\) notation and Taylor’s Inequality. Recall that Taylor’s Inequality states that if \(f(x)=_{n,x_0}(x)+R_n(x)\), the \[|R_n(x)| \leq \frac{k|x-x_0|^{n+1}}{(n+1)!}\] where \(|f^{(n+1)}(z)|\leq K\) for all \(z\) between \(x_0\) and \(x\).
Now that we know about Big-\(\mathcal{O}\) notation, the expression for the remainder may look familiar. As it turns out, Taylor’s Inequality is telling us that the remainder \(R_n(x)=\mathcal{O}((x-x_0)^{n+1})\) as \(x\to x_0\)! We can therefore write our Taylor series a little more neatly: \[f(x)=P_{n, x_0}(x)+\mathcal{O}((x-x_0)^{n+1})\]
Let’s try to write a few Taylor series using this new trick:
Exercise 33.2 Given \(e^x = 1+x+\frac{x^2}{2!}+\mathcal{O}(x^3)\) as \(x\to 0\) and \(\cos(x)=1-\frac{x^2}{2!}+\frac{x^4}{4!}+\mathcal{O}(x^6)\) as \(x\to 0\), find the Taylor series of \(e^x+\cos(x)\).
Solution. We have \[\begin{align*} e^x+\cos(x) &= \left ( 1+x+\frac{x^2}{2!}+\mathcal{O}(x^3)\right)+ \left ( 1-\frac{x^2}{2!}+\frac{x^4}{4!}+\mathcal{O}(x^6)\right )\\ & = 2 +x +\frac{x^4}{4!} +\mathcal{O}(x^3)\\ &= 2+x+\mathcal{O}(x^3) \mbox{ as } x\to 0 \end{align*}\]
Exercise 33.3 Given \(\sqrt{1+x}=1+\frac{x}{2}+\mathcal{O}(x^2)\) and \(\sin(x)=x+\mathcal{O}(x^3)\)find the Taylor series of \(\sqrt{1+x}\cdot \sin(x)\).
Solution. We have \[\begin{align*} \sqrt{1+x}\cdot \sin(x) &= \left ( 1+\frac{x}{2}+\mathcal{O}(x^2)\right)\cdot \left ( x+\mathcal{O}(x^3)\right )\\ & = x+\mathcal{O}(x^3)+\frac{x^2}{2}+\frac{x}{2}\mathcal{O}(x^3)+x\mathcal{O}(x^2)+\mathcal{O}(x^2)\mathcal{O}(x^3)\\ &= x+\frac{x^2}{2}+\mathcal{O}(x^3)+\mathcal{O}(x^4)+\mathcal{O}(x^3)+\mathcal{O}(x^5)\\ &= x+\frac{x^2}{2} +\mathcal{O}(x^3) \mbox{ as } x\to 0 \end{align*}\]
We can also combine Taylor series and Big-\(\mathcal{O}\) notation to evaluate limits.
Exercise 33.4 Given \(e^x = 1+x+\mathcal{O}(x^2)\) and \(\cos(x)=1-\dfrac{x^2}{2!}+\mathcal{O}(x^4)\), use Taylor series to find \(\displaystyle \lim_{x\to 0}\frac{x^2e^x+2\cos(x)-2}{x^3}\).
Solution. We have
\[\begin{align*} \lim_{x\to 0}\frac{x^2e^x+2\cos(x)-2}{x^3} &= \lim_{x\to 0}\frac{x^2 (1+x+\mathcal{O}(x^2)) +2 (1-\dfrac{x^2}{2!}+\mathcal{O}(x^4))-2}{x^3}\\ &= \lim_{x\to 0} \frac{x^2+x^3+\mathcal{O}(x^4)+2-x^2+\mathcal{O}(x^4)-2}{x^3}\\ &= \lim_{x\to 0} \frac{x^3+\mathcal{O}(x^4)}{x^3}\\ &= \lim_{x\to 0} 1+\mathcal{O}(x) \\ &= 1+0 =1 \end{align*}\]