5561 Reputation

7 years, 180 days

Why does isolate fail to isolate?...

Maple 2015

In a recent answer I posted, I had a relation of the form

`I*Int(f(x), x) = something - 2*I*Int(f(x), x)`

and I wanted to isolate the term Int(f(x), x).
The function isolate failed to do it and I was forced to use some workaround to do the "isolation".

Trying to understand what happened here, it seems that isolate fails when the term to isolate is multiplied by the imaginary unit
Here are a few examples

 > expr := I*(Int(x^2*ln(-x+sqrt(x^2-1)), x)) = g(x) -(2*I)*(Int(x^2*ln(-x+sqrt(x^2-1)), x))
 (1)
 > # no isolation isolate(expr, lhs(expr))
 (2)
 > # isolation expr_1 := expand(expr / I) isolate(expr_1, lhs(expr_1))
 (3)
 > # no isolation neither, so the problem is not related to "Int" expr := I*diff(h(x), x) = g(x) -2*I*diff(h(x), x): isolate(expr, lhs(expr))
 (4)
 > # no isolation neither, so the problem comes from "I" expr := I*A = g(x) -2*I*A: isolate(expr, lhs(expr))
 (5)
 > # isolation (of course) expr := c*A = g(x) -2*c*A: isolate(expr, lhs(expr))
 (6)
 >

I guess this is a known behavior, but why it is so?
Is there a way to force the "isolation" without using a trick like in result (3)

A question about the order used in coeff...

Maple

Let P(x) a polynomial with a single indeterminate.
In Maple 2015 (please, do not consider this question if Maple >=2021 doesn't present this problemcoeffs returns the coefficients P(x) in a different in some circumstances:

```m := [\$1..3]:

c:= coeffs(%, R, 't'): [c], [t];

[ 2      ]
[3, 2, 1], [R , R, 1]
c:= coeffs(%, R, 't'): [c], [t];
[1, 2], [1, R]
```

The order in the first case is R^2, R^1, R^0 while it is R^1, R^0 in the second one.

It's quite easy to check if P(x) is of the form a+b*R and to reverse the output of coeffs. But does it exist an option of coeffs which monitors the output order.

TIA

How can I obtain this result?...

Maple

Is there a simpler and more elegant way to get the last result in this code snippet?

```add(f~([op(a+b)])[]);
f(a) + f(b)
# simpler and more elegant
map(f, a+b);
f(a) + f(b)
# now I want to obtain this result
f(a, t) + f(b, t)
```

TIA

How to use the type ':-RandomVariable' i...

Maple 2015

Hi,
I met a an unexpected behaviour of a procedure when the parameter sequence contains the type ':-RandomVariable':

```restart:
with(Statistics):
f1 := proc(A::':-RandomVariable')
Mean(A)
end proc:

Z := RandomVariable(Normal(mu, sigma)):
hastype(Z, ':-RandomVariable');
f1(Z)
true
Error, invalid input: f1 expects its 1st argument, A, to be of type 'RandomVariable', but received _R
# Another attempt
f2 := proc(A)
if hastype(A, ':-RandomVariable') then Mean(A) end if;
end proc:

f2(Z)
mu
```

Why does f1 generate this error?

Type_RandomVariable.mw

The vertical axis is logarithmic even if...

Maple 2015

Version used MAPLE 2015.2

I use dualaxisplot and want a logarithmic horizontal axis.
I can get the expected graphic using either of these two methods

```restart:
with(plots):
dualaxisplot(
plot(x, x=0..1, color=blue, axis[1]=[mode="log"]),
plot(1-x, x=0..1, color=red, axis[1]=[mode="log"]),
gridlines=true
):

dualaxisplot(
semilogplot(x, x=0..1, color=blue),
semilogplot(1-x, x=0..1, color=red),
gridlines=true
):
```

This worksheet contains my true code
(pink lines correspond to < plot + axis[1]=[mode="log"] > and blue lines to < semilogplot >).
You will see that the vertical axis for the plot declared in second position is logarithmic, whatever the way the logarithmic x-axis is defined.
DecisionProb.mw

I am unable to find out if I made a mistake (which is likely) or if it is a bug?
Could you please have a look at this code and give me an answer?