# Finding a function/differential equation from a 2nd order recurrence relation

Consider the following 2nd order recurrence relation:

$$A_{1}=1,\; A_{2}=z$$

$$A_{n+2}(z)=(b_n+z)A_{n+1}(z)+a_nA_{n}(z),\; n=1,2,3,...$$

where,

$$b_n=n\left(n+m+\frac{1}{2}\right),\; a_n=k^2n\left(n-\frac{1}{2}\right)$$

where $k\neq 0 \in \mathbb{R},m \in \mathbb{Z}$ are constants

What I want to find is $$f(z) \equiv \lim_{n \to \infty}A_n(z)$$

This will be an infinite series. I want to find the function $f(z)$ either in explicit form or a solution to a differential equation.

Naive attempt:

ClearAll["Global*"];
sol[z_]:= RSolveValue[{A[n + 2] == (n (n + m + 1/2) + z) A[n + 1] +
k^2 n (n - 1/2) A[n], A == 1, A == z}, A[n], n]


This gives a DifferenceRoot object that I am not able to make much use of.

Edit 1:

As finding explicit $f(z)$ might be too much to ask for, I will be happy to know just how to efficiently determine the zeros of $f(z)$ for a fixed $k$(say $k=1$) and $m$ going from $m=0,\pm 1,\pm2,...,\pm10$ of $f(z)$ with $|z|<500$.

Edit 2:

As numerical estimation seems to be the only way out for now, I have opened a new question that is closer to my eventual goal: Zeros of a rational fraction sequence This post shall be updated if some analytic way is found.

• This is a rather non-trivial problem. Do you have any reason to expect an analytic solution exists at all? I believe this question should be asked on math.SE first; and here only if the solution is confirmed to exist and be expressible in closed-form in terms of known functions. – AccidentalFourierTransform Jun 3 '18 at 17:47
• If k=0 then f[z]=Infinty or -Infinity for all $z$ – Mariusz Iwaniuk Jun 3 '18 at 18:04
• @AccidentalFourierTransform I have asked similar questions on both MSE and Math Overflow, but of no avail. – Subho Jun 3 '18 at 18:06
• @MariuszIwaniuk k is strictly non-zero in my case. – Subho Jun 3 '18 at 18:06
• @Subho95 well, if mathematicians cannot solve this problem, it's unlikely you'll find a solution here. Are you interested in a numerical approach? Did you try to do it yourself? A preliminary analysis suggests that $A_n(z)$ diverges as $n\to\infty$ for generic values of $k,m$. Is there any constraint on these parameters? – AccidentalFourierTransform Jun 3 '18 at 18:26

Only a numerical approximation:

EDITED:

f[z_, m_, k_, inf_] := Last@RecurrenceTable[{A[n + 2] == (n (n + m + 1/2) + z) A[n + 1] +
k^2 n (n - 1/2) A[n], A == 1, A == z}, A[n], {n, 1, inf}];

tab=Table[{m, z /. NSolve[f[z, m, 1, 20] == 0 && RealAbs[z] < 500, z,
Reals]}, {m, -10, 10, 1}];(* Assume k=1 and inf=20 !!! *)


Visualisation on plots:

Show[ListPlot /@ (Tuples[{{#[]}, #[]}] & /@ tab), PlotRange -> All] Or:

 Show[ListPlot /@ (Tuples[{#[], {#[]}}] & /@ tab), PlotRange -> All] for: k=10,inf=25,m in range {-20,20} we see a patterns. • This is fine. This is kind of expected as this function will behave nicely only at select values of z in the large n limit. I am looking for the zeros ultimately as I mentioned in the comment earlier. – Subho Jun 3 '18 at 18:44
• The zeros should ultimately converge which is what is happening. – Subho Jun 3 '18 at 18:49
• I was trying to visualize by Show[ListPlot /@ (Tuples[{{#[]}, #[]}] & /@ <output of Table>)]`, but the positive axis gets cut off. Suggestions for fix? – Subho Jun 3 '18 at 19:41
• @Subho95. I edited my answer. – Mariusz Iwaniuk Jun 4 '18 at 9:36
• I have opened a related question today: mathematica.stackexchange.com/questions/174554/… – Subho Jun 4 '18 at 9:40