Carlos36r

25 Reputation

2 Badges

2 years, 86 days

MaplePrimes Activity


These are questions asked by Carlos36r

I could not find a way to check whether or not a given value belongs to an interval expressed as RealRange (or a union of them e.g. RealRange(Open(-10),-5), RealRange(Open(-6),infinity).

Ideally, I would like a Boolean function that takes two arguments (i) a value v and (ii) a (union of) RealRange r, and returns true/false depending on whether or not value v is in/out of the range r.

The following program:

with(RealDomain):
sol1 := solve(x-1 > 0, x);
sol2 := solve(1/x^2 > 0, x);
sol3 := solve(1/(x^2-1) > 0, x);
sol4 := solve(x^2+1 > 0, x);
sol5 := solve(x^2+1 < 0, x);

Gives the following output:

sol1 := RealRange(Open(1),infinity)
sol2 := {x <> 0}
sol3 := RealRange(-infinity,Open(-1)), RealRange(Open(1),infinity)
sol4 := x
sol5 := NULL

I would like to force some consistency in the output of solve because I need to feed the output to a third-party program. For example, what's the deal with sol2 and sol3? Why are they formatted differently?

Ideally, I would like the previous output to be:

sol1 := RealRange(Open(1),infinity)
sol2 := RealRange(-infinity,Open(0)), RealRange(Open(0),infinity)
sol3 := RealRange(-infinity,Open(-1)), RealRange(Open(1),infinity)
sol4 := RealRange(-infinity,infinity)
sol5 := NULL

How do I achieve this?

Please excuse my thickness if any.

In the following IF statement:

if 1 <> 2 then
    OuterThen;
    if 1 <> 2 then
        InnerThen;
    else
        InnerElse;
    end if;    
else
    OuterElse;
end if;

I expect the output:

OuterThen
InnerThen

but I only get:

OuterThen

Why?

In the following I show two functions f and g where ShowSolution(Limit(..)) works for f but not for g. Any idea why?

with(Student[Calculus1]);

f := x^2 + x:
limit(f, x = -infinity);
infinity
ShowSolution(Limit(f, x = -infinity), maxsteps = 100);
// step-by-step solution is produced

g := x^2 + 3*x:
limit(g, x = -infinity);
infinity
ShowSolution(Limit(g, x = -infinity), maxsteps = 100);
Error, (in Student:-Calculus1:-ShowSolution) unable to compute solution steps

Maple is able to change f into an equivalent expression by factoring out x^2, but does not seem to be able to do it with g.

I attach two screenshots that show this curious behaviour.

Page 1 of 1