New answers tagged

2

You need to tell the simplification process your assumptions: z = FullSimplify[(100 c)/(e y) + (100 b x)/(e y) + (100 a x^2)/(e y) == 0, Assumptions -> {e > 0, y > 0}] c + x (b + a x) == 0 Of course you really don't want to assume that all the variables are positive reals, because then the equation never holds. So we need to either ...


0

Similarly to my answer to your other question, it looks like support for recognizing this property was added in M11.2 or M11.3. In M11.1 I get: $Assumptions = t ∈ Complexes && A ∈ Matrices[{n,n}]; Id = IdentityMatrix[n]; (KroneckerProduct[A.A.A,Id]+KroneckerProduct[-2 t A.A,Id]).KroneckerProduct[A+3 t Id,4 t A.A]//TensorExpand; Coefficient[%,t^3] ...


1

Here is one solution which works to some extent, though it relies on a FullSimplify to determine whether the rule should be applied which could be quite slow. 1 / (2 I) { a - Conjugate[a], a Conjugate[b] - Conjugate[a] b, a b Conjugate[c] Conjugate[d] - c d Conjugate[a] Conjugate[b], a b c d - Conjugate[a b c d] } /. { a_ - b_ :> 2 I Im[a] /;...


1

If you want to put an expression into a specific form, particularly if the desired form is not simpler in the normal sense (i.e., using the default complexity function), it may be easier using replacement rules along with ReplaceAll Clear["Global`*"] The given identities are equivalent to these rules. repl = {(1 - t_)*JacobiP[n_, α_, β_, t_] :> 2/(...


10

It has to do with how the evaluation is performed. The substitution results in (0*Sin[n*Pi])/(2*(-1)^(1 + n)*Pi + 2*Pi*Cos[n*Pi]) which evaluates to 0 before it gets passed to FullSimplify. Before it is passed, n is just a variable, so the expression is not Indeterminate. If you wish to get Indeterminate, just use FullSimplify as follows: ((1 - Cos[θ])...


0

Still struggling with this and have come across what appears to be a better answer. It was suggested by TransformationFunctions, which that proved a bit disappointing, but led to this approach. Illustrated with the example: f[x_, y_] := (1 - Exp[-y x] - y x); Assuming[f[s[v], u] == f[s[v], v], Simplify[f[s[v], u] - f[s[v], v]]] The assertion that ...


0

Version 8.0 has no problem, showing lhs-rhs=0, eq1[d, q, h] (* -((-1)^(2 d) (-h)^ d Gamma[(-1 + h + d h)/h] Gamma[(h + d h - q)/ h] HypergeometricPFQ[{-d, -d - 1/h, 1 + q/h}, {1 - 1/h, -d + q/h}, 1])/(Gamma[2 + d] Gamma[(-1 + h)/ h] Gamma[-(q/h)]) *) eq2[d, q, h] (* -((-1)^(2 d) (-h)^ d Gamma[(-1 + d h)/h] Gamma[(d h - q)/ h] ...


2

If your list consisted of a mixture of integers and non-integers, then it might be better to use Replace: l = {1, {2, {{3, 4}, {5, 6.1}}, 7, 8}}; Replace[ l, i_Integer :> "a" <> IntegerString[i], {-1} ] {"a1", {"a2", {{"a3", "a4"}, {"a5", 6.1}}, "a7", "a8"}}


3

Update If I understand your two-step string prefix concatenation correctly then this should work s1 = Map[ToString, l, {-1}]; prefix = "EGME "; Map[prefix <> # &, s1, {-1}] (* {"EGME 1", {"EGME 2", {{"EGME 3", "EGME 4"}, {"EGME 5", "EGME 6"}}, "EGME 7", "EGME 8"}} *) Map[ToString, l, {-1}] (* {"1", {"2", {{"3", "4"}, {"5", "6"}}, "7", "8"}} *)...


6

l = {1, {2, {{3, 4}, {5, 6}}, 7, 8}}; result=IntegerString[l] {"1",{"2",{{"3","4"},{"5","6"}},"7","8"}} Per your comment question, either map on result, or just combine into one map (here prefixing with "a" for example): Map["a" <> # &, result, {-1}] Map["a" <> IntegerString@# &, l, {-1}] Both give: {"a1",{"a2",{{"a3","a4"},{"a5",...


1

BooleanMinimize[! a && b || b && ! c || b && c || a && ! b && ! c] (* (a && ! c) || b *) If you want a specific form: F = ! a && b || b && ! c || b && c || a && ! b && ! c; {#, BooleanMinimize[F, #]} & /@ {"DNF", "CNF", "ANF", "NOR", "NAND", "AND", "OR"} // ...


2

Is this enough Simplify[!a&&b||b&&!c||b&&c||a&&!b&&!c,Element[a|b|c,Boolean]] which instantly returns (a && !c) || b


3

Observing that $7- \sqrt {50}\lt 0$ and letting (-1)^(1/3)->-1 we have FullSimplify[(7 + Sqrt[50])^(1/3) - (-7+ Sqrt[50])^(1/3)] (* Out 2 *) Thanks to @yarchik.


4

Another way CubeRoot[7 + Sqrt[50]] + CubeRoot[7 - Sqrt[50]] // FullSimplify (*2*)


3

Surd[7 + Surd[50, 2], 3] + Surd[7 - Surd[50, 2], 3] // FullSimplify


3

expr = ((2 + z)^2*((\[DifferentialD]xC)^2 + (\[DifferentialD]xM)^2 + (\[DifferentialD]xY)^2))/(4*(1 + z)^2); Collect[expr, HoldPattern@Plus[__Power], Defer] TeXForm @ % $$\frac{(z+2)^2}{4 (z+1)^2} \left((d\text{xC})^2+(d\text{xM})^2+(d\text{xY})^2\right)$$


7

Coefficient[(t0M^2 + t1M^2)*xC/(2*t0M^2), xC] (t0M^2 + t1M^2)/(2 t0M^2)


1

I am assuming they want Conjugate[Exp[I a]^(2 n)] to become (Exp[I a]^(-2 n) ? By using a rule (De Moivre’s formula) (I do not see how it is possible otherwise) ClearAll[a, n, r, m]; expr = Exp[I a]^(2 n); e1 = ExpToTrig[expr] /. r_. (Cos[a_] + I Sin[a_])^(m_.) :> r^m (Cos[m a] + I Sin[m a]); FullSimplify@Conjugate[e1] Using ComplexExpand (just to ...


3

Recently there's someone who asked me for this, I prepared an answer and now post it here. SumHeld /: MakeBoxes[SumHeld[expr_, ranges__], form_] := MakeBoxes[Sum[expr, ranges], form] SumHeld /: SyntaxInformation[SumHeld] = {"LocalVariables" -> {"Table", {2, Infinity}}}; IndexUnify[HoldPattern@Plus[sums:SumHeld[_, __]..]] := Plus@@With[ { ...


6

Check numbers for zero precision and replace with 0. foo = x + 1234567`3 - 1234567`3 (* 0.*10^3 + x *) foo /. x_Real /; Precision[x] <= 0. -> 0 (* x *) Edit: Another way is to use SetPrecision instead of Chop. That sets zero precision numbers in the expression to exactly zero. SetPrecision[foo, Infinity] (* x *)


0

One approach is to just visually check the output of your expression for large-and-repeated terms. I found three of them, and (by copy-pasting them into the following), replaced them with A, B, and R, respectively: exp2=exp /. {(I*k*z*(-Sqrt[4*\[CapitalOmega]c^2*\[CapitalOmega]d^2*E^(I*\[Theta]c + I*\[Theta]d) + \[CapitalOmega]c^4 - 2*\[CapitalOmega]c^2*...


4

The positive definiteness will be handled with the NCAlgebra Suite 5,0 from here With the codes for convexHull and ExtractElements given here you can proceed as follows << NC` << SDP` PosChar[p_, c_] := ToExpression[StringJoin[ToString[p], ToString[c]]] SymmetricalMatrix[name_, dim_] := Module[{dummy, vars = {}, i, j, k, c}, dummy = Table[0, {...


2

Define your own function. Clear["Global`*"] gamma[x__] := Module[{g = Gamma[x]}, If[FreeQ[g, _Gamma], Inactive[Gamma][x], g]] gamma /@ {6, x} (* {Inactive[Gamma][6], Gamma[x]} *) gamma @@@ {{1, z}, {a, z}} (* {Inactive[Gamma][1, z], Gamma[a, z]} *) gamma @@@ {{1, 0, -a}, {a, z0, z1}} *) (* {Inactive[Gamma][1, 0, -a], Gamma[a, z0, z1]}


8

I presume that you wish to eliminate some variables in the last expression in terms of variables defined in the other expressions. Let me begin with two pieces of advice: Do not use subscripted variables. They may look nice, but they can cause problems. Simplification is in the eye of the beholder. Mathematica's idea of simplification, based on LeafCount,...


3

Try TensorReduce $Assumptions = {A ∈ Matrices[{n, n}], B ∈ Matrices[{n, n}]}; expr = Commutator[A + B, Commutator[A + B, A - B]] - Commutator[A - B, Commutator[A + B, A - B]]; TensorReduce[expr] (* A.MatrixPower[A - B, 2] + 2 A.MatrixPower[B, 2] + A.MatrixPower[A + B, 2] + B.MatrixPower[A - B, 2] - B.MatrixPower[A + B, 2] + 6 MatrixPower[B, 2].A - 6 ...


8

What is "simpler" or more complex is a very subjective question. The topic has come up a few times before (see e.g. my previous answer to Advice for Mathematica as Mathematician's Aid and links therein). The Simplify functions fiddle with an expression systematically in an attempt to minimize a pre-defined "complexity function", which is loosely based on ...


0

I am not certain that this is what you are looking for? f[x_] := p^x Reduce[f[x] > q && q > 0, p, Reals] Visual: With[ {f = p^x}, Manipulate[ Plot[{f, q}, {x, 0, 2}, Filling -> {1 -> {{2}, {Orange, Blue}}}], {{p, 1/2}, -1, 1}, {{q, 1/2}, -4, 4} ] ]


2

expr = Sqrt[1 + 10^(rdb/10) + 2^(1 + rdb/20) 5^(rdb/20) Cos[pdiff]]; fd = FunctionDomain[expr, {rdb, pdiff}] (* 10^(rdb/10) + 2^(1 + rdb/20) 5^(rdb/20) Cos[pdiff] >= -1 *) As you stated, Simplify or FullSimplify change the domain exprs = expr // Simplify (* Sqrt[1 + 10^(rdb/10) + 10^(rdb/20) Csc[pdiff] Sin[2 pdiff]] *) FunctionDomain[exprs, {rdb, ...


6

vsol = V1 /. NSolve[(Sqrt[u1^4 + A1] - u1)/(A1*D1) + L1/(Sqrt[u1^3 + A1]), V1][[1]] Plot[vsol, {u1, 0, .01}] This is a case where I would recommend rescaling your units so you are not multiplying large numbers with small numbers and then adding and subracting them. Or you could do something like this: V5 = 0; Q1 = Rationalize[1.6021*10^(-19), 10^(...


1

The answer that I was looking for is sim = Pochhammer[ x_. (z_. n + a_), m___] :> Pochhammer[ x a, m + x z n]/ Pochhammer[x a, x z n] It does the following simplifications in:= Pochhammer[2 n + a, m] //. sim out:=Pochhammer[a, m + 2 n]/Pochhammer[a, 2 n] in:=Pochhammer[n + 3 a, m] //. sim out:=Pochhammer[3 a, m + n]/Pochhammer[3 a, n] in:=...


5

Clear["Global`*"] expr = (25 A^2 hbar Sqrt[π])/Sqrt[hbar m w]; Presumably, your E is not intended to be the numeric constant 2.71828... Using \[DoubleStruckCapitalE] instead rule = \[DoubleStruckCapitalE] -> Sqrt[m w/hbar] x; Assuming that {m > 0, w > 0, x > 0, \[DoubleStruckCapitalE] > 0} expr /. Solve[Equal @@ rule, hbar][[1]] // ...


2

As Rohit mentioned, what you see on the screen is not necessarily what Mathematica sees. Using FullForm on your function shows that Mathematica actually sees Times[Power[a, -1], Power[b, Rational[-1, 2]]] whereas Sqrt[b]//FullForm gives Power[b, Rational[1, 2]] (note the difference in the first argument of Rational). You actually need something ...


1

To ascertain the nullity we can follow with s = Normal[Series[c, {t, 0, 5}]] // Factor and a null common factor appears $$ a^2 \left(-\sqrt{-2 a \sqrt{a^2-b^2}+2 a^2-b^2}\right)-a^2 \sqrt{2 a \sqrt{a^2-b^2}+2 a^2-b^2}-a \sqrt{a^2-b^2} \sqrt{-2 a \sqrt{a^2-b^2}+2 a^2-b^2}+a \sqrt{a^2-b^2} \sqrt{2 a \sqrt{a^2-b^2}+2 a^2-b^2}+b^2 \sqrt{-2 a \sqrt{a^2-b^2}+...


2

You say, you know, that c should be zero. Let Reduce test whether it can be unequal zero. Reduce[{a > b, b > 0, t > 0, c != 0}, {a, b, t}] (* False *) Edit Another way to show c == 0 Substitute the a-b-squareroute by d and take the b-solution that is > 0. sol = Solve[Sqrt[a^2 - b^2] == d, b] (* {{b -> -Sqrt[a^2 - d^2]}, {b -> Sqrt[...


6

The result is 0, and we can show it by a smart choice of transformation. expr is what I define as the expression that OP wants to simplify: expr=Sin[t] (b^2 Cos[t] (1/Sqrt[(Sqrt[a^2-b^2]-a Cos[t])^2+b^2 Sin[t]^2]+1/Sqrt[(Sqrt[a^2-b^2]+a Cos[t])^2+b^2 Sin[t]^2])-a ((-Sqrt[a^2-b^2]+a Cos[t])/Sqrt[(Sqrt[a^2-b^2]-a Cos[t])^2+b^2 Sin[t]^2]+(Sqrt[a^2-b^2]+a Cos[t]...


2

Not an answer, as I could not figure out why, just to confirm that it should be zero Clear[a, b, c, t, e, r] L[vektor_] := Sqrt[Total[vektor^2]]; r = {a Cos[t], b Sin[t]} e = {Sqrt[a^2 - b^2], 0}; c = ((r - e)/L[r - e] + (r + e)/L[r + e]).D[r, t] Manipulate[ Plot[c /. {a -> a0, b -> b0}, {t, -200, 200}], {{a0, 1, "a"}, -100, 100, 1}, {{b0, 1, "b"},...


Top 50 recent answers are included