Ask Your Question
2

solve((x^3 - 4*x) > 0,x) does not enforce condition assume(x > 0)

asked 2016-09-24 23:55:43 +0100

Mafra gravatar image

I actually have two (related) questions.

First question, am I misunderstanding the following code?

forget()
assume(x>0)
solve((x^3 - 4*x) > 0,x)

The solution given by sagemath-7.3 is

[[x > -2, x < 0], [x > 2]]

but I would expect only the solution [x > 2] under the condition x > 0.

Is this a bug or am I doing something wrong?

Second question. How can I enforce the condition x > 0 myself and "solve" the resulting conditions of:

[[[D < -2],
  [D > 0, D < -1/9*sqrt(1081) + 116/9],
  [D > 1/9*sqrt(1081) + 116/9]],
 [[D > -4, D < -2],
  [D > 2, D < -1/3*sqrt(7009) + 116/3],
  [D > 1/3*sqrt(7009) + 116/3]],
 [[D > -4, D < 0], [D > 2, D < 11]],
 [[D < -6], [D > -2, D < 0], [D > 2, D < 19]],
 [[D < -4], [D > -2, D < 0], [D > 2]],
 [[D > -6, D < -4], [D > -2, D < 0], [D > 2]]]

How can I solve this type of question efficiently? I believe that discarding the negative solutions in the above system will imply that 2 < D < 1/9(116 - sqrt(1081)), for example. However, I'd like to do this for many other cases as well.

Any help will be appreciated!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2016-09-25 16:26:10 +0100

slelievre gravatar image

Apparently the function solve does not take the assumptions into account.

One thing you can do is to include the assumptions yourself.

Either by hand:

sage: solve([(x^3 - 4*x) > 0, x > 0], x)
[[2 < x]]

Or more automatically.

sage: assume(x > 0)
sage: assumptions()
[x > 0]

sage: A = (x^3 - 4*x) > 0
sage: A
x^3 - 4*x > 0

sage: solve(assumptions() + [A], x)
[[2 < x]]

You could also add your inequality to the assumptions.

sage: assume(x > 0)
sage: assume(x^3 - 4*x > 0)
sage: assumptions()
[x > 0, x^3 - 4*x > 0]
sage: solve(assumptions(), x)
[[2 < x]]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-09-24 23:55:43 +0100

Seen: 326 times

Last updated: Sep 25 '16