# set of recursive equations with derivatives

I have the following set of recursive relations $c_{r,q+1}=\frac{\left(2z\partial_{z}+r+1\right)c_{r+1,q}}{d+r+q}$ and $zc_{r+2,q}=\frac{\left(q+r+d\right)c_{r+1,q}+\left(r+1\right)c_{r,q}}{d+r+q}$ and am trying to get Mathematica to output the solutions (not general solution) to the following set of recursive equations in terms of $c_{0,0}(z)$. Below I choose $c_{0,0}(z)=z$ and $c_{1,0}=1$ for example.

Clear[c]; c[0, 0] = z; c[1,0]=1;
c[r_, q_] := Expand[((r + 1) c[r + 1, q-1] + 2 z D[c[r + 1, q-1],
z])/( d + r + q-1)];
c[r_, q_ ] := Expand[ (( r-1) c[r-2, q] + c[ r-1,
q] (q + r-2 + d))/(z (d + r-2 + q))];


If I try to output, for example, c[1,2] (i.e. an example with small r and q), I get a 'recursion depth exceeded' error/warning. How do I use both the recursive equations together?

Edit- I see that I do get the recursion limit exceeded because the recursion relation above, as defined, needs c[r + 1, q-1] which is not available to the program. The other recursion relation needs to be used.

• Maybe you can insert the $c_{r+2,q}$ recursion into the $c_{r, q+1}$ recursion so that both recursions always reduce the total $r+q$. – Carl Woll Jul 14 '17 at 8:50
• D[c[r + 1, q-1], z] is zero. Is that your intent? – bbgodfrey Jul 14 '17 at 11:49
• Carl Woll, thanks. that's helpful. I didn't realize I could calculate an extra coefficient by hand and then combing the two relations would be straightforward. – cleanplay Jul 14 '17 at 16:18
• bbgodfrey, no, the derivative is not zero, in general. – cleanplay Jul 14 '17 at 16:19