- #1
opus
Gold Member
- 717
- 131
Homework Statement
Approximate each integral using the trapezoidal rule using the given number for ##n##.
##\int_1^2 \frac{1}{x}dx## where ##n=4##
Homework Equations
Trapezoidal Approximation "Rule":
Let ##[a,b]## be divided into ##n## subintervals, each of length ##Δx##, with endpoints at ##P={x_0,x_1,x_2,...x_n}##
Set ##T_n=\frac{1}{2}Δx\left[f(x_0)+2f(x_1)+2f(x_2)+...+2f(x_{n-1})+f(x_n)\right]##
Then,
##\lim_{n \rightarrow +\infty}T_n = \int_a^b f(x)dx##
The Attempt at a Solution
(i) ##n=4## and my intervals lengths are ##Δx=\frac{b-a}{n}=\frac{1}{4}##
(ii) ##\int_1^2 \frac{1}{x}dx ≈ \frac{1}{2}⋅\frac{1}{4}\left[f(1)+2f(1/4)+2f(1/2)+2f(3/4)+f(2)\right]##
##f(1)=1##
##2f(1/4)=8##
##2f(1/2)=4##
##2f(3/4)=\frac{8}{3}##
##f(2)=\frac{1}{2}##
Plugging the values into ##T_n##, I get ##\int_1^2 \frac{1}{x}dx ≈ 2.02##
The correct solution is 0.697, and I can't for the life of me see where I went wrong.
Could I get an extra pair of eyes on this?