Tag Info

New answers tagged

4

It can be zero but not negative. To show this we first rewrite the assumptions so they are actually usable, removing those that are redundant and getting the Thread to work by getting rid of inner lists (things in curly braces). $Assumptions = Flatten[{Thread[{c0, c1, p, w, e} > 0], Thread[0 <= {r, i, x, alpha, beta, gamma, 1 - alpha - ...


2

Your assigning a pattern to $Assumptions won't work because the Mathematica assumption mechanism is simply not geared to accept patterns. It is not based on pattern matching. To get $Assumptions to behave as you say you want it to, you would have to use the system hook $NewSymbol and do something like what is discussed in this answer. But even that won't ...


0

You have to explicitly specify the assumptions within Minimize: Minimize[{Sin[x], Sin[x] >= 0.5}, x] {0.499998, {x -> 0.523596}} Plot[Sin[x], {x, 0, 2 Pi}, GridLines -> {{0.5236}, {0.5}}]


8

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


2

Is something like this what you're after? Simplify[PiecewiseExpand[-Abs[m1 - m2] - Abs[m2 - m3] - Abs[m1 - m3] + n/2*(Abs[m1] + Abs[m2] + Abs[m3]), {m1 == m2, m2 >= m3}, Reals], {m1 == m2, m2 >= m3}] It seems nice and simple.


1

AppendTo is expecting a nonatomic element in the first position, like a List or an Association. As @mfvonh says, the default for $Assumptions is atomic. A simple workaround is to assign $Assumptions={}; before your first AppendTo call.


4

Here are three approaches to the function: f1[x_] := Piecewise[{{Sqrt[x^2], x != 0}}, 0] f2[x_] := Piecewise[{{Sqrt[x^2], x < 0}, {Sqrt[x^2], x > 0}}, 0] f3[x_] := Piecewise[{{-x, x < 0}, {x, x > 0}}, 0] Their second derivatives. Simplify@D[#[x], x, x] & /@ {f1, f2, f3} It seems that f2 or f3 might be used, but Simplify[f2[x]] ...


4

fun = Sqrt[x^2]; dd = D[fun, x, x]; With V10 we can explicitly define: {dd, FunctionDomain[dd, x]} Or {Simplify @ dd, FunctionDomain[dd, x]} {0, x < 0 || x > 0} Also with V10 you might consider Inactivate: di = D[Inactivate@Sqrt[x^2], x, x] // Together which prevents Together from evaluating to 0 di // Activate 0


6

Let's define f[x_] := Sqrt[x^2] FullSimplify[D[f[x],x], x ∈ Reals] (* ==> Sign[x] *) You can use f'[x] or D[f[x],x] interchangeably here. Then the second derivative is simply FullSimplify[D[Sign[x], x], x ∈ Reals] (* ==> Derivative[1][Sign][x] *) So doing the second derivative in two steps yields a mathematically correct answer. The ...


0

Your function must hold its argument or the Simplify will evaluate before the function even sees it. Use: Function[expr, Assuming[α > 0 && ϵ > 0 && t > 0, expr], HoldFirst] Or: SetAttributes[myAssumptions, HoldFirst] myAssumptions[expr_] := Assuming[α > 0 && ϵ > 0 && t > 0, expr]



Top 50 recent answers are included