Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
31 views
typeset_mode(true); #This command will cause all output to be pretty printed

Finding Approximations - Trapezoid Rule

  • Find the approximation T10T_{10} for the integral 03arctanxdx\displaystyle \int_0^3 \arctan x \rm{d}x

h=(3-0)/10 T_10=(h/2)*sum([arctan(i*h) if i==0 or i==10 else 2*arctan(i*h) for i in (0..10)]) n(T_10)
2.589071063326522.58907106332652
  • Estimate an upper bound for the error ETE_T using:

ETK(ba)312n2 |E_T| \leq \frac{K(b-a)^3}{12n^2}

f(x)=arctan(x) plot(f(x).diff(2),(x,0,3))

Based on the graph, it appears that f(x)<0.7|f''(x)|<0.7 for all x[0,3]x\in[0,3]

Thus we can compute an upper bound for ET|E_T|:

K=0.7 N(K*(3-0)^3/(12*10^2))
0.01575000000000000.0157500000000000
  • If possible, use the FTC to find the exact value of ETE_T

integrate(arctan(x),(x,0,3))
3arctan(3)12log(10)3 \, \arctan\left(3\right) - \frac{1}{2} \, \log\left(10\right)
N(integrate(arctan(x),(x,0,3)))
2.595844770697742.59584477069774
  • If no analytic technique were available to compute an exact answer, how large would nn have to be in order to ensure that ET<106|E_T|<10^{-6}?

n0=var('n0') K=0.7 a=0 b=3 solve(K*(b-a)^2/(12*n0^2)<10^-6,n0)
[[n0<50210],[n0>50210]]\left[\left[n_{0} < -50 \, \sqrt{210}\right], \left[n_{0} > 50 \, \sqrt{210}\right]\right]
N(50*sqrt(210))
724.568837309472724.568837309472

It appears that an nn of at least 725725 will gaurantee an error of less than 10610^{-6}

Finding Approximations - Simpson's Rule

  • Find the approximation S10S_{10} for the integral 03arctanxdx\displaystyle \int_0^3 \arctan x \rm{d}x

h=(3-0)/10 S_10=(h/3)*(sum([arctan(i*h) for i in [0,10]])+sum([2*arctan(i*h) if i%2==0 else 4*arctan(i*h) for i in (1..9)])) N(S_10)
2.595954057788902.59595405778890
  • Estimate an upper bound for the error ESE_S using:

ESK(ba)5180n4 |E_S| \leq \frac{K(b-a)^5}{180n^4}

Based on the graph (see line 23), it appears that f(x)<0.7|f''(x)|<0.7 for all x[0,3]x\in[0,3]

Thus we can compute an upper bound for ET|E_T|:

K=0.7 N(K*(3-0)^3/(180*10^4))
0.00001050000000000000.0000105000000000000
  • If possible, use the FTC to find the exact value of ESE_S

integrate(arctan(x),(x,0,3))
3arctan(3)12log(10)3 \, \arctan\left(3\right) - \frac{1}{2} \, \log\left(10\right)
N(integrate(arctan(x),(x,0,3)))
2.595844770697742.59584477069774
  • If no analytic technique were available to compute an exact answer, how large would nn have to be in order to ensure that ES<106|E_S|<10^{-6}?

n1=var('n1') K=0.7 a=0 b=3 solve(K*(b-a)^2/(180*n1^4)<10^-6,n1)
[[n1<55614],[n1>55614]]\left[\left[n_{1} < -5 \cdot 56^{\frac{1}{4}}\right], \left[n_{1} > 5 \cdot 56^{\frac{1}{4}}\right]\right]
N(5*56^(1/4))
13.677823998673813.6778239986738

It appears that an nn of at least 1414 will guarantee an error of less than 10610^{-6}