6
$\begingroup$

Can someone explain to me why the following does not simplify to True (as all constituents are positive)?

FullSimplify[a+b/(c+(d-e)^2)>0,Assumptions->And@@Thread[{a,b,c,d,e}>0]]

Most special cases including e=0 or a=b,... do simplify correctly.

What I eventually want to do is to simplify expressions of the kind

Abs[a+b/(c+(d-e)^2)],

which should evaluate to a+b/(c+(d-e)^2) under given assumptions.

Any workarounds?

Edit
What I ended up doing for larger expressions was this:

expr[Abs[a+b/(c+(d-e)^2)]]/.Abs[x_]/;Simplify@Reduce[$Assumptions&&x>0]:>x

It's not particularly pretty, but it works. Thanks to ssch for the idea!

$\endgroup$
6
$\begingroup$

One workaround is to use Reduce instead, and simplify that with FullSimplify:


assum=And @@ Thread[{a, b, c, d, e} > 0];
Reduce[assum && a + b/(c + (d - e)^2) > 0]
(* Out: e > 0 && d > 0 && c > 0 && b > 0 && a > 0 *)
FullSimplify[%, assum]
(* Out: True *)
$\endgroup$
  • $\begingroup$ Good idea! Should have thought of that... $\endgroup$ – sebhofer Jul 9 '12 at 18:10
  • $\begingroup$ I just realized that this actually doesn't help me. What I would like is Mathematica to simplify Abs[a + b/(c + (d - e)^2)] for given assumptions. $\endgroup$ – sebhofer Jul 9 '12 at 18:25
11
$\begingroup$

Either of the below logical formulations will handle this. Generic simplifiers might or might not react well to logical expressions.

In[21]:= Resolve[
 ForAll[{a, b, c, d, e}, 
  Implies[And @@ Thread[{a, b, c, d, e} > 0], 
   a + b/(c + (d - e)^2) > 0]]]

Out[21]= True

In[20]:= Resolve[
 ForAll[{a, b, c, d, e}, And @@ Thread[{a, b, c, d, e} > 0], 
  a + b/(c + (d - e)^2) > 0]]

Out[20]= True
$\endgroup$
  • $\begingroup$ That's very interesting to know! I didn't even know Resolve existed. But is there also a way to simplify Abs[...]? Of course I could do a replacement and apply your trick (or ssch's) but that's not very elegant. $\endgroup$ – sebhofer Jul 9 '12 at 19:24
  • $\begingroup$ Might be a straightforward way but none is coming to mind right now. $\endgroup$ – Daniel Lichtblau Jul 9 '12 at 19:43

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.