Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How can one simplify an expression by assuming that one of the variables is equal to zero? For instance, while Simplify[%,a>0] gives the desired output, Simplify[%,a=0] produces the following error:

$Assumptions::bass: 0 is not a well-formed assumption. >>
share|improve this question
add comment

2 Answers

up vote 7 down vote accepted

You can use /. (ReplaceAll) :

% /. a->0

Simplify[%,a=0] produces an error ( this expression a = 0 cannot be used as an assumption) because it means just setting the value zero to the variable a, in another form Set[ a, 0], see Set.

In some cases, when there are more variables which depends on another ones you may need the repeated replacement for applying rules repeatedly until the expression no longer changes, then you would rather use ReplaceRepeated, (//.) e.g. :

% //. {a -> b + 1, b -> 2}
share|improve this answer
add comment

In Simplify[%,a>0] the symbol > is a logical operator. In Simplify[%,a=0] the symbol = is not a logical operator. You must use the logical operator Equal, so Simplify[%,a==0] works fine! Example:

(a + b)^2 // Expand

a^2 + 2 a b + b^2

Simplify[%, a == 0] 

gives

b^2

the right answer.

:-)

Orleo

share|improve this answer
    
Thanks Orleo, that makes sense. –  user001 Mar 14 '12 at 16:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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