Re: pitfall in analytic function
- To: mathgroup at smc.vnet.net
- Subject: [mg41432] Re: [mg41411] pitfall in analytic function
- From: Bobby Treat <drmajorbob+MathGroup3528 at mailblocks.com>
- Date: Mon, 19 May 2003 05:13:21 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I don't understand the error message I'm getting from Integrate (a bug, I think), but here's a way past the problem. First I figure out what the series expansion about 2 is. Here I have skipped ahead to verifying the answer for terms of order 2 and higher: series = Series[expr, {z, 2, 5}]; SeriesCoefficient[series, #] & /@ Range[0, 5]; Divide @@@ Partition[%, 2, 1]; Simplify[(SeriesCoefficient[series, #1]/((4*Log[2]^(1 + #1))/(1 + #1)!) &) /@ Range[2, 5]] {1, 1, 1, 1} Hence the coefficients are: ClearAll@coeff coeff[n : (0 | 1)] := coeff[n] = SeriesCoefficient[series, n] coeff[n_Integer] /; n > 1 := (4*Log[2]^(1 + n))/(1 + n)! Now we integrate the power terms: y[n_] = Simplify[Integrate[(z - 2)^n, {z, 0, x}]] and build the n-th order approximation to our indefinite integral: seriesSum[k_Integer] /; k > 0 := Sum[y[n]coeff[n], {n, 0, k}] /. x -> z; This graphs a few approximations: Plot[Evaluate[seriesSum /@ Range[3, 5]], {z, 0, 4}]; and this shows the 7th term: Plot[y[#]coeff[#], {x, 0, 4}, PlotRange -> All] &@7; With a little work, you can figure out the error bound. For numerical purposes, you can truncate at a suitable order, say n, and substitute seriesSum[20] for your y1. Note that in your post, y1 was defined with x as upper limit and also as variable of integration. THAT can't be right! I've made seriesSum[n] a function of the upper limit z. If you must have a closed-form symbolic integral, maybe somebody else will help you with that. Bobby -----Original Message----- From: Narasimham G.L. <google.news.invalid at web2news.net> To: mathgroup at smc.vnet.net Subject: [mg41432] [mg41411] pitfall in analytic function I tried to integrate a transcendental function having factor (x-2), analytic on the whole line, even at x=2, but unable to get through with the smooth function at x=2.The following Mathematica prgram was run, and although at x=2 it is a smooth plot ( minimum value is around -1.204 at x=2.1), it proves to be a stumbling block in performing integration. Plot [ (2^x-x^2)/(x-2), { x,0,4 }] y1=Integrate [(2^x-x^2)/(x-2),{x,0,x}] Plot[y1 ,{x,0, 4} ]; y2= -2 x - x^2/2 + 4 ExpIntegralEi[-2 Log[2] + x Log[2]] - 4 (ExpIntegralEi[-2 Log[2]] - Log[2]) - 4 Log[2 - x]; Plot[y2 ,{x,2.1, 4} ]; Plot[y2 ,{x,0, 4} ]; All integrates terminate at x=2. I like to treat a smooth analytic continuous function in the normal way. Failure to do so negates smoothness, continuity and analyticity, it would appear. How to circumvent this problem? Thanks for suggestions to overcome this problem. -- Posted via http://web2news.com To contact in private, remove n-2oospam