Skip to content

7.5 Numerical Methods for Definite Integrals

\(\displaystyle\int_1^2f(x)dx\approx f(1)(0.5)+f(1.5)(0.5)=\text{LEFT}(2)\) \(\displaystyle\int_1^2f(x)dx\approx f(1.5)(0.5)+f(2)(0.5)=\text{RIGHT}(2)\)

Midpoint Rule

\(\displaystyle\int_1^2f(x)dx\approx f(1.25)(0.5)+f(1.75)(0.5)=\text{MID}(2)\)

3 ways of estimating integral with Riemann sum: 1) Left rule uses left endpoint of each subinterval 2) Right rule uses right endpoint of each subinterval 3) Midpoint rule uses midpoint endpoint of each subinterval

Ex:

\(\int_1^2\frac1xdx\), compute LEFT(2), RIGHT(2), MID(2), and compare with exact value

\(\text{LEFT}(2):\displaystyle\int_1^2\frac1xdx\approx\frac11(0.5)+\frac1{1.5}(0.5)\approx0.8\bar3\dots\) \(\text{RIGHT}(2):\displaystyle\int_1^2\frac1xdx\approx\frac1{1.5}(0.5)+\frac12(0.5)\approx0.58\bar3\dots\) \(\text{MID}(2):\displaystyle\int_1^2\frac1xdx\approx\frac1{1.25}(0.5)+\frac1{1.75}(0.5)\approx0.6857\dots\)

\(\text{ACTUAL}:\displaystyle\int_1^2\frac1xdx=\ln x\biggr|_1^2=\ln2-\ln1\approx0.6931\dots\)

\(\Delta x=\frac{b-a}n\)

Trapezoid

A trapezoid is a quadrilateral where 1 pair of opposite sides are parallel

\(\text{Area of trapezoid}=\frac{b_1+b_2}2*h\) \(T_1=\left(\frac{f(1)+f(1.5)}2\right)\Delta x\) \(T_2=\left(\frac{f(1.5)+f(2)}2\right)\Delta x\) \(\text{TRAP}(2):\frac{f(1)+f(1.5)}2\Delta x+\frac{f(1.5)+f(2)}2\Delta x\) \(=\frac{f(1)}2\Delta x+=\frac{f(1.5)}2\Delta x+=\frac{f(1.5)}2\Delta x+=\frac{f(2)}2\Delta x\)

In general \(\text{TRAP}(n)=\frac{\text{LEFT}(n)+\text{RIGHT}(n)}2\)

From previous EX

\(\text{LEFT}(2):\displaystyle\int_1^2\frac1xdx\approx\frac11(0.5)+\frac1{1.5}(0.5)\approx0.8\bar3\dots\) \(\text{RIGHT}(2):\displaystyle\int_1^2\frac1xdx\approx\frac1{1.5}(0.5)+\frac12(0.5)\approx0.58\bar3\dots\) \(\text{MID}(2):\displaystyle\int_1^2\frac1xdx\approx\frac1{1.25}(0.5)+\frac1{1.75}(0.5)\approx0.6857\dots\) \(\text{TRAP}(2):\displaystyle\int_1^2\frac1xdx\approx\frac{\frac11(0.5)+\frac1{1.5}(0.5)+\frac1{1.5}(0.5)+\frac12(0.5)}2\approx0.7083\dots\)

\(\text{ACTUAL}:\displaystyle\int_1^2\frac1xdx=\ln x\biggr|_1^2=\ln2-\ln1\approx0.6931\dots\)

We're estimating \(\int_a^bf(x)dx\) \(\text{LEFT}(n)\) is an underestimate if \(f\) is increasing on \([a,b]\), or an overestimate if \(f\) is decreasing or \([a,b]\).

\(\text{LEFT}(n)\) is an overestimate if \(f\) is increasing on \([a,b]\), or an underestimate if \(f\) is decreasing or \([a,b]\).

\(\text{TRAP}(n)\) is an overestimate if \(f\) is concave up on \([a,b]\), or an underestimate if \(f\) is concave down on \([a,b]\).

If the graph of \(f\) is concave down on \([a,b]\), \(\text{TRAP}(n)\le\int_a^bf(x)dx\le\text{MID}(n)\). If the graph of \(f\) is concave up on \([a,b]\), \(\text{MID}(n)\le\int_a^bf(x)dx\le\text{TRAP}(n)\).

\(\int)2^4\sqrt xdx\) Find \(\text{LEFT}(2)\), \(\text{RIGHT}(2)\), \(\text{MID}(2)\), \(\text{TRAP}(2)\). Which are under/overestimates?

\(\Delta x=\frac{4-2}2=\frac22=1\)

