New answers tagged

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!


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 ...


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. ...


0

When you are first defining Kin[n1_,n2_] you are not specifying anything about n1 or n2. For simpler cases MMA returns ConditionalExpression. However, as much I have seen, for complicated evaluation MMA goes with an approximation which is more widely applicable (in your case n1,n2>1). To bypass this, you can always put Assumptions with your evaluation. ...


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 ...


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 ...


0

I am not sure, if this is what you are after, but try something in this direction. Provided all your definitions are evaluated: ds = (L^2/ y^2 (dy^2 + dr1^2 + dr2^2 + r1^2*d\[Psi]^2 + r2^2*d\[Phi]^2) // Simplify[#, {r1 > 0, L > 0, \[Rho] > 0}, ComplexityFunction -> (Count[{#}, _[2 \[Eta]]] &)] &) /. ...


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: ...


0

You could also use gc=Conjugate[g[θ]]/.Conjugate[cos_Cos]->cos and h=g*gc and use h as the integrand or plotted function. One should avoid calling Simplify inside Plot or Integrate because this will be much slower than necessary. Also, your integrand contains a factor 10^-30. So it is practically zero and nothing is plotted and the integral is zero.


2

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


0

I haven't been able to turn one into the other, but they can both be reduced to the most basic form, which is the same: exp1 = Reduce[x + y > 1 || x - y > 1 || y - x > 1 || -x - y > 1, {x, y}, Reals] exp2 = Reduce[Abs[x] + Abs[y] > 1, {x, y}, Reals] exp1 == exp2 (* x < -1 || (-1 <= x <= 0 && (y < -1 - x || y > 1 + ...


1

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


3

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


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 ...


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 ...


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!


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 ...



Top 50 recent answers are included