def is_analytic(f,z=var('z')):                     # f is a function of z(complex variable)
         x,y,u,v=var('x,y,u,v',domain=RR)
         z=x + i*y
         f=f.subs(z=x + i*y)
         f=expand(f)
         u=f.real()
         v=f.imag()
         ux=diff(u,x)
         uy=diff(u,y)
         vx=diff(v,x)
         vy=diff(v,y)
         L=ux-vy+uy+vx
         if L==0:
                print 'True',
         else: 
                print 'False'
         return
is_analytic(f)                                    # input your function directly in terms of z

SageDays/Kreyszig-12.4-1 to 12 (last edited 2010-08-16 08:56:12 by hardikgajera)