# Tag Info

0

I am avoiding Beta and Gamma but using symbols as the former are special symbols in Mathematica. The rules can be applied for simplification: exp = h (140 + Current - lastU1 + (lastV1 + 1/2 h (140 + Current - lastU1 + (5 + 0.04 lastV1) lastV1)) (5 + 0.04 (lastV1 + 1/2 h (140 + Current - lastU1 + (5 + 0.04 lastV1) ...

1

While this won't work in general with very complicated expressions (see the other post for more general approaches), you could try simple replacement rules to get a reasonable degree of simplification. If you had only linear relations, that would work for sure. In the case of your 'toy' example expr = h (140 + Current - lastU1 + (lastV1 + 1/2 h (140 + ...

4

expr2 = Sum[(8^(-11 - 2 t) (22 + 4 t)!)/(t! (11 + t)! (11 +2 t)!) 1/(q + t), {t, 0, Infinity}] % /. q -> 32 FunctionExpand[%]

0

I can't find a way to do it with both low memory and reasonable time consumption, but here is what I did when I encountered a similar problem. Basically you need to do some math for MMA. The math part Your p1 can be expanded by the so called multi-binomial theorem: $$\begin{split} p_1=&\prod_{k=1}^m (a\,t^k + b\,t^{m-k} )\\ =&\sum_{j_1=0}^1 ... 0 In this specific case I believe that this will do the same operation in one command: Collect[p1, a, CustomIntegration] // ByteCount 12728 Collect[p1, a, CustomIntegration] === (CustomIntegration /@ Expand[p1]) True However, this apparent success is false, as one can see using MaxMemoryUsed that much more memory is allocated: (* in a fresh ... 4 Maybe TimeConstraint is helpful: y = Gamma[1 - x] Gamma[x] Sin[Pi x] + Gamma[x] Gamma[1 - x] Sin[Pi (1 - x)]; FullSimplify[y, TimeConstraint -> 0.000001] FullSimplify[y, TimeConstraint -> 0.0001] FullSimplify[y, TimeConstraint -> 0.01] Gamma[1 - x] Gamma[x] Sin[π (1 - x)] + Gamma[1 - x] Gamma[x] Sin[π x] 2 Gamma[1 - x] Gamma[x] Sin[π x] 2 π 4 The only method I can think of that will use the built-in simplification routines is to snoop on transformations using either TransformationFunctions or ComplexityFunction. Unfortunately neither of these will be restricted to the entire expression therefore what is produced may not be usable. Nevertheless as an example: FullSimplify[Gamma[1 - x] Gamma[x] ... 0 I suspect this happens because the expression you are trying to simplify contains machine precision floating point numbers (though without seeing your expression this remains only supposition). Would it be possible to re-express it so that it contains only exact numbers and rationals? That is, replacing quantities like 0.5 with 1/2 4 Resolve[Exists[z, Abs[(Sqrt[1 + 2 z] - 2)/(2 z - 3)] > 1], Complexes] (* False ... after a few looong minutes *) Edit Slightly faster: Reduce[FullSimplify[Abs[(Sqrt[1 + 2 z] - 2)/(2 z - 3)]] <= 1, z, Complexes] Edit 2 Much faster: See that: FullSimplify[Abs[(Sqrt[1 + 2 z] - 2)/(2 z - 3)]] (* 1/Abs[2 + Sqrt[1 + 2 z]] *) So: ... 1 Another way is basically use the Mathematica's build in Head for all expressions. The following may seem less elegant but works for arbitrary number of summands: Cos[(intp[a]+intp[b]+intp[c]+intp[d])*Pi]/.Cos[(Plus[x__])*Pi]:>Hold[-1^x] /;SameQ@@((Head/@List@@x)~Join~{intp}) (* Hold[-1^(int[a]+int[b]+int[c]+int[d])] *) where intp is positive integer. ... 9 Here's another way: Assuming[Element[{i, j, k}, Integers], Refine[Cos[(i + j + k) Pi]]] 3 Element is not Listable, also, Positive is not valid domain so it is reasonable to me that it is not working. If you put the assumptions more carefully then everything is alright: Simplify[Cos[(i + j + k)*Pi], Element[{i, j, k}, Integers] && And @@ (# > 0 & /@ {i, j, k}), ComplexityFunction -> LeafCount] ... 6 FullSimplify[Cos[(i + j + k)*Pi], Assumptions -> Element[i + j + k, Integers], ComplexityFunction -> LeafCount] (-1)^(i + j + k) Simplify[Cos[t*Pi], Element[t, Integers]] /. t :> i + j + k (-1)^(i + j + k) 1 The problem is that though FullSimplify does its best to find as simple form as possible in a reasonable time, it's not smart enough to handle all possible cases (and, actually, that would be an undecidable problem in general). But your indentity seems to be well-known and compelling, so I would recommend to send it as a suggestion to support@wolfram.com. 2 There is a simple Combine function , which in essence is just: Combine[x_] := Module[{combinet1, combinet2}, combinet2 = Together[ x /. Plus -> ( If[ FreeQ[{##}, _^_?Negative] && FreeQ[{##}, Rational], combinet1[##], Plus[##] ] &) ] /. combinet1 -> Plus] ... 0 You can try to write your own ComplexityFunction for the task. For instance, this function produces different results from default: FullSimplify[Sum[R^i, {i, 0, 6}], ComplexityFunction -> (2 Count[#, Plus, Infinity, Heads -> True] + Total@Cases[#, _^n_ :> n, Infinity] &)] 1 + R (1 + R) (1 - R + R^2) (1 + R + R^2) It's not what ... -1 I'm not sure I agree that the form you present is simpler, but you can get a fully factored form of a polynomial using Solve. Here is your polynomial poly = Total[r^Range[0, 6]] 1 + r + r^2 + r^3 + r^4 + r^5 + r^6 Solve[poly==0] {{r -> -(-1)^(1/7)}, {r -> (-1)^(2/7)}, {r -> -(-1)^(3/7)}, {r -> (-1)^(4/7)}, {r -> -(-1)^(5/7)}, {r -> ... 3 I usually set up a wrapper function that transforms if input is valid and otherwise acts like Identity: pickyTransform[expr_] := 0 helper[expr_] /; ! AtomQ[expr] && FreeQ[expr, _?NumericQ] := pickyTransform[expr] helper[expr_] := expr FullSimplify[a^3 + x^y, TransformationFunctions -> {helper}] (* a^3 *) This works fine most of the time, but ... 2 Using FunctionExpand as suggested by Vladimir can improve the simplification, but for some inputs FunctionExpand is very slow in this case MeijerG is the one causing problems. By replacing all occurances of MeijerG with a temporary symbol it is possible to get improved results quicker: safeApply[f_, expr_, bad_List] := Module[{ badOnes = ... 1 By squaring both expressions and making some assumptions we can show them equal.. Simplify[ (Sqrt[L^2 M + Sqrt[L^2 (-J^2 + L^2 M^2)]]/Sqrt[2] )^2 == ( Sqrt[L]/2 (Sqrt[L M + J] + Sqrt[L M - J]))^2 , Assumptions -> { L > 0, M > Abs[J/L]}] (* True *) As near as I can tell under those ... 1 Are you sure that the first expression can be simplified to the second? o1 = Sqrt[L^2 M + Sqrt[L^2 (-J^2 + L^2 M^2)]]/Sqrt[2]; o2 = Sqrt[L]/2 (Sqrt[L M + J] + Sqrt[L M - J]); and ru = {L -> 5, M -> 2, J -> 3.}; Then just o1 /. ru o2 /. ru 2 I managed to teach Mathematica calculate the integral for arbitrary n, with a little aid:$$\int_0^L\rho(n,x)\ln(\rho(n,x))dx = (2/L)\int_{0}^{L}\sin^2(n\pi x/L)\ln\left[(2/L)\sin^2(n\pi x/L)\right]dx Mathematica has trouble, apparently, handling all the parameters $(n,L,x)$, so I resort to the following substitution: $n\pi x/L=u \Rightarrow (n\pi/L) ... 2 Here's a way to approach this by defining a function for each$n\$, which you can then do separately. L = 1; u[n_, x_] := Sqrt[2/L] Sin[n π x/L]; ρ[n_, x_] := u[n, x]\[Conjugate] u[n, x]; integrand[n_, x_] := Simplify[-ρ[n, x] Log[ρ[n, x]], n ∈ Integers && x ∈ Reals] Now calculate the desired integral: Integrate[integrand[1, x], {x, 0, L}] -1 + ...

Top 50 recent answers are included