       Re: Simplify by Recurrence Relations

• To: mathgroup at smc.vnet.net
• Subject: [mg75756] Re: Simplify by Recurrence Relations
• From: dimitris <dimmechan at yahoo.com>
• Date: Thu, 10 May 2007 05:06:03 -0400 (EDT)
• References: <f1s3n1\$h2g\$1@smc.vnet.net>

```Hello Ajit.

As always your queries are very good and make me think.
(and I learn/recall a couple of things!)

So...

What you want can be achieved as follows:

BTW since you were interested in the function convert of another CAS
in Mathematica you can try

In:=
FullSimplify[BesselJ[n, x], ComplexityFunction -> (If[Head[#1] ===
BesselJ, 1, 0] & )]

Out=
(x^n*Hypergeometric0F1Regularized[1 + n, -(x^2/4)])/2^n

End of parenthesis

Before adding a rule for a built in command, you must first unprotect
it.

In:=
Attributes[BesselJ]

Out=
{Listable, NumericFunction, Protected}

In:=
Unprotect[BesselJ];

Now

In:=
Attributes[BesselJ]

Out=
{Listable,NumericFunction}

It is time to add the rule

In:=
BesselJ[n_, z_] := 2*(n/z)*BesselJ[n - 1, z] - BesselJ[n - 2, z] /; n
>= 2

In this way

In:=
(BesselJ[#1, z] & ) /@ Range
(Collect[#1, {BesselJ[0, z], BesselJ[1, z]}] & )[%]

Out=
{BesselJ[1, z], -BesselJ[0, z] + (4*BesselJ[1, z])/z, -BesselJ[1, z] +
(6*(-BesselJ[0, z] + (4*BesselJ[1, z])/z))/z,
BesselJ[0, z] - (4*BesselJ[1, z])/z + (8*(-BesselJ[1, z] + (6*(-
BesselJ[0, z] + (4*BesselJ[1, z])/z))/z))/z,
BesselJ[1, z] - (6*(-BesselJ[0, z] + (4*BesselJ[1, z])/z))/z +
(10*(BesselJ[0, z] - (4*BesselJ[1, z])/z + (8*(-BesselJ[1, z] +
(6*(-BesselJ[0, z] + (4*BesselJ[1, z])/z))/z))/z))/z}

Out=
{BesselJ[1, z], -BesselJ[0, z] + (4*BesselJ[1, z])/z, -((6*BesselJ[0,
z])/z) + (-1 + 24/z^2)*BesselJ[1, z],
(1 - 48/z^2)*BesselJ[0, z] + (192/z^3 - 12/z)*BesselJ[1, z], (-(480/
z^3) + 16/z)*BesselJ[0, z] +
(1 + 1920/z^4 - 144/z^2)*BesselJ[1, z]}

and so on.

Watch the desirable factoring and the rule is not applied for n<2. The
role of n>=2, because otherwise
\$RecursionLimit::reclim messeges "fill" the screen! (Which is normal
of course.)

In:=
(D[BesselJ[#1, z], z] & ) /@ Range
(Collect[#1, {BesselJ[0, z], BesselJ[1, z]}] & )[%]

Out=
{(1/2)*(2*BesselJ[0, z] - (4*BesselJ[1, z])/z), BesselJ[1, z] -
(4*BesselJ[1, z])/z^2 +
(2*(2*BesselJ[0, z] - (4*BesselJ[1, z])/z))/z, (1/2)*(-2*BesselJ[0,
z] + (4*BesselJ[1, z])/z) -
(6*(-BesselJ[0, z] + (4*BesselJ[1, z])/z))/z^2 +
(6*(BesselJ[1, z] - (4*BesselJ[1, z])/z^2 + (2*(2*BesselJ[0, z] -
(4*BesselJ[1, z])/z))/z))/z}

Out=
{BesselJ[0, z] - (2*BesselJ[1, z])/z, (4*BesselJ[0, z])/z + (1 - 12/
z^2)*BesselJ[1, z],
(-1 + 30/z^2)*BesselJ[0, z] + (-(96/z^3) + 8/z)*BesselJ[1, z]}

and so on!

Regards
Dimitris

=CF/=C7 Mr Ajit Sen =DD=E3=F1=E1=F8=E5:
> Dear Mathgroup,
>
>   Could someone please show me how to simplify a
>   function by using its recurrence relations.
>
>   As a simple example, let's take the Bessel
> recurrence
>   relation
>
>      BesselJ[n+1,z]= 2n/z BesselJ[n,z]-BesselJ[n-1,z].
>
>   How do I get Mathematica (5.2 !) to evaluate
>
>                D[BesselJ[2,x],x]
>
>   as   (1-4/x^2)BesselJ[1,x]+ 2/x BesselJ[0,x]
>
>
>   [Basically, reduce the order to 0 &/or 1, so that
> all
>   J0 and J1 can be factored out later.]
>
>
>   Ajit.
>
>
>
>
> ___________________________________________________________
> To help you stay safe and secure online, we've developed the all new Yaho=
o! Security Centre. http://uk.security.yahoo.com

```

• Prev by Date: Re: How to get sqrt(Year^2)===Year?
• Next by Date: Re: How to get sqrt(Year^2)===Year?
• Previous by thread: Re: Simplify by Recurrence Relations
• Next by thread: Re: Simplify by Recurrence Relations