From: israel@math.ubc.ca (Robert Israel) Subject: Re: power series for ln(x+1) for x>1 Date: 26 Jan 1999 00:05:38 GMT Newsgroups: sci.math Keywords: Example of Chebyshev polynomial expansion In article <78gare$92c$1@eagle.cs.unc.edu>, denelsbe@cs.unc.edu (Kevin Denelsbeck) writes: |> I apologize if this is the wrong newsgroup for this question. |> |> I've been trying to find an approximation for log(x+1) for x in the |> range [0..19]. My first thought is to use the first few terms of a |> Taylor series. The Taylor series I've found in the usual texts are |> for ln(x+1) [so far so good] but are restricted to |x| < 1 [darned |> radius of convergence!]. My calculus is a bit rusty and I feel like |> I'm missing the "obvious way" of creating a power series that works |> for bigger values of x. Do I need to use some logarithm tricks? The Taylor series for log(x+1) in powers of x-9.5 converges for |x - 9.5| < 10.5. Note that if y = (x - 9.5)/10.5, log(x+1) = log(10.5 y + 10.5) = log(10.5) + log(y + 1) so knowing the series for log(y+1) in powers of y will do the trick. However, if you really want a good polynomial approximation for a function on a closed interval, try Chebyshev series rather than Taylor series. Robert Israel israel@math.ubc.ca Department of Mathematics http://www.math.ubc.ca/~israel University of British Columbia Vancouver, BC, Canada V6T 1Z2 ============================================================================== From: kovarik@mcmail.cis.McMaster.CA (Zdislav V. Kovarik) Subject: Re: power series for ln(x+1) for x>1 Date: 26 Jan 1999 03:01:22 -0500 Newsgroups: sci.math In article <78gare$92c$1@eagle.cs.unc.edu>, Kevin Denelsbeck wrote: >I apologize if this is the wrong newsgroup for this question. > Not wrong but one would find more informed advice in sci.math.num-analysis. >I've been trying to find an approximation for log(x+1) for x in the >range [0..19]. My first thought is to use the first few terms of a >Taylor series. The Taylor series I've found in the usual texts are >for ln(x+1) [so far so good] but are restricted to |x| < 1 [darned >radius of convergence!]. My calculus is a bit rusty and I feel like >I'm missing the "obvious way" of creating a power series that works >for bigger values of x. Do I need to use some logarithm tricks? > >Thanks for any assistance. > >Kevin Denelsbeck Let me first change the variable to what it probably was meant to be. Define parameters k, q by k = (20^(1/2) - 1) / (20^(1/2) + 1) q = (20^(1/4) - 1) / (20^(1/4) + 1) Given any y in [1, 20], calculate t = (1/k) * (y - 20^(1/2)) / (y + 20^(1/2)) so that -1 <= t <= 1 Then Chebyshev expansion reads ln y = (1/2)*ln(20) + 4 * sum[n=0 to infinity] (1/(2*n+1)) * q^(2*n+1) * T_(2*n+1)(t) where T_k is the k-th Chebyshev polynomial: T_k(t) = cos(k*arccos(t)) and the odd-indexed polynomials have a recursion T_(-1)(t) =t, T_1(t) = t, T_(2*k+1)(t) = (4*t^2-2) * T_(2*n-1)(t) - T_(2*n-3)(t). Note that the series is uniformly dominated by a geometric series with ratio q^2, which is about 0.1281. Hence it is easy to find an upper bound for the error of truncating the series after N terms. For efficient evaluation, a version of Clenshaw Scheme (three-term analogue of Horner's scheme) can be developed. Good luck, ZVK(Slavek).