Calculate derivatives recursively?
- To: mathgroup at smc.vnet.net
- Subject: [mg17722] Calculate derivatives recursively?
- From: bcrain at gmu.edu (Ben Crain)
- Date: Tue, 25 May 1999 02:15:10 -0400
- Organization: George Mason University, Fairfax, Virginia, USA
- Sender: owner-wri-mathgroup at wolfram.com
Can't figure out how to get Mathematica to calculate derivatives of a function recursively. I have a general function of 2 variables: f(k,y). It's first derivative, in terms of y, is defined recursively by: d/dy f(k+2,y) = -4k* f(k+3,y) / f(4,y) + k(k+3)*f(k+2,y), starting at k=2. Now I want to calculate higher derivatives, starting with the second and going up to as high as 20 or so, using this recursion formula. The first few you could do by hand, but it soon gets unwieldly. Consider the second derivative: I want Mathematica to differentiate the right-hand side of the equation above, symbolically, getting an expression involving first derivatives of f(k+3,y), etc. And then substitute, for each of those derivatives, its equivalent expression in terms of f( ) alone, using the recursion above. (So the first derivative of f(k+3,y) would be -4(k+1)*f(k+4)/f(4,y) + (k+1)(k+4)*f(k+3,y), etc.) And then on to higher derivatives. Having gotten M. to differentiate the rhs, how can I get it to make the required substitutions? Thanks, Ben Crain bcrain at gmu.edu