How to collect

lemelinm's picture

Hi all,

 

I have

> y1 := sum(c[i]*x^(1/2+i), i = 0 .. 4);

                 (1/2)   1       (3/2)   3        (5/2)   5        (7/2)
     y1 := c[0] x      - - c[0] x      + -- c[0] x      - -- c[0] x     
                         2               16               96            

           35        (9/2)
        + ---- c[0] x     
          3072            

I want to collect

 

                 (1/2) 
     y1 := c[0] x      ( 1 - ............)
                       

Thanks for any help!

Mario

expand

The easiest way to do this is probably

C := c[0]*sqrt(x):
C*expand(y1/C);

Note that you should be using add rather than sum. Regardless, I don't understand why your computation has numerical coefficients; maybe you cut and pasted something else? Oh, I see, your c must have been defined in terms of c[0].  I'm surprised that worked, since c[0] is referenced...

gkokovidis's picture

Hack

Your sum does not output what you display below the code.   The code below does, without your coefficients in front of the c[0]'s.

>restart:

>y1 := sum(c[0]*x^(1/2+i), i = 0 .. 4);

>tmp1:=simplify(y1/(c[0]*x^(1/2)));

>ans:=c[0]*x^(1/2)*tmp1;

 

Check to see if it looks like the original:

>expand(%);
 

 

 

Regards,
Georgios Kokovidis
Dräger Medical


lemelinm's picture

Super Joe! Just a last one...

I found that my solution is:

> y1 := x^(1/2)*(sum(factorial(2*n)*(-(1/4)*x)^n/factorial(n)^3, n = 0 .. infinity));

                               (1/2)        /   1  \
                              x      BesselI|0, - x|
                                            \   2  /
                        y1 := ----------------------
                                        /1  \       
                                     exp|- x|       
                                        \2  /       
> diff(y1, x);

             /   1  \     (1/2)        /   1  \    (1/2)        /   1  \
      BesselI|0, - x|    x      BesselI|1, - x|   x      BesselI|0, - x|
             \   2  /                  \   2  /                 \   2  /
     ----------------- + ---------------------- - ----------------------
        (1/2)    /1  \              /1  \                    /1  \      
     2 x      exp|- x|         2 exp|- x|               2 exp|- x|      
                 \2  /              \2  /                    \2  /      

I[0] (that's what is appearing on my screen) is the modified Bessel function of the first kind of zero order.  So I assume that I[1] is the modified Bessel function of the first kind of order one.

Is there a link between them.  Sorry to ask here cause I don't have any books on specials functions.

Thanks in advance

acer's picture

FunctionAdvisor

Try issuing the FunctionAdvisor(BesselI) command. You may be interested in particular in the differentiation rule. And indeed you can also issue,

FunctionAdvisor(BesselI,"differentiation_rule");

which should corroborate this:

> diff(BesselI(0,f(x)),x);
                                           /d      \
                          BesselI(1, f(x)) |-- f(x)|
                                           \dx     /
 

acer

lemelinm's picture

Thank you Acer!

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}