Hot answers tagged

9

Consider your expression, expr = (a + m a + b + n b + c + k c + d + e)/(a b); This gets us almost where we want to go, Expand@expr (* 1/a + 1/b + c/(a b) + d/(a b) + e/(a b) + (c k)/( a b) + m/b + n/a *) But we have too many terms with the same denominator, so we can use GatherBy to group them, then simplify the sums of terms with the same ...


4

You simply need to simplify your result using Simplify (dimensions < 4) or FullSimplify (larger), as appropriate: Inverse@FourierMatrix[3].FourierMatrix[3] // Simplify (* Out: {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}} *) FullSimplify[Inverse@FourierMatrix[7].FourierMatrix[7]] == IdentityMatrix[7] (* Out: True *) As you can see, an identity matrix is obtained ...


4

I am not sure that this is better, but just as a version: expr1 = (a + m a + b + n b + c + k c + d + e); expr2 = Collect[expr1, {a, b}]; expr3 = Take[expr2, 4]; Map[ReleaseHold, MapAt[Hold, Take[expr2, {5, 6}]/(a*b), {{3, 1}, {3, 2}}] // Apart] + expr3/(a*b) (* (c + d + e + c k)/(a b) + (1 + m)/b + (1 + n)/a *) Have fun!


3

You can use a conditional replacement rule to set any power of x higher than 1 to zero: simp[expr_, x_] := ExpandAll[expr] /. {Power[x, a_] /; a > 1 -> 0} simp[(1/x - 3 x + 4 - x)^4, x] simp[(1 - x)^2, x] (* -416 + 1/x^4 + 16/x^3 + 80/x^2 + 64/x - 256 x *) (* 1 - 2 x *) Of course, the easy way to do it would be to just take the Series and convert ...


3

This is in reaction to a comment: A closer example to my application is this: 1.*10^-22 Sqrt[1.035998097490982*^47 - 6.518057203453232*^45 x]. Rationalize[] does not give a substantial simplification. In this case the scenario is quite different than in the original formulation of the question which would suggest that the numbers involved are still ...


3

n Binomial[n - 1, k - 1] == k Binomial[n, k] // FullSimplify True


2

You can do this: Unprotect[Quantity] Quantity /: Times[Quantity[mag_, unit_], seq__] := Quantity[Times[mag, seq], unit] This will leads to your desired result, and also works for symbolic Times in Quantity


2

If you are certain that pulling the k out of the square-root is harmless, then I suggest you use PowerExpand: Solve[(1 - p)^2 + (k^2)*(c + 5/4) == 0, p] // Simplify // PowerExpand $\{\{p \rightarrow 1 - \frac{1}{2} i \sqrt{5 + 4 c} k\}, \{p \rightarrow 1 + \frac{1}{2} i \sqrt{5 + 4 c} k\}\}$


2

You can use Simplify with the assumption that θ is an element of the Reals. f = Conjugate[Cos[θ]] Simplify[f, θ ∈ Reals]


2

Instead of a combination of Rationalize and MantissaExponent, as shown in the answer by JasonB, one can use a combination of FromDigits and RealDigits: Sqrt[3.1 10^45 + x 10^47]/(1 10^22) /. x_Real :> Sign[x]*FromDigits@RealDigits[x] // Simplify $\ $Sqrt[31 + 1000 x]


2

Hopefully someone can come up with a better way to do this. If I understand correctly, the issue is that Simplify[Sqrt[3 10^45 + x 10^47]/(1 10^22)] gives a nice and short result, with no large powers of 10, (* Sqrt[30 + 1000 x] *) while this Simplify[Sqrt[3.1 10^45 + x 10^47]/(1 10^22)] (* Sqrt[3.1*10^45 + 1.*10^47 x]/10000000000000000000000 *) ...


2

% refers to the last output, which is A (2 x1 + 2 x2) + A B (y1 + y2) in your code; and [[1]] means the first part of that expression in level 1, which is the first part of Plus[A (2 x1 + 2 x2), A B (y1 + y2)], yields A (2 x1 + 2 x2). Similarly the second part is A B (y1 + y2). However, the usage of Simplify here is treating A B (y1 + y2) as an assumption. ...


1

Try this: Sqrt[Im[z1]^2 - 2 Im[z1] Im[z2] + Im[z2]^2 + (Re[z1] - Re[z2])^2] // ComplexExpand // Simplify (* ((z1 - z2)^4)^(1/4) *) Have fun!


1

If your aim is numerical and graphical I would not "worry" about the cosmetics of the form. In the following I have made k=1 (no values for $\delta$'s given). to avoid numerical problems just due to extreme scales (v precision). I have tried to "correct" the unbalanced parentheses referred to by Bob Hanlon. I may have made an error. If so, I apologize: ...


1

I am not sure whether the symbolic calculation is correct, but I would suggest that you don't pre-calculate the value of the sum; rather, let the sum be calculated when the values of $n_1$ and $n_2$ are on hand by using SetDelayed in your definition of K1: Clear[Kin] Kin[n1_, n2_] := Sum[(-1)^(m1 + m2 + 1) * Binomial[n1 + 1, m1 + 2] * Binomial[n2 + 1, m2 ...


1

RegionPlot[ Or @@ {x + y > 1, x - y > 1, y - x > 1, -x - y > 1}, {x, -2, 2}, {y, -2, 2}] suffices


1

This is your equation: eq= f''[x]+(2 Exp[-k*x]/x-e) f[x]==0 For a given value of max, you are looking for a series solution sol: max=5; sol=Function[x, Sum[c[i] x^i, {i,1,max}] + O[x]^max] Substitute this solution in your equation and use the function SolveAlways for finding the coefficients: SolveAlways[eq /. f->sol, x] (* {{c[4]->-(1/36) (2+4 ...


1

Probably something like this can be done: n = 5; (* highest-order term *) f = Sum[C[k] ρ^k, {k, 1, n}] + O[ρ]^(n + 1); (* C[0] == 0 already imposed *) Solve[Thread[CoefficientList[D[f, {ρ, 2}] + (2 Exp[-k ρ]/ρ - ε) f, ρ] == 0], Array[C, n]] // Simplify {{C[2] -> -C[1], C[3] -> 1/6 (2 + 2 k + ε) C[1], C[4] -> -(1/36) (2 + 8 k + 3 k^2 ...



Only top voted, non community-wiki answers of a minimum length are eligible