Suppose you wanted to evaluate the following definite integral:so does anyone have a transform that gets fast enough convergence?/1
| 1
I= | cos(-) dx
| x
/0the idea is to try to evaluate it on a calculator. so far, no calculator i've tried will
handle the input as stated, so i'm looking for a manipulation or substitution
that will break down the problem or transform it into a do-able calculation
that will yield over 5 significant figures. a bit like some of the hp
manuals treated some difficault cases.But first: the answer!
We actually know the symbolic answer:
/x
1 | Sin(t)
I= x cos(-) + Si(x) + c where Si(x)=| ------ dt
x | t
/0therefore I = cos(1) + Si(1) - Si(x) and Si(x) = pi/2
lim x->inf lim ->infso I = -0.084410950559573886889
Now suppose we didn't know the above and wanted to evaluate the answer on a
calculator and i don't mean using the breakdown of `I' in terms of Si(x) and
calculating Si(1) on a calculator because this is cheating.let's try some substitions:
plan A: /inf
| cos(u)
u = 1/x, gives I = | ------ du
| 2
/1 uthis isn't any good either because of the `inf'. you can try numbers like 1000
for inf and get some of the answer. for example, on a 71b i (eventually) get
integral(1,1000,1e-5,cos(ivar)/ivar^2) = -0.0844101253838 which is correct to
the 5 figures i asked of it (ie 1e-5), but i didn't prove the remainder of the
integral was small enough to ignore and getting more than 5 this way would
be very tedious.
plan B: /pi/2
| cos(tan(y))
u = tan(y), gives I = | ----------- dy
| 2
/pi/4 sin(y)
now we get finite limits, but still the function oscillates so wildly,
there's insufficient calculator convergence. for instance,
integral(pi/4,pi/2,1e-3,cos(tan(ivar))/sin(ivar)^2) = -0.084561887...
after some time and this is still quite vague.
tricky definite integration
|
|
« Next Oldest | Next Newest »
|
▼
02-01-2006, 10:16 PM
▼
02-02-2006, 03:17 AM
Hugh,
you'll find this thread interesting: This beast is even worse: Integral between 0 and 1 of f(x) = Cos(Ln(x)/x)/x The trick is to integrate along a complex path where the trigonometric functions stop oscillating. Marcus
02-02-2006, 03:45 AM
Plan A is not so bad as you think, since we can find an upper bound for the remainer R=integral(cos(u)/u^2,1000,inf) : abs(R)<integral(1/u^2,1000,inf)=1/1000.
02-02-2006, 07:05 AM
Hi, Hugh:
The HP-71B can compute your integral as is, for instance let's get and display four decimal places: FIX 4 @ INTEGRAL(0,1,1E-4,COS(1/IVAR))but of course it's rather slow. The optimum way to compute it, exact analytic methods apart, is to do the integration in the complex plane, where your trigonometric function becomes just the real part of some complex exponential, and using a path of integration that mostly avoids the oscillations. A suitable change of variable before performing the complex integration might help as well, if the upper or lower limits are infinite. This is the standard "trick" and it does work. The integral then becomes much easier and can be computed to 12-digit accuracy in a matter of minutes (or seconds under Emu71). Best regards from V. ▼
02-03-2006, 03:37 AM
I am loking to refresh my memory on complex plane integration. Quite a few years ago, it was covered in my university maths course. Unfortunately it was on Friday afternoons so only remember it is very useful for tricky integral and that there are a few pitfalls in the selection of integration path. Any pointers to go and relearn this would be helpful. Thanks Arnaud
02-03-2006, 12:13 PM
thanks for your complex contour suggestion,
i decided to try out the contour approach. i was hoping to find a really
02-06-2006, 03:08 AM
Hello, I played with the Taylor-approximation of 1/Xfunction on my 48SX. Some results:
1/X = 1+SUM(I=1,INFINITY,(1-X)^I) = (1-(1-X)^(N+1))/X (where N is big enough, but not too ;) ) I know, this is not an elegant way, but I spend some time to play with it. I want only a fastest result. I wrote few versions of this method, finally the "PRG1" was the integrator with 'COS(INV(X))' intengrand, and "PRG2" was the integrator with 'COS((1-(1-X)^(N+1))/X)'. The big fault is the numerical error when the N is too big!
I tried some other way too: changing the boundaries of the interval from [0...1] to [1...H], where H->0, tried to integrate 1+COS(INV(X)), then substract 1 from the result (with this method no change sing on the interval), and so on...
|