Determining the input of a function given an output (Calculus involved) -


my calculus teacher gave program on calculate definite integrals of given interval using trapezoidal rule. know programmed functions take input , produce output arithmetic functions don't know how inverse: find input given output.

the problem states:

"use trapezoidal rule varying numbers, n, of increments estimate distance traveled t=0 t=9. find number d trapezoidal sum within 0.01 unit of limit (468) when n > d."

i've estimated limit through "plug , chug" calculator , know regular algebraic function, do:

limit (468) = algebraic expression variable x (then solve x)

however, how programmed function? how determine input of programmed function given output?

i calculating definite integral polynomial, (x^2+11x+28)/(x+4), between interval 0 , 9. trapezoidal rule function in calculator calculates definite integral between interval 0 , 9 using given number of trapezoids, n.

overall, want know how this:

solve n: 468 = trapezoidal_rule(a = 0, b = 9, n);

the code trapezoidal_rule(a, b, n) on ti-83:

prompt prompt b prompt n (b-a)/n->d 0->s a->x y1/2->s for(k,1,n-1,1) x+d->x y1+s->s end b->x y1/2+s->s sd->i disp "integral" disp 

because i'm not familiar syntax nor familiar computer algorithms, hoping me turn code algebraic equation or point me in direction so.

edit: not part of homework—just intellectual curiosity

the polynomial, (x^2+11x+28)/(x+4)

this equal x+7. trapezoidal rule should give exactly correct results function! i'm guessing isn't function you're working with...

there no general way determine, given output of function, input was. (for 1 thing, many functions can map multiple different inputs same output.)

so, there formula error when apply trapezoidal rule given number of steps given function, , use here work out value of n need ... (1) it's not terribly beautiful, , (2) doesn't seem reasonable thing expect when you're starting @ trapezoidal rule. i'd guess teacher wanted "plug , chug".

i don't know (see above) function you're integrating, let's pretend it's x^2+11x+28. i'll call f(x) below. integral of 0 9 940.5. suppose divide interval [0,9] n pieces. trapezoidal rule gives you: [f(0)/2 + f(1*9/n) + f(2*9/n) + ... + f((n-1)*9/n) + f(9)/2] * 9/n.

let's separate out contributions x^2, 11x, , 28. turns out trapezoidal approximation gives right result latter two. (exercise: work out why.) error trapezoidal rule same error you'd have got f(x) = x^2.

the actual integral of x^2 0 9 (9^3-0^3)/3 = 243. trapezoidal approximation [0/2 + 1^2+2^2+...+(n-1)^2 + n^2/2] * (9/n)^2 * (9/n). (exercise: work out why.) there's standard formula sums of consecutive squares: 1^2 + ... + n^2 = n(n+1/2)(n+1)/3. our trapezoidal approximation integral of x^2 (9/n)^3 times [(n-1)(n-1/2)n/3 + n^2/2] = (9/n)^3 times [n^3/3+1/6] = 243 + (9/n)^3/6.

in other words, error in case (9/n)^3/6 = (243/2) / n^3.

so, instance, error less 0.01 when (243/2) / n^3 < 0.01, same n^3 > 100*243/2 = 12150, true when n >= 23.

[edited add: haven't checked of algebra or arithmetic carefully; there may small errors. take you're interested ideas rather specific numbers.]


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -