## 12915 Reputation

8 years, 355 days

## x,y...

@Carl Love OK, but what about the second example (with x,y) where the simuation does not agree with Maple?

## x,y...

@Carl Love Do you know how the automatic simplification can make the two results different for x=y=0?

## consequences...

@ecterrab I see two consequences of this approach:

--  Physics:-diff will be the only command giving different results when called directly or after with.

-- It will be impossible to compute Wirtinger derivatives in a procedure, unless Physics is already loaded (because with is forbidden in a proc). This is not a big problem because it is not hard to compute them directly ( see Old bug in `diff/abs` - MaplePrimes ) but unfortunately diff/abs &co  will have to be redefined (the mentioned "old bugs" are still present).

## comment...

I am not very surprised by this behavior.
In the Physics package almost everything is redefined and a special environment is used.
This should not be a problem, but more and more "regular" functions call Physics routines.
The :-diff problem described is of course a bug, but even after a fix, similar problems are prone to pop up due to this design.
In my opinion, Physics (an interesting and useful huge package) should have been completely separated by the rest of Maple, or incorporated into a distinct product.

## Yes...

@acer Thanks, you did it!
FF:=simplify(evalc(Re(Q))) assuming x::real;

is real and continuous. FF = F but the check is also a challenge.

## complex...

@acer   int(convert(f,exp),x)  gives a concise elementary result but in terms of complex arctan, ln ...
and it is not continuous (for real x). Probably it can be converted to a real form, but evalc does not work well and complicates the expression.

I know to obtain F by hand, but I would be happy to see a Maple solution.

## check...

@acer The simplest way for a check seems to be

`(simplify@@2@convert)(diff(H,x)-f, tan);   # 0`

(note the double simplification!)

A bit simpler antiderivative is

`F:=-ln(sin(x)+cos(x)+sqrt(2+sin(2*x)))/2+arcsin((sin(x)-cos(x))/sqrt(3))/2;`

For this, your simplification does not quite work, but an extra simplify almost does it.

P.S. It seems that simplfy should be revised.

## Not possible...

@pallav This is not possible as my answer shows. It would be, if e.g. A were symmetric in x and sigma, but then A1 is independent of x, sigma. Take a simpler A to see what happens, e.g. A = x + 2 sigma^2 + x^2*c.

## relations?...

@pallav You may use e.g. coeff(coeff(A,x^2),sigma^4).

But what do you want to do with the relations

`sigma+x=a, sigma*x=b`

?

## after subsitution...

@Carl Love I mean after substitution, i.e. A1 or A2.

## isomorphism...

IsSubgraphIsomorphic has the option isomorphism (in version 2022).  Why don't you use it?

## isprime...

@Carl Love  It would be interesting to find a composite (i.e. non-prime) number for which isprime gives true (there should exist such a number!).

## x0, y0...

@Carl Love The standard method for "quasi-homogeneous" functions:
g:=eval(f, [x=X+x0,y=Y+x0]);
determine x0,y0 such that g be homogeneous in X,Y; then z = Y/X.

## Not a good idea...

You should not do this. It makes no sense in maths and in Maple (where D[1] acts on a procedure rather than an expression).

## global min...

@rlopez To increase the chances for a global minimum, use:

```SOL:=[infinity];
to 100 do
sol:=Optimization:-Minimize(f,{G=0},initialpoint={x1=rand(0. .. 1.)(), x2=rand(-1. .. 1.)()}, feasibilitytolerance=1e-8, iterationlimit=1000);
if sol[1]<SOL[1] then SOL:=sol fi
od:
SOL;
```

 First 9 10 11 12 13 14 15 Last Page 11 of 170
﻿