5
$\begingroup$

Please, I would like to calculate this function which contains an infinite continued fraction

f[y_]=1/(1 + ContinuedFractionK[-(((n + 1) (n + 3))/((2 n + 3) (2 n + 5))) y^2 A, 1, {n, 0, Infinity}])

But no results, Mathematica returns the same continued fraction.

function

Please, Is there a method to construct this infinite fraction and evaluate f[y]?

Many thanks.

$\endgroup$
3
$\begingroup$

This is correct, but because you have undefined A in the formula, it results in the expression. And, most likely, Mathematica can't find any simpler form for this expression either.

Compare this:

f[y_] := 
 1/(1 + ContinuedFractionK[-(((n + 1) (n + 3))/((2 n + 3) (2 n + 
             5))) y^2 A, 1, {n, 0, Infinity}])

f[1]
(* ...formula view... *)

f[1] /. A -> 1
(* 3/2 *)

(* with A = 1 *)
g[y_] := 
 1/(1 + ContinuedFractionK[-(((n + 1) (n + 3))/((2 n + 3) (2 n + 
             5))) y^2, 1, {n, 0, Infinity}])

g[1]
(* 3/2 *)

Or just define as a function of two variables:

h[y_, A_] := 
 1/(1 + ContinuedFractionK[-(((n + 1) (n + 3))/((2 n + 3) (2 n + 
             5))) y^2 A, 1, {n, 0, Infinity}])

h[1, 1]
(* 3/2 *)
$\endgroup$
1
3
$\begingroup$

Letting $t=A y^2$, we can simplify our considerations to the following function of one variable:

maj[t] == 1/(1 + ContinuedFractionK[-(((n + 1) (n + 3))/((2 n + 3) (2 n + 5))) t, 1,
                                     {n, 0, Infinity}])

Once again, the Lentz-Thompson-Barnett algorithm can be used for numerical evaluation:

maj[t_?InexactNumberQ] := Module[{a, c, d, e2, ee, f, h, k},
    ee = 10^(-Precision[t]); e2 = ee^2;
    f = c = 1; d = 0; k = 0;
    While[k++;
          a = -((k (k + 2))/((2 k + 1) (2 k + 3))) t;
          d = 1 + a d; If[d == 0, d = e2]; d = 1/d;
          c = 1 + a/c; If[c == 0, c = e2];
          f *= (h = c d);
          Abs[h - 1] > ee];
    1/f]

which can be plotted:

Plot[maj[t], {t, -3, 1}]

plot

Plot3D[maj[A y^2], {A, -2, 0}, {y, -1, 1}, Mesh -> None, PlotPoints -> 45]

3D plot

$\endgroup$
7
  • $\begingroup$ J. M., many thanks for your answer. Please can you explain me this algorithm? $\endgroup$
    – Majorana
    Apr 18 '20 at 16:00
  • $\begingroup$ I linked to the two papers explaining the evaluation method for your CF; please refer to them if you want to know details. $\endgroup$
    – J. M.'s torpor
    Apr 18 '20 at 16:03
  • $\begingroup$ J. M., thank you so much. Please, can you apply the same algorithm to this fraction 1/(1 + x y + ContinuedFractionK[(n (n + 1) I (x/B)) - (n (n + 2))/(4 (n + 1)^2 - 1)x^2 A, 1, {n, 1, Infinity}])? $\endgroup$
    – Majorana
    Apr 18 '20 at 16:15
  • $\begingroup$ That should prolly be a separate question. $\endgroup$
    – J. M.'s torpor
    Apr 18 '20 at 16:17
  • $\begingroup$ It's the same question but modified! $\endgroup$
    – Majorana
    Apr 18 '20 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.