Question: Differences in Domain Results Between solve(0 < x and x <> 2, x) and solve({0 < x, x <> 2}, x)

I recently encountered an interesting issue when solving for the domain of a function in Maple using two different approaches, and I am curious about the differences in results between the following commands:

  1. domain := solve(0 < x and x <> 2, x);
  2. domain := solve({0 < x, x <> 2}, x);

I wonder if anyone could explain why Maple might treat these two syntaxes differently.

restart

``

h := proc (x) options operator, arrow; ln(x)/(x-2) end proc

proc (x) options operator, arrow; ln(x)/(x-2) end proc

(1)

domain_ln := solve(x > 0, x)

RealRange(Open(0), infinity)

(2)

denom_undefined := solve(x-2 = 0, x)

2

(3)

domain := solve(`and`(x > 0, x <> 2), x)

RealRange(Open(0), infinity)

(4)

solve({x > 0, x <> 2}, x)

{2 < x}, {0 < x, x < 2}

(5)

``

plot(h(x), x = 0 .. 10, discont = true, color = blue)

 

``


 

Download domain.mw

Please Wait...