## 11925 Reputation

7 years, 247 days

## continuous?...

@fhn2022 Why are you so sure that the function is continuous? You have many complex square roots! Denominators too!

## Digits...

@fhn2022 You may need to increase Digits but then even a longer time will be needed.
If the problem is important for you, try to optimize/simplify the computations.

## method only...

@fhn2022 I did not change anything in your code. The first output is just a check with the value of T2 for the those values of alf, y and x. You may delete it.
Only the method of integration in int was changed to method=_CubaCuhre. As you see, it works for alf > 0.277.

## d/dz sometimes...

@ecterrab  Just want to notice that for an analytic f,  d/dz |f(z)|  exists in a nbd of a point  iff  f is constant.

## numeric...

@jschatzman A standard way to check symbolic results is to compute numerical values for several numerical values of the parameters (like evalf above). If the values agree (sometimes working with high precision if possible), there are big chances to have a correct symbolic result.

## Pi/2...

@jschatzman You are wrong. The integral for f=+-1/(2*Pi) is Pi/2 and must be considered in the sense of Cauchy principal value.
You can see this using a numerical evaluation:

`evalf(Int(sin(x)*exp(-I*x)/x, x = -infinity .. infinity));`

1.570796327+Float(undefined)*I

## 1/2...

@Axel Vogt Actually, for a correct result, Heaviside(0) must be 1/2.

Note however that for f = +- 1/(2Pi), the integral must be considered in the sense of Cauchy principal value.

## solve/identity...

@Preben Alsholm I do not trust much in solve/identity for such complicated equations.
For example, sol:=solve(identity(EQ,X),[x0,y0,A]);
gives several solutions, but not the correct one: [x0 = 0, y0 = 0, A = 0]

## d/dx...

@ecterrab  As mentioned in the definition, `diff/abs`  implements  d/dx |f(x+iy)|,  (for f analytic), not  d/dz |f(z)|. The latter does not exist because it's not a Wirtinger derivative. So,  obviously  d/dx conj(x+iy) = 1.
[for f analytic,  d/dx f = d/dz f].
`diff/abs`  is not suited for a general usage; it works for real variables (as in the provided example). A general solution will have to implement the rest of the nonanalytic functions.

## (a+b+x)*(a+x+y)...

@Carl Love I mean the example without x=y=0. The result of Maple (a+b+x)*(a+x+y)  is different from your simulation.

I don't think that automatic simplification can explain this.

By the way, your use of %%%f  is very ingenious!

## 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.