2
$\begingroup$

I have the following code:

Assumptions = {x > 0} b[x_] := x^2 b'[x] > 0 

In my (very basic) understanding of Mathematica, this should give me me the Output True, but I get 2 x > 0.

I also tried b[x_] := x^2 /; x > 0 and Assuming[x > 0, b'[x] > 0]. I've searched the mathematica help, but without success. What's my basic error and how do I get the desired output?


EDIT: The original question is answered, now I wanted to adapt this solution to two variables:

c[x_, y_] := x^2 + y Assumptions = {y > 0} $Assumptions = {x > 0} Simplify[c[x, y] > 0] 

It follows the same logic as the first case, where I now get the desired output, but why not here? I realize that these are probably typical beginners questions, so if you could explain the logic to me or give me a hint where to read up upon this stuff? Neither the Mathematica help nor my university's (very short) guidebook are sufficient for my understanding.

  • 1
    `Assumptions = {x > 0}` overwrites `Assumptions = {y > 0}`. Try `$Assumptions = x > 0 && y > 0`.2011-04-27

1 Answers 1

4

Your first code

Assumptions = {x > 0} b[x_] := x^2 b'[x] > 0 

works fine if you apply

 Simplify 

to the result (2x > 0).

Edit: For completeness, I also add the answer of J.M in the comment to the second question.

 Assumptions = {x > 0}  

overwrites

  Assumptions = {y > 0}.  

Try

Assumptions = x > 0 && y > 0. 
  • 0
    Thanks!!! Can you by chance also answer my edited question? That'd be great!2011-04-27