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.

I have the following notebook:

$Assumptions -> { {c1, c2, λ, μ} > 0, Element[{c1, c2, λ, μ}, Reals], μ > λ}

(* True -> {{c1, c2, λ, μ} > 0, (c1 | c2 | λ | μ) ∈ Reals, μ > λ} *)

f1 := c1 * (λ/(μ - λ)) + μ * c2

df1 = D[f1, μ]

(* c2 - (c1 λ)/(-λ + μ)^2 *)

Solve[df1 == 0, μ]

(* {{μ -> (-Sqrt[c1] Sqrt[λ] + Sqrt[c2] λ)/Sqrt[
   c2]}, {μ -> (Sqrt[c1] Sqrt[λ] + Sqrt[c2] λ)/Sqrt[c2]}}*)

 D[df1 , μ] 

(* (2 c1 λ)/(-λ + μ)^3 *)

The last line is getting the second order condition. Since all terms in the numerator are positive, the numerator is positive. Since $\mu > \lambda$ by assumption, then $(-\lambda + mu)^3$ is also positive for any $\mu$, $\lambda$ combination. Is it possible for Mathematica to use the stated assumptions to tell me that the second order condition is positive, given the set of assumptions?

share|improve this question
1  
To set global assumptions, use $Assumptions = {{c1, c2, λ, μ} > 0, Element[{c1, c2, λ, μ}, Reals], μ > λ}. –  m_goldberg Aug 26 at 2:43

1 Answer 1

up vote 8 down vote accepted
df2 = D[df1,  μ]; 
$Assumptions = Flatten[{Thread[{c1, c2, λ, μ} > 0], Element[{c1, c2, λ, μ}, Reals], μ > λ}];

FullSimplify@Positive[df2]
(* True *)
FullSimplify@Sign[df2]
(* 1 *)

Or, you can use your assumptions directly as the rhs of the Assumptions option, or as the first argument of Assuming, without setting the value of the global variable $Assumptions:

FullSimplify[Positive[df2], Assumptions -> 
             Flatten[{Thread[{c1, c2, λ, μ} > 0], Element[{c1, c2, λ, μ}, Reals], μ > λ}]]
(* True *)

or

Assuming[Flatten[{Thread[{c1, c2, λ, μ} > 0], Element[{c1, c2, λ, μ}, Reals], μ > λ}],
        FullSimplify@Sign[df2]]
( * True *)

Similarly, for Sign[df2].

share|improve this answer

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.