Tag Info

New answers tagged

2

Use Collect[expr, a, Simplify[#, Trig -> False] &] I find this and related expressions very useful. It should be documented better in MMA.


4

If you have Version 10: rF = # /. Power[x_,y_]:>Inactive[Times]@@Table[x,{y}]&; (* or rF = # /. Power->(Inactive[Times]@@Table[#,{#2}]&)&; *) lst = {(a + b)^3, Ftp^2, Sin[th]^2}; rF@lst (* {(a+b)*(a+b)*(a+b),Ftp*Ftp,Sin[th]*Sin[th]} *) Or rF2 = Block[{Power=Inactive[Times]@@Table[#,{#2}]&},#]& rF2 @ lst (* ...


2

here is another way to approach the problem...


4

Since you give the constraint l > x > 0, you should make use of that constraint f[x_] = 1/2 Sqrt[(l^4 + x^4)^2/(l^4 x^2)]; min = FullSimplify[ Minimize[{f[x], l > x > 0}, x], l > x > 0] min[[1]] == Simplify[f[x /. min[[2]]], l > 0] True f'[x] /. min[[2]] 0 Simplify[(f''[x] /. min[[2]]) > 0, l > 0] True


9

The output looks fine to me. It is, however, relatively complicated. Consider the following simpler example Minimize[x (x - c), x] (* Out: {-c^2/4, {x -> c/2}} *) Thus, there is a minimum value of $y=-c^2/4$ at $x=c/2$, as expected. Now, let's complicate things slightly. Minimize[c x (x - c), x] This is a piecewise expression, which is ...


7

Manipulate[ p = {x, s@x} /. Last@Minimize[{s@x, l > x > 0}, {x}]; Plot[s@x, {x, 0, l}, Epilog -> {PointSize[Large], Point@p}, PlotLabel -> p], {l, 1, 10}, Initialization :> {s@x_ := 1/2 Sqrt[(l^4 + x^4)^2/(l^4 x^2)]}]


1

The problem is that the number of trigonometric transformations that Mathematica could try is rather large and grows with every step. This problem is compounded with the problem that the LeafCount does not always go down with every step. Let me illustrate this with a potential series of steps that Mathematica could have taken to arrive at the solution. ...


5

If you want to incorporate the realness assumption directly into the evaluation of the derivative, you can define it for all subsequent computations by setting Derivative[1][Abs][x_] := Sign[x] Abs'[1. - a] (* ==> Sign[1. - a] *) This works because Derivative is not a protected function. Of course, just as with the replacement by $\sqrt{x^2}$, this ...


6

Mathematica does not have a rule for the derivative of Abs. Assuming that the term arose from taking the derivative with respect to a then taking the derivative of Abs[1-a] results in D[Abs[1 - a], a] -Derivative[1][Abs][1 - a] which would recurse forever if it evaluated. Note Plot[{Abs[1 - a], -Sign[1 - a]}, {a, -5, 5}, PlotLegends -> ...


3

A simple replacement is (-1)^(1/5) /. z_ :> Abs[z]*Exp[I*Arg[z]] E^((I*Pi)/5) While equivalent for the specific example of (-1)^(1/5), this approach is more general than PowerExpand. For example n = 5; Prepend[ Table[{ x = (-3)^(m/n), PowerExpand[x, Assumptions -> True], x /. z_ :> Abs[z]*Exp[I*Arg[z]]}, {m, n - 1}], ...


4

Here is a function JM wrote for this task. polarForm[z_] := Module[{rt, f}, If[Im[z] == 0 && Positive[Re[z]], Return[z]]; rt = Through[{Abs, Arg}[z]]; f = Which[rt[[1]] == 1, Defer[E^(I #2)] &, rt[[2]] == 1, Defer[#1 E^I] &, True, Defer[#1 E^(I #2)] &]; f @@ rt] For example: polarForm[1 + I] Sqrt[2] E^((I π)/4) ...


6

PowerExpand[(-1)^(1/5), Assumptions -> True] Assumptions -> True is necessary here, which is documented in PowerExpand.


2

I agree with @Belisarius that simplification attempts can drive you nuts. It seems especially unlikely that mat2 can be simplified easily into Hill2, because mat2 is the simpler form to begin with. However, it is straightforward to simplify each pair into the same forms. Use FullSimplify[Expand[Hill1]]; FullSimplify[Expand[mat1]]; ...


0

Eliminate seems to work well. Stealing @Wolfgang's expressions: eqs = DeltaQ == ((p1 Cp)/R) (V2 - V1) + ((V2 CV)/R) (p2 - p1) given = {p1 V1^(gamma) == p2 V2^(gamma), gamma == Cp/CV} If you want to eliminate p2 Eliminate[{eqs}~Join~ given, {p2}] // Solve[#, DeltaQ] & // FullSimplify {{DeltaQ$\to \frac{\text{p1} \left(\text{Cp} ...


3

If you have version 10, you can also use AllTrue: h[x__] :=Sign@Times[x] Simplify[h[Sequence @@ #], AllTrue[#, Negative]] &@{a, b, c} (* -1 *) Simplify[h[Sequence @@ #], AllTrue[#, Negative]] &@{a, b, c, d} (* 1 *)


5

One way is: Simplify[expr[Sequence @@ #], Thread[# > 0]] &@{a, b, c, d, e, g, f} (* expr[a, b, c, d, e, g, f] .... Simplify has nothing to do in this simple case*) g[x_, y_] := x + Abs@y Simplify[g[Sequence @@ #], Thread[# > 0]] &@{a, b} ( a + b *) packing it: g[x_, y_] := x + Abs@y simpWithAssump[symb_, vars_] := Simplify[symb[Sequence ...


1

Nothing can be more simple. Let us do it. This is your starting expression: expr = (Sqrt[m*e] - Sqrt[m*(e - V)])^2/(Sqrt[m*e] + Sqrt[ m*(e - V)])^2; Here is a simplification function: mySimp[expr_] := Simplify[expr, {m > 0, e > 0, V > 0}]; Now let us take the numerator and denominator of the expression: num1 = Numerator[expr]; den1 = ...


2

I suppose you could try Expand first and then Simplify. Simplify[Expand[(Sqrt[a b] + Sqrt[a c])^4/a^2], a > 0] (* (Sqrt[b] + Sqrt[c])^4 *) Though admittedly this isn't my forte. Worth noting is that with all of your assumptions it results in an expression with higher LeafCount than the original. Simplify[Expand[(Sqrt[a b] + Sqrt[a c])^4/a^2], a ...


1

Ah, I got to know the answer at another page on this site on simplifying an expression. The point is to make 'Assumptions' in Mathematica So, the following works: Simplify[(1/a^13)^(1/13), Assumptions -> a > 0] Or one can declare Assumptions separately.


1

Please be sure what you are doing! Mathematica always treats variables to be complex by default. Are the power laws correct in this general assumption? Here you can go with PowerExpand[(1/a^13)^(1/13)] but don't forget the warning in its documentation: The transformations made by PowerExpand are correct in general only if c is an integer or a and b ...


0

Ok, there's got to be a better way, but for the time being you could use the following. First define a function f (for lack of a better name) that transforms the argument: f[expr_] := {1, -1}.List @@ Solve[0 == expr][[1, 1]] f[1 + x - x^2 + x^3] 1/3 (-1 + 2/(-17 + 3 Sqrt[33])^(1/3) - (-17 + 3 Sqrt[33])^(1/3)) + x Then, you commute the function ...


1

You might formulate a list of rules that take into account the existing relations, such as the following. Assume there are 2 known relations p1.p2=mand p1.q1=s. The rules are as follows: rules = {p1.p2 -> m, p2.p1 -> m, p1.q1 -> s, q1.p1 -> s}; Their application is straightforard: 2 (p1.q1) (p3.p2) + (p1.p2)^2 /. rules (* m^2 + 2 s ...


1

This seems to come close. The idea is to find factors, at all levels, that are not numeric and are independent of the variable. Set up replacement rules for these in terms of some new symbol. Do the replacement. I also return the rules used in case that might be useful. replaceFactors[expr_, x_, c_Symbol] := Module[ {e2 = MapAll[Collect[#, x] &, ee], ...



Top 50 recent answers are included