2
$\begingroup$

How can I use the SolveAlways function imposing some assumption on the parameter space of the symbolic variables?

$\endgroup$
  • $\begingroup$ SolveAlways[{eqns, assumptions}, variables]? $\endgroup$ – J. M.'s technical difficulties Oct 7 '15 at 0:06
  • $\begingroup$ Ddi not work. Dou mean something in the line of: SolveAlways[{x^2-1==0,Assumptions->x>0},{x}]? $\endgroup$ – user191919 Oct 7 '15 at 17:09
  • $\begingroup$ @user191919 Are you still looking for an answer? $\endgroup$ – zhk Feb 19 '17 at 13:38
3
$\begingroup$

In your case Solve is enough. Assumptions are not described in the documentation.

Solve[x^2 - 1 == 0 && x > 0, x]

$\{\{x\to 1\}\}$

$\endgroup$
3
$\begingroup$

As pointed out in the documentation, SolveAlways does not solve for the unknowns. Instead, it finds parameter values for which the set of equations is always satisfied (for all values of unknowns), as in the example:

SolveAlways[a x + b == 0, x]

{{a->0,b->0}}

This tells you that for a=0 and b=0 the equation a x + b == 0 is always satisfied, regardless of the value of x.

If you want to solve an equation with some restriction on the variable domain (field in which the unknown lives), then you can supplement the constraint to the Solve function using the && operator. For example:

Solve[x^3 + 1 == 0, x]

{{x -> -1}, {x -> (-1)^(1/3)}, {x -> -(-1)^(2/3)}}

vs

Solve[x^3 + 1 == 0 && x \[Element] Reals, x]

{{x -> -1}}

Hope this helps.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.