Message Boards Message Boards

How to make logical tests for general function expressions

Posted 9 years ago

hey matheamtica community,

im working on a project and i got a problem. I want to perform a logical test in order to check if two expression are the same. my code is the following:

test1 = (2 epsH r[b[t]] - b[t] (1 + r[b[t]])^2)/(
 b[t] (-2 epsH + b[t] (1 + r[b[t]])))
test2 = (2*epsH - (((1 + r[b[t]])*(2*epsH - b[t]*(1 + r[b[t]])))))/(b[
     t]*(2*epsH - b[t] (1 + r[b[t]])))
test3 = test1 == test2

i mean i got the basics of doing logical tests f.e :`

In[86]:= x = 5

Out[86]= 5

In[87]:= x == 7

Out[87]= False

But i read in the documentation about "Equal" that the command "Expand" should do the deal for what i want but appareantly it isnt doing a logical test but rather expanding both expressions. I would be greatful if someone can gibve me a hand and maybe explain me what i misunderstood about the language of mathematica for this case. ty a lot for all answers

POSTED BY: Claude Dax
Posted 9 years ago

Try Simplify instead of Expand

In[4]:= Simplify[test3]

Out[4]= True
POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract