Tag Info

New answers tagged

0

Ok, so first of all sorry if I was not clear enough with my questions. Anyway, I went back to the drawing board last night, and I followed the idea that perhaps the functions Together and Apart tend to exaggerate what they do in the sense of LeafCount. Take the follwing expression: a/e + b/e + c/f + d/f + Log[x] Together produces something which has too ...


0

This is your expression: expr = (-3 a - 2 a^3 + 4 Sqrt[1 + a^2] (5 - 9 Log[2]) + 4 a^2 Sqrt[1 + a^2] (5 - 9 Log[2]) + 12 (1 + a^2)^(3/2) Log[1 + Sqrt[1 + 1/a^2]] - 6 (4 (Sqrt[1 + a^2] - a (2 + a^2 - a Sqrt[1 + a^2])) Log[a] + a Log[1 + a^2]))/(12 (1 + a^2)^(3/2) Sqrt[2 \[Pi]]); Let us make a variable change: expr1 = expr /. a -> Sqrt[x - 1] ...


0

Perhaps, With[{n = Simplify[Numerator[expr]/R^2], d = Simplify[Denominator[expr]/R^2]}, n/d] this yields:(g (m1 - m2))/(m1 + m2 + J/R^2)


2

There are many ways to make this. For example, this one is simple, but is a bit not regular, that is, depends upon the structure of the expression at hand: expr = (R^2*(g*m1 - g*m2))/(J + m1*R^2 + m2*R^2); (expr /. J -> j*R^2 // Simplify) /. j -> J/R^2 (* (g (m1 - m2))/(m1 + m2 + J/R^2) *) This one is more regular though a bit longer: ...


0

Ok, another version of Chuy's answer, only simpler: expr = R^2 (g m[1] - g m[2])/(J + m[1] R^2 + m[2] R^2); Simplify[Numerator[expr]/R^2]/Simplify[Denominator[expr]/R^2] This could be put into a function, but the point is that the use of TransformationFunction inside Simplify is unnecessary, I think. I'm new to this game and I'm struggling with exactly ...


0

Map trigfactor only to the second level in the expression: Map[Map[TrigFactor, Collect[#, {a, b, f}], {2}] &, X] {{0, 0, 0, 0, 0, 1} -> 2 Sqrt[3] b f Cos[Pi/6 - y] + a f (-2 - 2 Sin[Pi/6 - x + y]), {0, 0, 0, 1, 0, 1} -> -2 f^2 Sin[Pi/6 - x + y]} ( I think your desired output expression is off.. )


0

Well, if it is only for $\frac{1-cos[c x]}{c}$, I tried the following which works perfectly (even without assumptions): FullSimplify[((1 - Cos[c x])/(c x))/ Sinc[c x]] Sinc[c x] which in turn yields: Sinc[c x] Tan[(c x)/2] I am not sure about the bigger context where you want to use that, expanding this technique depends on what you want to do exactly. ...


1

It seems you want to collect scaling factors ce = Collect[ 1/2 (Sqrt[3] Cos[x] la - Sin[x] la - lb + Sqrt[3] Cos[x + y] lc - Sin[x + y] lc), {la, lb, lc}] -(lb/2) + 1/2 la (Sqrt[3] Cos[x] - Sin[x]) + 1/2 lc (Sqrt[3] Cos[x + y] - Sin[x + y]) which allows one to use TrigFactor /@ ce -(lb/2) + la Cos[\[Pi]/6 + x] + lc Cos[\[Pi]/6 + x + y]


1

expr = 1/2*(Sqrt[3]*Cos[x]*la - Sin[x]*la - lb + Sqrt[3]*Cos[x + y]*lf - Sin[x + y]*lf) FullSimplify[expr, TransformationFunctions -> {Automatic, TrigFactor}] -(lb/2) + la Cos[π/6 + x] + lf Cos[π/6 + x + y]


1

One way to do it would be Total@TrigFactor@ Level[HornerForm[ 1/2*(Sqrt[3]*Cos[x]*la - Sin[x]*la - lb + Sqrt[3]*Cos[x + y]*lf - Sin[x + y]*lf)], 1] I just put it in Horner Form, Broke the sum terms into a list(Level["expression", 1]), factored each list element, then added them all together. The output in this case being what you desired, -(lb/2) + ...


1

You could call a function that fetches all WolframAlpha alternate expression forms: AlternateExpressionForms[expression_]:=Module[{alternateFormData}, alternateFormData={}; alternateFormData=Quiet[Check[TimeConstrained[ReleaseHold[WolframAlpha[ToString[expression,InputForm],{"AlternateForm","Input"}]],60],{}]]; ...


6

Use the TrigFactor[] function, as in TrigFactor[1/2*(Sqrt[3]*Cos[x] - Sin[x])] Output Cos[Pi/6 + x].


7

One idea is to extend the domain with a piecewise function by taking limits at singularities. ExtendFunctionDomain[expr_, vars_] := Module[{domain, antidomain, locassums, lims}, domain = FunctionDomain[expr, vars, Reals] /. { NotElement[f_, S_] :> Not[f == C[1] && Element[C[1], S]] }; antidomain = Reduce`ToDNF[Reduce[!domain, vars, ...


2

fulldata = Table[RandomReal[], {10}, {30}]; If you want short/simple plotting code: ListLinePlot[ Drop[fulldata,{5}], PlotLegends -> Delete[Range[10], 5]]


16

It is proposed an improvement based on VOISimplify: ExpressionUnknownSymbols[expression_]:=Union@Cases[expression,Except[__Symbol?(Context@#==="System`"&),_Symbol],{1,Infinity},Heads->True] SetAttributes[ExpressionUnknownSymbols,Listable]; (*Mathematica's default ComplexityFunction*) SimplifyCount[p_]:=Which[ Head[p]===Symbol,1, ...


1

Radicals are traditional bronze-age mathematics, but they aren't the nicest way to express the roots of a polynomial. Radical expressions are numerically unstable when a discriminant is near zero, and they often require complex arithmetic even for real results, as you've seen. In the space age, we have Root objects, one of the real gems of Mathematica. ...


4

Such an equation cannot be solved symbolically by Solve, but a solution might be approximately determined with FindRoot. Looking at the left-hand side: Plot[(1 - ((-1 + x)^E x^(1 - x) Log[x]^-E)^(1/(-1 + E)))/(-1 + x), {x, 0, 10}] which has a (real) domain of x > 0, we see that the only integers for which the equation is likely to have a solution ...


0

Using the value of expr from your question, you can extract the coefficient of the $\cos$ function and the constant part as follows: coscoefficient = Coefficient[expr, Cos[angle n]]; constantpart = expr - coscoefficient * Cos[angle n]; You can check that indeed your expression expr can be reconstructed from those two parts: constantpart + Cos[angle ...


1

One possibility is the following: Suppose you put this into a file called f.m : If[FindFile["FeynCalc`"] === $Failed, (* as explained here: https://github.com/FeynCalc/feyncalc/wiki/Installation *) Import["http://users.ph.tum.de/ga57tah/feyncalc/FeynCalcInstallNightly.m"] ]; Needs["FeynCalc`"]; (* assuming you use Fortran 90 or newer*) ...


3

The behavior seems to be a bug of Mathematica. Here is an excerpt from an email I got from Wolfram after asking them about the problem: It does seem that the answer of FullSimplify is incorrect especially since the exponential function is not identical to zero (or a very-close-to-zero constant). Therefore, I filed a report with our development team ...


3

You might find it helpful to define TransformationFunctions, which is an option to FullSimplify. For example: t[term_][expr_] := Simplify[Numerator[expr]/term]/Simplify[Denominator[expr]/term] expr = R^2 (g m[1] - g m[2])/(J + m[1] R^2 + m[2] R^2); FullSimplify[expr, TransformationFunctions -> {Automatic, t[R^2]}] (* (g (m[1] - m[2]))/(J/R^2 + ...


1

In its core, an assignment in Mathematica is always just a replacement rule. If I understood you correctly, then the solution to your problem is to simply use replacement rules instead of trying to assign your first equation. Let me show you what I mean: g3expr = -1 + G (1 - x) + G^2 x; poly = 2 G^2 + 6 G^2 x + 4 G^3 x + 3 G^2 x^2 - 8 G^3 x^2 - 2 G^4 x^2; ...


0

expr = 1/4 (-(1/4) + Sqrt[5]/4 + I Sqrt[5/8 + Sqrt[5]/8]) (-1 - Sqrt[5] + 2 Sqrt[7/2 + (5 Sqrt[5])/2]); expr2 = expr // Simplify You can in this case -- and may with the full expressions -- get a simpler form if you express in terms of the GoldenRatio (expr3 = (expr /. Sqrt[5] -> 2 Inactive[GoldenRatio] - 1) // Simplify // Activate) // ...


2

Root-expressions are very useful. It is worth reading the documentation about it. Often, doing computations with Root-expressions is simpler and more general than with Radicals. Having said that, it might be that you are looking for something like this: FullSimplify[1/4 (-(1/4)+Sqrt[5]/4+I Sqrt[5/8+Sqrt[5]/8]) (-1-Sqrt[5]+2 Sqrt[7/2+(5 Sqrt[5])/2]), ...


1

Second update (2015-05-11): Amandeep, you recently left a comment with the following expression: xpr = a1*D11*Cos[n*x] + a0*a1*D11*Cos[n*x] + 1/2*a1*a3*D11*Cos[n*x] + 1/2*a2*a4*D11*Cos[n*x] + a2*a3*a4*Sin[n*x] I believe that you may have left out a multiplication sign on the argument of the last Sin function. Once we add that back in, the approach using ...


0

Have you tried Simplify expr = a1 D11 Cos[n x] + a0 a1 D11 Cos[n x] + 1/2 a1 a3 D11 Cos[n x] + 1/2 a2 a4 D11 Cos[n x]; expr // Simplify 1/2 (a1 (2 + 2 a0 + a3) + a2 a4) D11 Cos[n x] expr2 = a1*D11*Cos[n*x] + a0*a1 D11*Cos[n*x] + 1/2 a1*a3*D11*Cos[n*x] + 1/2*a2*a4 D11*Cos[n*x] + a2*a3*a4*Sin[n*x]; expr2 // Simplify 1/2 (a1 (2 + 2 a0 + ...


4

Simplify does not simplify held arguments of a function (that's a \[CapitalNu], not an N, just for fun): ClearAll[foo]; SetAttributes[foo, HoldAll]; Simplify[foo[E^((2 I k π (1 + Ν))/Ν) ], {k, Ν} ∈ Integers] Simplify[E^((2 I k π (1 + Ν))/Ν), {k, Ν} ∈ Integers] (* foo[E^((2 I k π (1 + Ν))/Ν)] E^((2 I k π)/Ν) *) This should seem perfectly reasonable, ...


2

Apparently, simplifying a Sum does not result in simplifying each term in the Sum. Try Subscript[ϕ, 1] == Subscript[ϕ, II + 1] /. Exp[a_] :> Simplify[Exp[a], Assumptions -> k ∈ Integers] (* True *) Undoubtedly, there are more elegant approaches.


9

InverseLaplaceTransform[(2 s^2 + s + 13)/((s - 1) ((s + 1)^2 + 4)), s, t] 2*E^t + (3/4)IE^((-1 - 2*I)t) (-1 + E^(4*I*t)) % // ComplexExpand // Simplify 2*E^t - (3*Cos[t]*Sin[t])/E^t % // TrigReduce ((1/2)*(4*E^(2*t) - 3*Sin[2*t]))/E^t In "one" step InverseLaplaceTransform[(2 s^2 + s + 13)/((s - 1) ((s + 1)^2 + 4)), s, t] // ...


7

Expanding on my comment above, expr = Inactivate[x Integrate[Exp[-t^2], {t, 0, x}], Integrate]; D[expr, x] You can also convert existing Erf's to Integrate: ErfToIntegrate[e_] := e /. { Erf[z_] :> 2/Sqrt[π] Inactive[Integrate][Exp[-t^2], {t, 0, z}] } ErfToIntegrate[Sqrt[π]Erf[x] + Exp[-x^2] - Sqrt[π] Erf[x + a]]



Top 50 recent answers are included