# Can I check if an expression is positive using assumptions?

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? - To set global assumptions, use $Assumptions = {{c1, c2, λ, μ} > 0, Element[{c1, c2, λ, μ}, Reals], μ > λ}. – m_goldberg Aug 26 '14 at 2:43

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].

-