## Cauchy-Riemann test of analyticity of a complex fu...

Asked by:

The CauchyRiemann procedure (for older version  of Maple )doesn't work quite right in Maple 2024 .
Also ran the procedure through the AI for so-called code improvement and now it shows what the code stands for
The output according to the original procedure would look like on the screenshot, but running original procedure does not give this output ?
I also want to extend the procedure with a plot of the complex function.
That differentiability of complex functions is not obvious even if the cauchy-riemann equation is satisfied ?

 >
 (1)
 >
 > CauchyRiemann:=proc(expr::algebraic) # original procedure   local x, y, u, v, u_x, u_y, v_x, v_y, flag1, flag2;   u:=evalc(Re(eval(expr, z=x+I*y)));   v:=evalc(Im(eval(expr, z=x+I*y)));   u_x:=diff(u,x);   u_y:=diff(u,y);   v_x:=diff(v,x);   v_y:=diff(v,y);   print('f(z)'=expr);   printf("\n");      print('u(x,y)'=u);   print('u[x](x,y)'=u_x);   print('u[y](x,y)'=u_y);   printf("\n");   print('v(x,y)'=v);   print('v[x](x,y)'=v_x);   print('v[y](x,y)'=v_y);   printf("\n");   if u_x=v_y then     print('u[x]=v[y]');     print(u_x=v_y);     flag1:=true;   else     print('u[x]<>v[y]');     print(u_x<>v_y);     flag1:=false;   end if;   if u_y=-v_x then     print('u[y]=-v[x]');     print(u_y=-v_x);     flag2:=true;   else     print('u[y]<>-v[x]');     print(u_y<>-v_x);     flag2:=false;   end if;    printf("\n"); if flag1=true and flag2=true then    print(Fullfill the Cauchy-Riemann Equations);    print(The derivative is:='u[x]+I*v[y]');    print('diff(f(z),z)'=u_x+I*v_y); else    print(Cauchy-Riemann ?); end if end proc:
 > f(z):=1/(z+2): CauchyRiemann(f(z))
 (2)
 >

Also ran the procedure through the AI for so-called code improvement and now it shows what the code stands for

 > restart; # Improved and corrected version of the CauchyRiemann procedure :ASKED AI  CauchyRiemann := proc(expr::algebraic)     local x, y, u, v, u_x, u_y, v_x, v_y, CR1, CR2;     # Assign real and imaginary parts of the function     u := evalc(Re(eval(expr, z = x + I*y)));     v := evalc(Im(eval(expr, z = x + I*y)));     # Calculate partial derivatives     u_x := diff(u, x);     u_y := diff(u, y);     v_x := diff(v, x);     v_y := diff(v, y);     # Properly format and print function details     printf("f(z) = %a\n", expr);     printf("u(x, y) = %a, u_x = %a, u_y = %a\n", u, u_x, u_y);     printf("v(x, y) = %a, v_x = %a, v_y = %a\n", v, v_x, v_y);     # Evaluate and print Cauchy-Riemann equations     CR1 := u_x = v_y;     CR2 := u_y = -v_x;     printf("\nCauchy-Riemann Equations:\n");     printf("u_x = v_y: %a\n", CR1);     printf("u_y = -v_x: %a\n", CR2);     # Check both equations     if CR1 and CR2 then         printf("The function is analytic (holomorphic) at this point.\n");         printf("The derivative f'(z) is %a + I*%a\n", u_x, v_y);     else         printf("The function does not satisfy the Cauchy-Riemann equations and is not analytic.\n");     end if; end proc; # Test the procedure with a specific function f := z -> 1/(z + 2); CauchyRiemann(f(z));
 f(z) = 1/(z+2) u(x, y) = (x+2)/(y^2+(x+2)^2), u_x = 1/(y^2+(x+2)^2)-(x+2)/(y^2+(x+2)^2)^2*(2*x+4), u_y = -2*(x+2)/(y^2+(x+2)^2)^2*y v(x, y) = -y/(y^2+(x+2)^2), v_x = y/(y^2+(x+2)^2)^2*(2*x+4), v_y = -1/(y^2+(x+2)^2)+2*y^2/(y^2+(x+2)^2)^2 Cauchy-Riemann Equations: u_x = v_y: 1/(y^2+(x+2)^2)-(x+2)/(y^2+(x+2)^2)^2*(2*x+4) = -1/(y^2+(x+2)^2)+2*y^2/(y^2+(x+2)^2)^2 u_y = -v_x: -2*(x+2)/(y^2+(x+2)^2)^2*y = -y/(y^2+(x+2)^2)^2*(2*x+4) The function does not satisfy the Cauchy-Riemann equations and is not analytic.

