예제·유제 · Examples & Exercises
사다리꼴 근사를 이용하여 $\displaystyle\int_1^2 x^2\,dx$의 값을 근사하고자 한다.
- 구간을 4등분하여 직접 계산해 근사하시오.
- 구간을 100등분하여 컴퓨터를 이용해 근삿값을 구하시오.
풀이.
(1) 구간 $[1,2]$를 4등분하면 $h = \dfrac{2-1}{4} = \dfrac14$이고, 분점은 $x_0=1, x_1=1.25, x_2=1.5, x_3=1.75, x_4=2$이다. $f(x)=x^2$의 값은 다음과 같다.
| $x_k$ | 1 | 1.25 | 1.5 | 1.75 | 2 |
|---|---|---|---|---|---|
| $f(x_k)$ | 1 | 1.5625 | 2.25 | 3.0625 | 4 |
사다리꼴 근사 공식 $T_n = h\left[\dfrac{f_0}{2} + f_1 + f_2 + \cdots + f_{n-1} + \dfrac{f_n}{2}\right]$에 대입하면 $$T_4 = \frac14\left[\frac12 + 1.5625 + 2.25 + 3.0625 + \frac42\right] = \frac14 \cdot 9.375 = 2.34375 = \frac{75}{32}$$ 이다. 실제값 $\displaystyle\int_1^2 x^2\,dx = \left[\frac{x^3}{3}\right]_1^2 = \frac73 \approx 2.3333$과 비교하면 근사가 잘 이루어졌음을 알 수 있다.
(2) 구간을 100등분하면 $h=0.01$이고, 컴퓨터를 이용해 계산하면 $$T_{100} \approx 2.333350$$ 이다. 이는 실제값 $\frac73 \approx 2.333333$에 훨씬 가까운 근삿값으로, $n$이 커질수록 사다리꼴 근사의 정확도가 향상됨을 확인할 수 있다.
We wish to approximate the value of $\displaystyle\int_1^2 x^2\,dx$ using the Trapezoidal Rule.
- Divide the interval into 4 equal subintervals and compute the approximation by hand.
- Divide the interval into 100 equal subintervals and find the approximate value using a computer.
Solution.
(1) Dividing $[1,2]$ into 4 equal subintervals gives $h = \dfrac{2-1}{4} = \dfrac14$, with partition points $x_0=1, x_1=1.25, x_2=1.5, x_3=1.75, x_4=2$. The values of $f(x)=x^2$ are as follows.
| $x_k$ | 1 | 1.25 | 1.5 | 1.75 | 2 |
|---|---|---|---|---|---|
| $f(x_k)$ | 1 | 1.5625 | 2.25 | 3.0625 | 4 |
Substituting into the Trapezoidal Rule $T_n = h\left[\dfrac{f_0}{2} + f_1 + f_2 + \cdots + f_{n-1} + \dfrac{f_n}{2}\right]$, $$T_4 = \frac14\left[\frac12 + 1.5625 + 2.25 + 3.0625 + \frac42\right] = \frac14 \cdot 9.375 = 2.34375 = \frac{75}{32}.$$ Comparing with the exact value $\displaystyle\int_1^2 x^2\,dx = \left[\frac{x^3}{3}\right]_1^2 = \frac73 \approx 2.3333$, we see that the approximation is quite accurate.
(2) Dividing the interval into 100 equal subintervals gives $h=0.01$, and computing with a computer yields $$T_{100} \approx 2.333350,$$ which is much closer to the exact value $\frac73 \approx 2.333333$, confirming that the accuracy of the Trapezoidal Rule improves as $n$ increases.
$\displaystyle\int_0^\pi \sin t\,dt$의 근삿값을 사다리꼴 근사를 이용해 구하시오.
풀이. 등분 개수 $n$이 주어지지 않았으므로 $n=4$로 사다리꼴 근사를 계산한다. 구간 $[0,\pi]$를 4등분하면 $h = \dfrac{\pi}{4}$이고, 분점은 $x_0=0, x_1=\frac{\pi}{4}, x_2=\frac{\pi}{2}, x_3=\frac{3\pi}{4}, x_4=\pi$이다. $f(t)=\sin t$의 값은 다음과 같다.
| $t_k$ | 0 | $\pi/4$ | $\pi/2$ | $3\pi/4$ | $\pi$ |
|---|---|---|---|---|---|
| $f(t_k)$ | 0 | $\sqrt2/2$ | 1 | $\sqrt2/2$ | 0 |
사다리꼴 근사 공식에 대입하면 $$T_4 = \frac{\pi}{4}\left[\frac{0}{2} + \frac{\sqrt2}{2} + 1 + \frac{\sqrt2}{2} + \frac{0}{2}\right] = \frac{\pi}{4}(1+\sqrt2) \approx 1.896119$$ 이다. 실제값 $\displaystyle\int_0^\pi \sin t\,dt = [-\cos t]_0^\pi = 2$와 비교하면 다소 오차가 있는데, $\sin t$가 $[0,\pi]$에서 위로 볼록(concave down)이므로 사다리꼴 근사가 실제값보다 작게 나오는 것과 일치하는 결과이다.
Find the approximate value of $\displaystyle\int_0^\pi \sin t\,dt$ using the Trapezoidal Rule.
Solution. Since the number of subintervals $n$ is not specified, we compute the Trapezoidal Rule with $n=4$. Dividing $[0,\pi]$ into 4 equal subintervals gives $h = \dfrac{\pi}{4}$, with partition points $x_0=0, x_1=\frac{\pi}{4}, x_2=\frac{\pi}{2}, x_3=\frac{3\pi}{4}, x_4=\pi$. The values of $f(t)=\sin t$ are as follows.
| $t_k$ | 0 | $\pi/4$ | $\pi/2$ | $3\pi/4$ | $\pi$ |
|---|---|---|---|---|---|
| $f(t_k)$ | 0 | $\sqrt2/2$ | 1 | $\sqrt2/2$ | 0 |
Substituting into the Trapezoidal Rule, $$T_4 = \frac{\pi}{4}\left[\frac{0}{2} + \frac{\sqrt2}{2} + 1 + \frac{\sqrt2}{2} + \frac{0}{2}\right] = \frac{\pi}{4}(1+\sqrt2) \approx 1.896119.$$ Comparing with the exact value $\displaystyle\int_0^\pi \sin t\,dt = [-\cos t]_0^\pi = 2$, there is some error; since $\sin t$ is concave (concave down) on $[0,\pi]$, the Trapezoidal Rule underestimating the true value is consistent with this result.
심프슨 공식을 이용하여 $\displaystyle\int_0^2 5x^4\,dx$의 값을 근사하고자 한다.
- 구간을 4등분하여 직접 계산해 근사하시오.
- 구간을 100등분하여 컴퓨터를 이용해 근삿값을 구하시오.
풀이.
(1) 구간 $[0,2]$를 4등분하면 $h=\dfrac{2-0}{4}=\dfrac12$이고, 분점은 $x_0=0,x_1=0.5,x_2=1,x_3=1.5,x_4=2$이다. $f(x)=5x^4$의 값은 다음과 같다.
| $x_k$ | 0 | 0.5 | 1 | 1.5 | 2 |
|---|---|---|---|---|---|
| $f(x_k)$ | 0 | 0.3125 | 5 | 25.3125 | 80 |
심프슨 공식 $S_n = \dfrac{h}{3}\left[f_0+4f_1+2f_2+4f_3+\cdots+4f_{n-1}+f_n\right]$에 대입하면 $$S_4 = \frac{1}{6}\left[0+4(0.3125)+2(5)+4(25.3125)+80\right] = \frac16(192.5) = 32.083333\cdots = \frac{385}{12}$$ 이다. 실제값 $\displaystyle\int_0^2 5x^4\,dx = \left[x^5\right]_0^2 = 32$와 비교하면 오차가 매우 작음을 알 수 있다.
(2) 구간을 100등분하면 $h=0.02$이고, 컴퓨터로 계산하면 $$S_{100} \approx 32.0000002$$ 이다. 실제값 $32$과 사실상 일치하며, 심프슨 공식이 사다리꼴 근사보다 훨씬 빠르게 수렴함을 확인할 수 있다.
We wish to approximate the value of $\displaystyle\int_0^2 5x^4\,dx$ using Simpson's Rule.
- Divide the interval into 4 equal subintervals and compute the approximation by hand.
- Divide the interval into 100 equal subintervals and find the approximate value using a computer.
Solution.
(1) Dividing $[0,2]$ into 4 equal subintervals gives $h=\dfrac{2-0}{4}=\dfrac12$, with partition points $x_0=0,x_1=0.5,x_2=1,x_3=1.5,x_4=2$. The values of $f(x)=5x^4$ are as follows.
| $x_k$ | 0 | 0.5 | 1 | 1.5 | 2 |
|---|---|---|---|---|---|
| $f(x_k)$ | 0 | 0.3125 | 5 | 25.3125 | 80 |
Substituting into Simpson's Rule $S_n = \dfrac{h}{3}\left[f_0+4f_1+2f_2+4f_3+\cdots+4f_{n-1}+f_n\right]$, $$S_4 = \frac{1}{6}\left[0+4(0.3125)+2(5)+4(25.3125)+80\right] = \frac16(192.5) = 32.083333\cdots = \frac{385}{12}.$$ Comparing with the exact value $\displaystyle\int_0^2 5x^4\,dx = \left[x^5\right]_0^2 = 32$, the error is very small.
(2) Dividing the interval into 100 equal subintervals gives $h=0.02$, and computing with a computer yields $$S_{100} \approx 32.0000002,$$ which is essentially equal to the exact value $32$, confirming that Simpson's Rule converges much faster than the Trapezoidal Rule.
함수 $\displaystyle\operatorname{erf}(x) = \frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}\,dt$를 오차함수(error function)라 한다.
심프슨 공식을 이용하여 $\operatorname{erf}(1)$의 근삿값을 구하시오.
풀이. 등분 개수가 주어지지 않았으므로 $n=10$으로 심프슨 공식을 계산한다. 구간 $[0,1]$을 10등분하면 $h=0.1$이고, 분점 $t_k = 0.1k\ (k=0,1,\dots,10)$에서 $f(t)=e^{-t^2}$의 값은 다음과 같다.
| $t_k$ | 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| $f(t_k)$ | 1 | 0.990050 | 0.960789 | 0.913931 | 0.852144 | 0.778801 | 0.697676 | 0.612626 | 0.527292 | 0.444858 | 0.367879 |
심프슨 공식에 대입하면 $$\int_0^1 e^{-t^2}\,dt \approx \frac{0.1}{3}\Big[(f_0+f_{10}) + 4(f_1+f_3+f_5+f_7+f_9) + 2(f_2+f_4+f_6+f_8)\Big]$$ $$= \frac{0.1}{3}\big[1.367879 + 4(3.740266) + 2(3.037901)\big] = \frac{0.1}{3}(22.404745) \approx 0.746825$$ 이다. 따라서 $$\operatorname{erf}(1) = \frac{2}{\sqrt\pi}\int_0^1 e^{-t^2}\,dt \approx \frac{2}{\sqrt\pi}(0.746825) \approx 0.842702$$ 이다. (참값은 $\operatorname{erf}(1)=0.8427008\cdots$로, 심프슨 근삿값 $0.842702$의 오차는 약 $10^{-6}$ 수준이다.)
The function $\displaystyle\operatorname{erf}(x) = \frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}\,dt$ is called the error function.
Find the approximate value of $\operatorname{erf}(1)$ using Simpson's Rule.
Solution. Since the number of subintervals is not specified, we compute Simpson's Rule with $n=10$. Dividing $[0,1]$ into 10 equal subintervals gives $h=0.1$, and at the partition points $t_k = 0.1k\ (k=0,1,\dots,10)$, the values of $f(t)=e^{-t^2}$ are as follows.
| $t_k$ | 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| $f(t_k)$ | 1 | 0.990050 | 0.960789 | 0.913931 | 0.852144 | 0.778801 | 0.697676 | 0.612626 | 0.527292 | 0.444858 | 0.367879 |
Substituting into Simpson's Rule, $$\int_0^1 e^{-t^2}\,dt \approx \frac{0.1}{3}\Big[(f_0+f_{10}) + 4(f_1+f_3+f_5+f_7+f_9) + 2(f_2+f_4+f_6+f_8)\Big]$$ $$= \frac{0.1}{3}\big[1.367879 + 4(3.740266) + 2(3.037901)\big] = \frac{0.1}{3}(22.404745) \approx 0.746825.$$ Therefore, $$\operatorname{erf}(1) = \frac{2}{\sqrt\pi}\int_0^1 e^{-t^2}\,dt \approx \frac{2}{\sqrt\pi}(0.746825) \approx 0.842702.$$ (The true value is $\operatorname{erf}(1)=0.8427008\cdots$, so the Simpson approximation $0.842702$ is accurate to about $10^{-6}$.)
- 심프슨 공식을 이용하여 구간을 4등분해 $\displaystyle\int_0^2 5x^4\,dx$의 값을 근사할 때, 오차의 한계를 구하시오.
- 심프슨 공식을 이용하여 구간을 $n$등분해 $\displaystyle\int_0^2 5x^4\,dx$의 값을 근사할 때, 오차의 한계가 $10^{-4}$보다 작아지도록 하는 $n$의 값을 하나 구하여라.
풀이. 심프슨 공식의 오차의 한계 공식은 $|E| \leq \dfrac{M(b-a)^5}{180n^4}$이다. 여기서 $M$은 $[a,b]$에서 $|f^{(4)}(x)|$의 최댓값이다.
$f(x)=5x^4$에 대해 $f'(x)=20x^3$, $f''(x)=60x^2$, $f'''(x)=120x$, $f^{(4)}(x)=120$이므로 $M=120$이다.
(1) $n=4$, $a=0,b=2$일 때 $$|E| \leq \frac{120 \cdot 2^5}{180 \cdot 4^4} = \frac{120 \cdot 32}{180 \cdot 256} = \frac{3840}{46080} = \frac{1}{12} \approx 0.0833$$ 이다.
(2) 오차의 한계가 $10^{-4}$보다 작아지려면 $$\frac{120\cdot 32}{180 n^4} \lt 10^{-4}$$ 이어야 하므로 $$n^4 \gt \frac{3840}{180 \times 10^{-4}} = 213333.3\cdots$$ 이다. $n$이 자연수이므로 $n^4$도 정수이어야 하고, 따라서 $n^4 \geq 213334$이다. $21^4=194481 \lt 213334$이고 $22^4=234256 \geq 213334$이므로, 조건을 만족하는 짝수 중 최소값은 $n=22$이다.
- Find the error bound when approximating the value of $\displaystyle\int_0^2 5x^4\,dx$ using Simpson's Rule, dividing the interval into 4 equal subintervals.
- Find a value of $n$ such that the error bound is less than $10^{-4}$ when approximating the value of $\displaystyle\int_0^2 5x^4\,dx$ using Simpson's Rule, dividing the interval into $n$ equal subintervals.
Solution. The error bound formula for Simpson's Rule is $|E| \leq \dfrac{M(b-a)^5}{180n^4}$, where $M$ is the maximum value of $|f^{(4)}(x)|$ on $[a,b]$.
For $f(x)=5x^4$, we have $f'(x)=20x^3$, $f''(x)=60x^2$, $f'''(x)=120x$, $f^{(4)}(x)=120$, so $M=120$.
(1) With $n=4$, $a=0,b=2$, $$|E| \leq \frac{120 \cdot 2^5}{180 \cdot 4^4} = \frac{120 \cdot 32}{180 \cdot 256} = \frac{3840}{46080} = \frac{1}{12} \approx 0.0833.$$
(2) For the error bound to be less than $10^{-4}$, we need $$\frac{120\cdot 32}{180 n^4} \lt 10^{-4},$$ which gives $$n^4 \gt \frac{3840}{180 \times 10^{-4}} = 213333.3\cdots.$$ Since $n$ is a natural number, $n^4$ must also be an integer, so $n^4 \geq 213334$. Since $21^4=194481 \lt 213334$ and $22^4=234256 \geq 213334$, the smallest even $n$ satisfying the condition is $n=22$.
$[0, 1]$에서 $\displaystyle\left|\frac{d^4}{dt^4}\left(e^{-t^2}\right)\right| \leq 12$가 성립한다.
이때 심프슨 공식을 이용하여 구간을 10등분해 $\operatorname{erf}(1)$의 값을 근사할 때 오차의 한계를 구하시오.
풀이. $\operatorname{erf}(1) = \dfrac{2}{\sqrt\pi}\displaystyle\int_0^1 e^{-t^2}\,dt$이므로, 심프슨 공식으로 $\displaystyle\int_0^1 e^{-t^2}\,dt$를 근사할 때의 오차의 한계에 $\dfrac{2}{\sqrt\pi}$를 곱하면 $\operatorname{erf}(1)$의 오차의 한계를 얻는다.
문제에서 $[0,1]$에서 $\left|\dfrac{d^4}{dt^4}\left(e^{-t^2}\right)\right| \leq 12$이므로 $M=12$이고, $n=10$, $a=0,b=1$이다. 심프슨 공식의 오차의 한계 공식 $|E| \leq \dfrac{M(b-a)^5}{180n^4}$에 대입하면 $$\left|\int_0^1 e^{-t^2}\,dt - S_{10}\right| \leq \frac{12 \cdot 1^5}{180 \cdot 10^4} = \frac{12}{1800000}$$ 이다. 따라서 $$|E_{\operatorname{erf}}| \leq \frac{2}{\sqrt\pi}\cdot\frac{12}{1800000} = \frac{24}{1.8\times10^6\sqrt\pi} \approx 7.52\times10^{-6}$$ 이다.
On $[0, 1]$, $\displaystyle\left|\frac{d^4}{dt^4}\left(e^{-t^2}\right)\right| \leq 12$ holds.
Find the error bound when approximating the value of $\operatorname{erf}(1)$ using Simpson's Rule, dividing the interval into 10 equal subintervals.
Solution. Since $\operatorname{erf}(1) = \dfrac{2}{\sqrt\pi}\displaystyle\int_0^1 e^{-t^2}\,dt$, multiplying the error bound for approximating $\displaystyle\int_0^1 e^{-t^2}\,dt$ by Simpson's Rule by $\dfrac{2}{\sqrt\pi}$ gives the error bound for $\operatorname{erf}(1)$.
Since $\left|\dfrac{d^4}{dt^4}\left(e^{-t^2}\right)\right| \leq 12$ on $[0,1]$, we have $M=12$, with $n=10$, $a=0,b=1$. Substituting into the error bound formula $|E| \leq \dfrac{M(b-a)^5}{180n^4}$ for Simpson's Rule, $$\left|\int_0^1 e^{-t^2}\,dt - S_{10}\right| \leq \frac{12 \cdot 1^5}{180 \cdot 10^4} = \frac{12}{1800000}.$$ Therefore, $$|E_{\operatorname{erf}}| \leq \frac{2}{\sqrt\pi}\cdot\frac{12}{1800000} = \frac{24}{1.8\times10^6\sqrt\pi} \approx 7.52\times10^{-6}.$$
문제 · Problems
너비 5m, 길이 10m인 직사각형 모양의 수영장이 있다. 길이가 $x$m인 지점에서의 수영장의 깊이 $h(x)$(m)가 다음 표와 같이 주어졌을 때 수영장의 부피를 (1) 사다리꼴 방법을 이용해 (2) 심프슨 공식을 이용해 근사하여라. ($0 \leq x \leq 10$)
| $x$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| $h(x)$ | 1.20 | 1.64 | 1.82 | 1.98 | 2.10 | 2.20 | 2.30 | 2.38 | 2.46 | 2.54 | 2.60 |
There is a rectangular swimming pool 5 m wide and 10 m long. Given that the depth $h(x)$ (m) of the pool at the point $x$ m along its length is as shown in the table below, approximate the volume of the pool (1) using the Trapezoidal Rule and (2) using Simpson's Rule. ($0 \leq x \leq 10$)
| $x$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| $h(x)$ | 1.20 | 1.64 | 1.82 | 1.98 | 2.10 | 2.20 | 2.30 | 2.38 | 2.46 | 2.54 | 2.60 |
함수 $\displaystyle\operatorname{Si}(x) = \int_0^x \frac{\sin t}{t}\,dt$를 사인적분함수(sine-integral function)라 한다.
$\displaystyle\int_0^{\pi/2} \frac{\sin t}{t}\,dt$의 근삿값을 사다리꼴 근사와 심프슨 공식을 이용해 구하고 그 수렴속도를 비교하시오.
The function $\displaystyle\operatorname{Si}(x) = \int_0^x \frac{\sin t}{t}\,dt$ is called the sine-integral function.
Find the approximate value of $\displaystyle\int_0^{\pi/2} \frac{\sin t}{t}\,dt$ using the Trapezoidal Rule and Simpson's Rule, and compare their rate of convergence.
타원 $\displaystyle x^2 + \frac{y^2}{4} = 1$의 길이의 근삿값을 구하시오.
Find the approximate value of the length of the ellipse $\displaystyle x^2 + \frac{y^2}{4} = 1$.
연속함수 $f(x)$에 대해 다음이 성립함을 보이시오.
- $\displaystyle\int_a^b f(x)\,dx = \lim_{n \to \infty} \sum_{k=1}^n \frac{f(x_{k-1}) + f(x_k)}{2}\,\Delta x$ (단, $x_k = a + k\Delta x$, $\Delta x = \dfrac{b-a}{n}$)
- $\displaystyle\int_a^b f(x)\,dx = \lim_{n \to \infty} \sum_{k=1}^n \frac{f(x_{2k-2}) + 4f(x_{2k-1}) + f(x_{2k})}{3}\,\Delta x$ (단, $x_k = a + k\Delta x$, $\Delta x = \dfrac{b-a}{2n}$)
Show that the following holds for a continuous function $f(x)$.
- $\displaystyle\int_a^b f(x)\,dx = \lim_{n \to \infty} \sum_{k=1}^n \frac{f(x_{k-1}) + f(x_k)}{2}\,\Delta x$ (where $x_k = a + k\Delta x$, $\Delta x = \dfrac{b-a}{n}$)
- $\displaystyle\int_a^b f(x)\,dx = \lim_{n \to \infty} \sum_{k=1}^n \frac{f(x_{2k-2}) + 4f(x_{2k-1}) + f(x_{2k})}{3}\,\Delta x$ (where $x_k = a + k\Delta x$, $\Delta x = \dfrac{b-a}{2n}$)