1
$\begingroup$

I frequently have trouble trying to place limits on Solve or Reduce using assumptions and domains. For example, this code:

Assuming[x > 0 && x < 1, Solve[(1 - (1 - x)^3)^3 == x, x, Reals]] 

Produces results both with complex number, and with x outside the range specified. The exact output is long (and includes the desired results), but a subset is pasted below. What is going on? $$\left\{\{x\to 0\},\{x\to 1\},\left\{x\to 1-\frac{\left(1-i \sqrt{3}\right) \left(\frac{1}{2} \left(-9+\sqrt{93}\right)\right)^{1/3}}{2 3^{2/3}}+\frac{1+i \sqrt{3}}{2^{2/3} \left(3 \left(-9+\sqrt{93}\right)\right)^{1/3}}\right\}\right\}$$

1 Answers 1

2

Solve[{(1 - (1 - x)^3)^3 == x, 0 < x < 1}, x, Reals] works fine in Mathematica 8... Reduce[{(1 - (1 - x)^3)^3 == x, 0 < x < 1}, x, Reals] is pretty much equivalent.

  • 0
    Hmmm.. I am on 7 right now, but I believe I had the same problem on my home computer, which has 8 (for students). I'll double check when home. But even if it is just for 7, I still don't get why it doesn't work. The code we entered was exactly the same.2011-09-18
  • 1
    Well, `Assuming[]` does not seem to be suited for use with `Solve[]` or `Reduce[]`; better to input the constraints along with the equations for these.2011-09-18
  • 0
    Hmmm... ok when I use reduce, and I do it the way you suggest, it works. Solve still gives me complex numbers. But, this is better, thanks!2011-09-18
  • 0
    Still have the problem in v8, but only sporatically. I guess I'll just assume it's a bug.2011-09-25
  • 2
    @JandR: As a point of note, `Solve` changed between v.7 and v.8. In v.7 the third param was for variables to eliminate, and in v.8 it is for the domain. Also, according to the [docs](http://reference.wolfram.com/mathematica/ref/Assuming.html), `Assuming` only affects those functions that have an `Assumptions` option. So, you have to include your assumptions as extra equations passed to `Solve` and `Reduce`, as J.M. shows.2011-10-09
  • 0
    I would like to disagree. Your first example does NOT work fine in Mathematica 8: In[16]:= Solve[{(1 - (1 - x)^3)^3 == x, 0 < x < 1}, x, Reals] During evaluation of In[16]:= Solve::eqf: x<1 is not a well-formed equation. >>2014-02-23