Download CAUCHY_RIEMANN_-FORUM_VRAAG.mw

## I don't understand what is a mistake in this pde...

Asked by:

I want to solve or try to solve this equation

PDE := diff(G(a, H, phi, PI), a)(aH) + diff(G(a, H, phi, PI), H)(k/a^2 - kappa^2/2*PI^2/a^6) + diff(G(a, H, phi, PI), phi)(PI/a^3) = diff(G(a, H, phi, PI), PI)(a^3*diff(V(phi), phi))

with pdsolve(PDE, G)

and maple answer me the next

Error, (in pdsolve/info) first argument does not have a differentiated function with name G

I nw in maple, maybe I´m make a mistake, but I can't find what

## Can .mpl type files be combined?...

Asked by:

I have  4 worksheets with derived equations. So I export the equations and  possibly some procedures (but they can be handled seperately if needed)  from each worksheet as a .mpl file.

I want to combine the .mpl files  together without using copy/paste. Then I can open that single file in the VS code editor.
There may be other ways to achieve this so I am open to suggestions.

## How do I get this to factor?...

Asked by:

I chased down a problem to factoring a square that has sqrt in the coefficients. All numbers are real,
The code is inside a procedure in a package. Iso I could do with something robust.

expand((sqrt(A+B)*x+sqrt(7-K)*y)^2)
2      2            (1/2)          (1/2)        2      2
A x  + B x  + 2 (A + B)      x (7 - K)      y - K y  + 7 y

factor(%)


## Plotting Linear System of Equations...

Asked by:

Hello, everyone,

I am new to Maple and I am trying to get use of it.

I tried to plot the following linear systems in different ways. I realized that the Student Linear Algebra is not as flexible as Linear Algebra. My question is the following. Is there any other way to create a plot without defining the implicit plots?

 >
 >
 (1)
 >
 >
 >
 >
 (2)
 >
 >
 >
 >
 >

Download linear_systems.mw

## Unexpected results from GraphTheory:-WienerIndex? ...

Asked by:

OEIS A034828 and OEIS A000292 (which give the Wiener index for the cycle graph and the path graph respectively) mention that

the Wiener index of the cycle of length 19 is 855 and
the Wiener index of the path with 19 edges is 1330

However,

GraphTheory:-WienerIndex(GraphTheory:-CycleGraph(19));
=
38

GraphTheory:-WienerIndex(GraphTheory:-PathGraph(20));
=
38



So what happened here?

## why Maple server crashes when calling StringTools:...

Asked by:

I was attempting to remove part of string using StringTools:-Remove()

But it causes server.exe crash each time.

Any idea why this happens?

