1

I have seen a few posts about this (such as this one), but none solved my problem. As a silly example, suppose I want to solve (1-x)^n = 0, knowing that n > 1. I tried doing,

Assuming[n > 1, Solve[(1 - x)^n == 0, x]]

But, Mathematica goes a bit crazy and gives,

{x -> 1 - 0^(1/n)}

with a warning message. Now, the answer is technically correct I guess, but I would really just like to see x -> 1 of course. Note that Mathematica probably ignores the assumption, because, if I assume n < -1, then I get the same output anyway, although there really is no solution. Is there a way to make this work as expected?

Patrick.B
  • 1,399
  • 5
  • 11

2 Answers2

1

As suggested by Nasser, just try,

Solve[(1-x)^n && n > 1,x]

If you want to get rid of the Conditional expression which ensues, just apply Normal to the above expression.

Patrick.B
  • 1,399
  • 5
  • 11
1

Solve does not take the option Assumptions, consequently the Assuming construct has no affect on it. The constraint (n > 1) should be included within Solve and as an assumption when simplifying.

Solve[{(1 - x)^n == 0, n > 1}, x]

(* {{x -> ConditionalExpression[1, n > 1]}} *)

Simplify accepts Assumptions so you can simplify the output of Solve using either

Simplify[
 Solve[{(1 - x)^n == 0, n > 1}, x],
 Assumptions -> n > 1]

(* {{x -> 1}} *)

or

Simplify[Solve[{(1 - x)^n == 0, n > 1}, x], n > 1]

(* {{x -> 1}} *)

or

Assuming[n > 1, Solve[{(1 - x)^n == 0, n > 1}, x] // Simplify]

(* {{x -> 1}} *)
Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198