Chebyshev second derivative question
Numerical Recipes gives the algorithm for the first derivative of a Chebyshev polynomial. I would also like to find the second derivative. The recurrence for the second derivative of T is:
T[0]''(x) = 0
T[1]''(x) = 0
T[i]''(x) = 2xT[i-1]''(x) + 4T[i-1]'(x) - T[i-2]''(x), i > 1
How can I use this recurrence with the coefficients c[i] (which I have) to obtain the second derivative?
Thanks!
By second derivative, what do you mean? the second derivative of the Chebyshev polynomials themselves, or the second derivative of the Chebyshev-approximated function?
If it is the second derivative of the Chebyshev polynomial, you may want to take a look at this site:
http://functions.wolfram.com/Polynomials/ChebyshevT/20/01/01/
Hope this helps.
Jan M. (^_^)
I would like to find the second derivative of the approximated function, using the recurrence for the second derivative of the Chebyshev polynomial given in my first message.
Do I just divide the evaluated Chebyshev polynomial second derivative by the square of half the range of x across the Chebyshev interval of [-1,1] (in other words, divide by dx^2 / 4)?
TMcCloskey
09-01-2004, 11:29 AM
zeno
Do you need the coefficients explicitly, or do you just need to compute the value of the second derivative at select points (the latter can be done efficiently in nested form using the original coefficients)
I have the coefficients, and I have the recurrence for the second derivative.
So, I would like to find out how to get the second derivative of the original (non-normalized) function. If for example the range of possible values of x in the original function is dx, do I multiply the result from the recursion (sum of c[i] * T''[i]) by (dx/2)^2 to get the second derivative of the original function at the evaluated point?
In that case, I think you could use Clenshaw's recurrence for your function. I think you wouldn't need to multiply by some twiddle factor except the scaling transformation mentioned in the NR book.
This is in effect, taking the analytic derivative of the Chebyshev approximant.
Hope this helps.
Jan M. (^_^)
You have to multiply by something, because the normalized Chebyshev range of x is [-1,1] whereas the original function values are usually not just within [-1,1] -- they have to be normalized to that range. Clenshaw's Recurrence is just an efficient way of evaluating the polynomial recursion. You'll still get the same answer, just faster.
I think what you would have to multiply for the second derivative of the original function is the square of half the original range, covering [0,1]. Does anyone know for certain?
Let's do some analysis. The Chebyshev approximation for a function over the interval {a, b} is given by
sum(c[k]* T(k, (2x - (a + b))/(b - a)), k, 0, m - 1) - c[0]/2
If we'll take the first derivative w.r.t. x, we get
2*sum(c[k]*T'(k, (2x - (a + b))/(b - a)), k, 0, m - 1)/(b - a)
or since T(0, x) = 1,
2*sum(c[k]*T'(k, (2x - (a + b))/(b - a)), k, 1, m - 1)/(b - a)
For the second derivative, we get
4*sum(c[k]*T"(k, (2x - (a + b))/(b - a)), k, 1, m - 1)/(b - a)^2
or in terms of lower derivatives,
4*sum(c[k]*k(k*T(k, y) -y*T'(k, y)/k)/(y^2 - 1), k, 1, m - 1)/(b - a)^2
= 4*sum(c[k]*(k^2*T(k, y) -y*T'(k, y)), k, 1, m - 1)/((y^2 - 1)(b - a)^2)
where y = (2x - (a + b))/(b - a)).
I was wrong about the twiddle factor, I forgot to take the normalization into account when I took the analytic derivative of the Chebyshev series by hand. From the looks of things, the multiplication is actually by 4/(b - a)^2 = (2/(b - a))^2.
Sorry about that. (~_^) Hope this clears things up.
Jan M. (^_^)
P.S. Clenshaw will still work. I suppose you could use the recurrence you presented in your first post.
Jaje, thanks! The (2 / delta x)^2 was what I suspected, but I didn't see how to work out a proof from the recursion.
Glad to be of help!
Jan M. (^_^)