Worksheet below

 > interface(version);

 > Physics:-Version();

 > restart;

 > ode:=x*y(x)*diff(y(x), x) = (x + 1)*(y(x) + 1): ode:=diff(y(x), x$2) = (y(x) + 1): the_output:=Student:-ODEs:-ODESteps(ode,y(x)):  > s:=latex(the_output,'output'=string):  > StringTools:-Remove(s,"\\begin{array}{ccc}"); ps. reported to Maplesoft also. ## why Maple can't find singular solution to first or... Asked by: Maple dsolve fails to find many singular solutions using the option 'singsol'=all. Any idea why that is? Here is one example ode:=diff(y(x),x)=(y(x)-3)^2; dsolve(ode,y(x),'singsol'=all) It returns But we see that y=3 is singular solution which can't be obtained from the above solution for any value of c1 Mathematica finds this singular solution ode=y'[x]==(y[x]-3)^2 DSolve[ode,y[x],x,IncludeSingularSolutions->True] Here is second example. restart; ode:=diff(y(x),x)=2*x*sqrt(1-y(x)^2); dsolve(ode,y(x),'singsol'=all) Gives But it misses the y=1,y=-1 singular solutions. Is there something I am doing wrong? Why does Maple sometimes fail to find singular solutions? ps. reported to Mapesoft also. Update I remembered now a case similar to this. one has to use Lie solver and now Maple gives the singular solution ode:=diff(y(x),x)=(y(x)-3)^2; dsolve(ode,Lie,'singsol'=all) There is no mention of this in help and it is still not clear to me if one has to always use Lie solver to obtain singsol or if this is just a coincidence for this one case. Same for the other case: restart; ode:=diff(y(x),x)=2*x*sqrt(1-y(x)^2); dsolve(ode,'Lie','singsol'=all) gives I think singsol should work all the time and not only when using specific solver. If Lie solver is needed for singsol to work, then help should be clear and say this. ## Wrong minimal polynomials?... Asked by: Consider the following exact algebraic number  > restart;  > kernelopts('version'):  > Physics:-Version():  >  >  memory used=0.97MiB, alloc change=12.00KiB, cpu time=31.00ms, real time=27.00ms, gc time=0ns  (1)  >  (2)  >  memory used=70.25GiB, alloc change=48.00MiB, cpu time=23.63m, real time=21.81m, gc time=3.18m  (3)  >  (4) Download wrong_minpoly.mw I would like to find its minimal polynomial (without a priori knowledge). According to the documentation, if is an exact algebraic number, and and are not given, then PolynomialTools:-MinimalPolynomial(expr) will call to compute an exact minimal polynomial of . If a name is not specified for the variable , then will be used. Regretfully, it is easy to see that the minimal polynomial of cannot be the returned . And when I invoke directly, the result is still not correct (and this evaluation takes a rather long time). Another help page mentions that the call mp := evala(Minpoly(expr, _X)) computes the monic minimal polynomial of in the variable over the field of rational numbers (or multivariate rational functions); the resulting polynomial will not contain any algebraic numbers or functions. However, as type(mp, polynom(rational, _X)) gives , we know that cannot be the desired minimal polynomial of either. So, what is the proper way to compute the minimal polynomial of in Maple? Code: use alpha=1-(1/2)/(1-(RootOf(16*_Z*(_Z*(2*_Z*(_Z*(8*_Z*(_Z*(_Z*(_Z*(32*_Z*(8*_Z-33)+1513)-812)-13)+267)-1469)-330)+811)+279)+345,index=2)-1/2)**2) in expr:=(1+alpha)*sqrt(1-alpha**2)+(3+4*alpha)/12*sqrt(3-4*alpha**2)+2*(1+alpha)/3*sqrt(2*(1+alpha)*(1-2*alpha))+(1+2*alpha)/6*sqrt(2*((1-alpha)**2-3*alpha**2)) end: CodeTools:-Usage(PolynomialTools:-MinimalPolynomial(expr)); Of note, the minimal polynomial of an algebraic number is the unique irreducible monic polynomial of smallest degree with rational coefficients such that and whose leading coefficient is 1 ## Why does simplify fail to rewrite certain sub-ex... Asked by: As the following worksheet shows,  >  > kernelopts('version');  > Physics:-Version();  > with(RealDomain):  > eval(MTM:-det(< a, b/2, d/2 | b/2, c, e/2 | d/2, e/2, f >), PDETools:-Solve(MTM:-det(< x**2 + y**2, x1**2 + y1**2, x2**2 + y2**2, x3**2 + y3**2 | x, x1, x2, x3 | y, y1, y2, y3 | 1, 1, 1, 1 >) = inner([a, b, c, d, e, f], [x**2, x*y, y**2, x, y, 1]), {f, e, d, c, b, a}, 'independentof' = {y, x}))/MTM:-det(< x1, x2, x3 | y1, y2, y3 | 1, 1, 1 >): simplify(%);  > eval(MTM:-det(< a, b/2, d/2 | b/2, c, e/2 | d/2, e/2, f >), PDETools:-Solve(MTM:-det(< x**2 - y**2, x1**2 - y1**2, x2**2 - y2**2, x3**2 - y3**2, x4**2 - y4**2 | x*y, x1*y1, x2*y2, x3*y3, x4*y4 | x, x1, x2, x3, x4 | y, y1, y2, y3, y4 | 1, 1, 1, 1, 1 >) = inner([a, b, c, d, e, f], [x**2, x*y, y**2, x, y, 1]), {f, e, d, c, b, a}, 'independentof' = {y, x}))/(MTM:-det(< x2, x3, x4 | y2, y3, y4 | 1, 1, 1 >)*MTM:-det(< x3, x4, x1 | y3, y4, y1 | 1, 1, 1 >)*MTM:-det(< x4, x1, x2 | y4, y1, y2 | 1, 1, 1 >)*MTM:-det(< x1, x2, x3 | y1, y2, y3 | 1, 1, 1 >)): simplify(%); Download Why_not_consider_subexpressions?.mw the underlined part is evidently not the simplest. (For instance, shouldn't and be converted into and ?) If I understand correctly, , by default, should try combining every part of an expression with every other to apply a vast range of potential transformations to look at many different forms of it and make progress in picking out the simplest possible one. So, why is simplify unable to touch certain sub-expressions when they are encountered at intermediate stages in a computation? ## Where is error in solving for constant of integrat... Asked by: Could someone be able to spot why I get different solution when solving for the constant of integration from this Maple dsolve solution manually than when asking Maple to do it directly? This is the ode ode:=x*y(x)*diff(y(x), x) = (x + 1)*(y(x) + 1); ic:=y(1) = 1;  If I ask Maple to solve it with the IC all at once, it gives solution which odetest verifies OK. If I ask Maple to solve it with no IC, then solve the constant myself and plug the constant back into the solution I get solution which does not verify any more. I am not able to find why. Could someone spot the error in this? Please see worksheet below. I suspect the problem is when plugging back the constant of integration into the general solution, but have no idea now what it is. Clearly Maple did something much smarter than what I did by just plugging the constant back into the solution. May be need to specify what branch to use when plugging the constant back? but how do I know which one?  > interface(version);  > Physics:-Version()  > ode:=x*y(x)*diff(y(x), x) = (x + 1)*(y(x) + 1); ic:=y(1) = 1; sol_no_IC:=dsolve(ode);  > sol_with_IC_direct:=dsolve([ode,ic]); odetest(sol_with_IC_direct,[ode,ic]);  > #this verifies Maple found correct constant also:  > solve(rhs(sol_with_IC_direct)=rhs(sol_no_IC),c__1)  > #now solve for constant of integration manually. This gives invalid solution. Why?  > eq:= 1=limit(rhs(sol_no_IC),x=1);  > PDEtools:-Solve(eq,c__1);  > sol_with_ic:=eval(sol_no_IC,%)  > odetest(sol_with_ic,[ode,ic]); Download why_wrong_solution.mw ## What is the special evaluation rules of "MVshortcu... Asked by: In my view, <x || (1 .. 2); y || (1 .. 2); 1$ 2> should return a Matrix without any error messages; however,

