1
$\begingroup$

I have a small problem:

I have two expressions:

a = (ia*l^3*p0)/(12*ia*l + 6*i*la)
b =  p0*l^2/(12*(1 + 0.5*i/ia*la/l))

Obviously, they are equal. Just take expression a and multiply it by 1/(l*ia)/1/(l*ia) and finally factor out the 12 in the denominator.

Now I would like Mathematica to tell me if those two expressions are equal, therefore I used the following code:

Expand[a==b]

But it does not tell me

"True"

Why is that?

EDIT:

Writing Reduce[a==b] does the trick! :) However, there is another example where it does not work:

Here is another example where it does not work

c = (l^3 la p0)/(24 e (2 ia l + i la))
d = p0*l^2/(24*e*(2*ia/i + i/l))

Again, c is equal to d. You can multiply c by (1/(l*la)/(1/(l*la)) and you will get the same result as d.

Here I tryied: 'Reduce[c==d]`but it does not work.

$\endgroup$
  • $\begingroup$ I would use Reduce instead of Expand; notice you have p0 in a but po in b, $\endgroup$ – b.gatessucks Mar 25 '18 at 8:46
  • $\begingroup$ @b.gatessucks thanks a lot. Now it works. Can you tell me why? $\endgroup$ – henry Mar 25 '18 at 9:26
  • 1
    $\begingroup$ In[175]:= PossibleZeroQ[a - b] Out[175]= True $\endgroup$ – Daniel Lichtblau Mar 25 '18 at 15:09
  • $\begingroup$ a == b // Simplify $\endgroup$ – Bob Hanlon Mar 26 '18 at 0:08
4
$\begingroup$

These expressions are not equal. c has a singularity in la, d has it not.

Plot[Evaluate[{c, d} /. {l -> 1, p0 -> 2, ia -> 3, e -> 4, p0 -> 5, 
     i -> 6}], {la, -3, 3}, PlotRange -> .01, PlotStyle -> {Red, Blue}]

enter image description here

$\endgroup$
  • $\begingroup$ Thank you very much! I did not notice that ! $\endgroup$ – henry Mar 25 '18 at 12:45

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.