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.
Simplify[1/(1/a + 1/b)]

{ (a b)/(a + b) }

That doesn't look right. The given function has an infinite term for a = 0 and one for b = 0, while the result has one for (a + b) = 0. So that's probably the reason why:

a b/(a + b) === 1/(1/a + 1/b)

{ False }

though only a minute ago it Simplified it that way! Also

Simplify[1/(1/x)]  

{ x }

seems to disregard the 1/0 case. Can anybody get me out of my confusion?

share|improve this question
    
a b/(a + b) === 1/(1/a + 1/b) returns False because they are not structurally the same (which is what SameQ[] checks for). As for your actual question, Mathematica returns what is called a "generically correct" answer; see this for details. –  J. M. Jul 12 '12 at 12:47
    
You seem to be confused about the math itself a bit. The general notion you are missing is that 1/inf=0 , so 1/(1/0)=1/inf=0. There is absolutely no problem in simplifying 1/(1/x)=x. The simplification in the first case are also equivalent when you plug in zeros, for a=0, the first is 1/(inf+1/b)=1/inf=0, and the second is 0*b/(0+b)=0. So you are simply reasoning wrongfully about these "boundary cases". –  jVincent Jul 12 '12 at 13:19
    
@jVincent - I know that, thanks. I was just wondering if MMA keeps track of every element in the equation to determine the domain of the function as a whole. –  stevenvh Jul 12 '12 at 13:33
add comment

1 Answer 1

up vote 2 down vote accepted

Use FullSimplify when testing equality:

x = 1/(1/a + 1/b)
Simplify[x]
FullSimplify[% == x]

enter image description here

share|improve this answer
    
Simplify[% == x] also returns True –  stevenvh Jul 12 '12 at 13:22
    
Last item of the Equal docs, Possible Issues, adds FullSimplify. It's not an exact match to your case. reference.wolfram.com/mathematica/ref/Equal.html –  Chris Degnen Jul 12 '12 at 13:23
    
It's circular in this case, but the conclusion is use Simplify when testing equality. –  Chris Degnen Jul 12 '12 at 13:33
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.