<x || (1 .. 2); y || (1 .. 2); 1 \$ 2>; # Arguments are shielded???
Error, (in Matrix) this entry is too wide or too narrow: 1


If I understand right, each argument of a function is evaluated in turn (unless the modifier is used).
So why is it not equivalent to <x1, x2; y1, y2; 1, 1>

## Table entries with indices that have a certain pat...

Asked by:

I am trying to find the minimum values of a table, but not of all of its indices, just some that comply to a certain pattern.

The minimum of the values of a table are found by using min(entries(atable)).

If the indices of atable are "a1", "a2", "b1", "b2", I would like to just have the ones starting with "a".

Can be done by a loop, but is there a easier way?

## Seperate Real and Imaginary...

Asked by:

I any trying to seperate the real and imaginary components but they are mixed up inside and outside a square root.

Their seems to be a problem displaying the worksheet.

restart

expand((a+I*b)*(a-I*b))
(a+I*b)+(a-I*b)
# z = x *Iy    I need to seperate out solution to [x,y] & [x,-y]
#https://math.stackexchange.com/questions/44391/foci-of-a-general-conic-equation
eq := T*z^2 - (R + S*I)*z +G-K + H*I
sol:=solve(eq,z)
expand(sol[1]*sol[2])=a^2+b^2
simplify(sol[1]+sol[2]=2*a)
simplify(sol[1]-sol[2]=2*b)


Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/2024-04-20_Q_Seperate_Real_&_Imaginary.mw .

Download 2024-04-20_Q_Seperate_Real_&_Imaginary.mw

## why limit fails when having two limits at once but...

Asked by:

Is it wrong to call limit like this

limit(expr,[y = y0,x=x0]);


vs

limit(expr,y = y0);
limit(%,x=x0);


The first one gives internal Maple error.  Worksheet attached. I would have expected both to work the same.

 > interface(version);

 > Physics:-Version();

 > kernelopts('assertlevel'=2):
 > expr:=3/2*(y-1)^(2/3)-3/2*x^2-c__1 = 0; y0:=-7; x0:=3; limit(expr,[y = y0,x=x0]);

Error, (in limit/multi/ldegree1) assertion failed

 > expr:=3/2*(y-1)^(2/3)-3/2*x^2-c__1 = 0; y0:=-7; x0:=3; limit(expr,y = y0); limit(%,x=x0);

Download limit_internal_error_maple_2024.mw

 First 7 8 9 10 11 12 13 Page 9 of 13
﻿