\(\text{LEFT}(2)=\sqrt2+\sqrt3\approx3.14626\dots\) \(\text{RIGHT}(2)=\sqrt3+\sqrt4\approx3.73205\dots\) \(\text{TRAP}(2)=\frac{\sqrt2+\sqrt3+\sqrt3+\sqrt4}2\approx3.43916\dots\) \(\text{MID}(2)=\sqrt{2.5}+\sqrt{3.5}\approx3.45197\dots\)

\(f'(x)=\frac1{2\sqrt x}>0\)

LEFT under RIGHT over TRAP under MID over

4.7 L'Hôpital's Rule, Growth, and Dominance

\(\displaystyle\lim_{x\rightarrow0}\frac{e^{2x}-1}x=?\frac{e^0-1}0=\frac{1-1}0=\frac00\)

\(y=e^{2x}-1\) \(y'=2e^2x\) \(y'(0)=2e^0=2\) Tangent line is \(2x\) \(y=x\) is tangent to \(y=x\)

\(\displaystyle\lim_{x\rightarrow0}\frac{e^{2x}-1}x\Rightarrow\lim_{x\rightarrow0}\frac{2x}{1x}=\frac21=2\)

L'Hôpital's Rule

Let \(a\) be either a real number or \(\pm\infty\). Suppose either 1) \(\lim_{x\rightarrow a}f(x)=\pm\infty\) AND \(\lim_{x\rightarrow a}g(x)=\pm\infty\); or 2) \(\lim_{x\rightarrow a}f(x)=\lim_{x\rightarrow a}g(x)=0\) Then, if \(f\) and \(g\) are differentiable, \(lim_{x\rightarrow a}\frac{f(x)}{g(x)}=\lim_{x\rightarrow a}\frac{f'(x)}{g'(x)}\), provided \(g'(x)\) exists

\(\lim_{x\rightarrow0}\frac{\sin x}x=\lim_{x\rightarrow0}\frac{\cos x}x\) \(\sin0=0\) \(\cos0=1\)

\(\lim_{t\rightarrow0}\frac{e^t-1-t}{t^2}\)

\(e^0-1-0=2-1=0\) \(0^2=0\)

\(\lim_{t\rightarrow0}\frac{(e^t-1-t)'}{(t^3)'}\) \(\lim_{t\rightarrow0}\frac{e^t-1}{2t}\)

\(e^0-1=0\) \(2(0)=0\)

\(\lim_{t\rightarrow0}\frac{(e^t-1)'}{(2t)'}=\lim_{t\rightarrow0}\frac{e^t}2=\frac{e^0}2=\frac12\)

\(\lim_{x\rightarrow\infty}\frac{5x+e^{-x}}{7x}\) \(\lim_{x\rightarrow\infty}5x+e^{-x}=\infty+0=\infty\)

Dominant term limits

Def:

Let \(f,g\) be positive as \(x\rightarrow\infty\). We say \(g\) dominates \(f\) if \(\lim_{x\rightarrow\infty}\frac{f(x)}{g(x)}=0\), or equivalently, \(\lim_{x\rightarrow\infty}\frac{g(x)}{f(x)}=\infty\)

Show that \(\sqrt x=x^\frac12\) dominates \(\ln x\) as \(x\rightarrow\infty\)

Ex:

\(\lim_{x\rightarrow\infty}\frac{\ln x}{x^\frac12}\) \(\lim_{x\rightarrow\infty}\ln x=\infty\) \(\lim_{x\rightarrow0^+}\ln x=-\infty\) \(\lim_{x\rightarrow\infty}x^\frac12=\infty\) \(\lim_{x\rightarrow\infty}\frac{\ln x}{x^\frac12}=\lim_{x\rightarrow\infty}\frac{(\ln x)'}{(\frac12x^\frac{-1}2)'}\) \(=\lim_{x\rightarrow\infty}2*\frac1x*x^\frac12\) \(=\lim_{x\rightarrow\infty}\frac2{x^\frac12}\) \(=0\)

Try: any exponential function dominates any polynomial function: \(\lim_{x\rightarrow\infty}\frac{x^{1000}}{0.0001^x}=\lim_{x\rightarrow\infty}\frac{1000x^999}{0.0001^x\ln(0.0001)}=\dots=\lim_{x\rightarrow\infty}\frac k{0.0001^x(l)}=0\) \(l\) being a constant.

After class notes:

Ex:

for l'hopital rule \(\displaystyle\lim_{x\rightarrow2}\frac{x^2-4}{x-2}=\lim_{x\rightarrow2}\frac{2x}1=4\)

Ex:

\(\displaystyle\lim_{x\rightarrow2}\frac{\sqrt{x+2}-2}{x-2}=\lim_{x\rightarrow2}\frac{\frac12(x+2)^\frac{-1}2}1=\frac12(2+2)^\frac{-1}2=\frac12(4)^\frac{-1}2=\frac12\left(\frac1{4^\frac12}\right)=\frac12*\frac12=\frac14\)

holy shit im tired