예제·유제 · Examples & Exercises

예제 01 사다리꼴 근사로 정적분 근사
한국어

사다리꼴 근사를 이용하여 $\displaystyle\int_1^2 x^2\,dx$의 값을 근사하고자 한다.

  1. 구간을 4등분하여 직접 계산해 근사하시오.
  2. 구간을 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$11.251.51.752
$f(x_k)$11.56252.253.06254

사다리꼴 근사 공식 $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$이 커질수록 사다리꼴 근사의 정확도가 향상됨을 확인할 수 있다.

English

We wish to approximate the value of $\displaystyle\int_1^2 x^2\,dx$ using the Trapezoidal Rule.

  1. Divide the interval into 4 equal subintervals and compute the approximation by hand.
  2. 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$11.251.51.752
$f(x_k)$11.56252.253.06254

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.

유제 01 사인함수의 사다리꼴 근사
한국어

$\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)이므로 사다리꼴 근사가 실제값보다 작게 나오는 것과 일치하는 결과이다.

English

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.

예제 02 심프슨 공식으로 정적분 근사
한국어

심프슨 공식을 이용하여 $\displaystyle\int_0^2 5x^4\,dx$의 값을 근사하고자 한다.

  1. 구간을 4등분하여 직접 계산해 근사하시오.
  2. 구간을 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$00.511.52
$f(x_k)$00.3125525.312580

심프슨 공식 $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$과 사실상 일치하며, 심프슨 공식이 사다리꼴 근사보다 훨씬 빠르게 수렴함을 확인할 수 있다.

English

We wish to approximate the value of $\displaystyle\int_0^2 5x^4\,dx$ using Simpson's Rule.

  1. Divide the interval into 4 equal subintervals and compute the approximation by hand.
  2. 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$00.511.52
$f(x_k)$00.3125525.312580

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.

유제 02 오차함수 erf(1) 근사
한국어

함수 $\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$00.10.20.30.40.50.60.70.80.91.0
$f(t_k)$10.9900500.9607890.9139310.8521440.7788010.6976760.6126260.5272920.4448580.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}$ 수준이다.)

English

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$00.10.20.30.40.50.60.70.80.91.0
$f(t_k)$10.9900500.9607890.9139310.8521440.7788010.6976760.6126260.5272920.4448580.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}$.)

예제 03 심프슨 공식의 오차의 한계
한국어
  1. 심프슨 공식을 이용하여 구간을 4등분해 $\displaystyle\int_0^2 5x^4\,dx$의 값을 근사할 때, 오차의 한계를 구하시오.
  2. 심프슨 공식을 이용하여 구간을 $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$이다.

English
  1. 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.
  2. 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$.

유제 03 erf(1) 근사의 오차의 한계
한국어

$[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}$$ 이다.

English

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

문제 01 수영장 부피 근사
한국어

너비 5m, 길이 10m인 직사각형 모양의 수영장이 있다. 길이가 $x$m인 지점에서의 수영장의 깊이 $h(x)$(m)가 다음 표와 같이 주어졌을 때 수영장의 부피를 (1) 사다리꼴 방법을 이용해 (2) 심프슨 공식을 이용해 근사하여라. ($0 \leq x \leq 10$)

$x$012345678910
$h(x)$1.201.641.821.982.102.202.302.382.462.542.60
English

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$012345678910
$h(x)$1.201.641.821.982.102.202.302.382.462.542.60
문제 02 사인적분함수의 수렴속도 비교
한국어

함수 $\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$의 근삿값을 사다리꼴 근사와 심프슨 공식을 이용해 구하고 그 수렴속도를 비교하시오.

English

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.

문제 03 타원의 길이 근사
한국어

타원 $\displaystyle x^2 + \frac{y^2}{4} = 1$의 길이의 근삿값을 구하시오.

English

Find the approximate value of the length of the ellipse $\displaystyle x^2 + \frac{y^2}{4} = 1$.

문제 04 적분의 사다리꼴·심프슨 극한 표현
한국어

연속함수 $f(x)$에 대해 다음이 성립함을 보이시오.

  1. $\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}$)
  2. $\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}$)
English

Show that the following holds for a continuous function $f(x)$.

  1. $\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}$)
  2. $\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}$)