kill(all)$

intro 1 : Laplace Transformation 'residues '
peter.vlasschaert@gmail.com , 19/09/2017 ,version 1

residues : Laplace Transformation   to solve ' ODE  =  (O)rdinary (D)ifferential (E)quations'
Laurent expansion : f(z) is analytic inside and one simple closed curve C except at z=a 
                                      with a pole of  ' order n '
f(z) =a(-n) *1/(z-a)^n +....+a(-2)*1/(z-a)^2+a(-1)*1/(z-a)^1+a(0)+a(1)*(z-a)^1+.............
residue :  value before a(-1)
info: => schaum's outline series :theory and problems of laplace transformation
                Murray R.Spiegel
                ' complex variables '
         =>  REA :The complex variables problem solver 
                Emil G.Milewski,Ph.D.

why to compute : inverse laplace transform
=>   Menu => Calculus

no singularity at x=0 ,removed  (z=x ,a=0)

n1:taylor(sin(x)/x, x, 0, 8);

doesn't exit =>  a(-1)*1/x ,residue for x=0 => a(-1) = n2

n2:coeff(n1,x,-1);

kill(all)$

find the residue :F(z)=(cos(z)*cosh(z))/(z^3*sin(z)*sinh(z)) at z=0

method  1:

d:cos(x)*cosh(x)$
e:x^3*sin(x)*sinh(x)$
p:d/e;

m1:taylor(p, x, 0, 8);
m2:coeff(m1,x,-1);

method  2:

m3:residue(p,x,0);;

method 3: 
   

m4:x^5;
m41 : part(m4,2);

m5:m1*m4;

m6:m4*p;

m7:1/(m41-1)!*diff(m6,x,m41-1);

take to long to find limit x->0

kill(all)$
forget(x);

example : '  find residues ?   '    f(z) = (z^2-2*z)/((z+1)^2*(z^+4))

p1: (x^2-2*x);
p2:(x +1)^2*(x^2+4);
pp:p1/p2;

p3:find_root(p2, x, -1, 1);

p4:allroots(p2)$

p4[1];
p4[2];
p4[3];
p4[4];

p5:solve([p2], [x]);
p6:p5[1];
p7:p5[2];
p8:p5[3];

p9:gfactor(p2);
p10:gcfactor(p2);
p11:part(p2,1);
p12:part(p2,1,2);

from combination  p4 and p5 : double pole  = -1           => 'p12'
                                                          simple pole  = -2i ,+2i   => ' see above '
=> follows from , menu => simplify => Factor Complex 'p2'

simple poles 'pp'

pole : 2*i,-2*i

p13:residue(pp,x,rhs(p7));
p14:residue(pp,x,rhs(p6));

double pole : -1

p15:residue(pp,x,rhs(p8));

inverse laplace transformation :  f1 = 1/((s+1)*(s-2)^2)
 => very important   ' multiplication *e^(s*t) ' => find residue.
(reason :          Bromwich's integral formula ,F(t) = 0 for t<0)

method: 1
menu => calculus => inverse laplace transformation
                                  => laplace transformation

p16:1/((s+1)*(s-2)^2);

p17:ilt(p16, s, t);
p171:radcan(p17);

check :

p18:factor(radcan(laplace(p17, t, s)));

method:2 : double  pole : 2
                      simple  pole  :-1

p19:p16*%e^(s*t);

1e)  simple  pole : - 1
2e)  double pole :+ 2 

p20:residue(p19,s,-1);
p21:residue(p19,s,2);
p22:radcan(p20+p21);

check :  'p22' = 'p171'