Tag Info

Hot answers tagged

34

In the first case PowerExpand comes to the rescue: PowerExpand@Power[p^(n m) q, 1/n] (* Out: p^m q^(1/n) *) Note however that "the transformations made by PowerExpand are correct only if $c$ is an integer or $a$ and $b$ are positive real numbers". Generally speaking, your assumptions can be listed in Reduce, Simplify, or FullSimplify using the ...


15

I can't help you with functions beyond Reduce, Simplify, ... but I can offer you a tip to help with reducing errors from manual translation. In order to validate that your manual transformation is correct, one can subtract the original expression from the manual transformation and then use Simplify on that expression. Sometimes it will return zero using ...


13

One thing is to make sure you have all the assumptions stated properly. For instance, the first two cases can be handled by passing all the assumptions to FullSimplify FullSimplify[Power[p^(n m) q, 1/n], Assumptions -> {q > 0, p > 0, n ∈ Integers, m ∈ Integers}] p^m q^(1/n) and FullSimplify[(p^n q)/(p^m r), Assumptions -> {q > 0, p ...


12

I use Mathematica in much the same way as you, although in the context of multi-stage physics derivations. Since no one has mentioned it, I'll describe an obvious approach to successive rewrites of an expression. I label each step a calculation with an indexed symbol that I can refer to later. This is preferable to In's and Out's whose numbers can change if ...


9

There is another option, using the relatively new tensor capabilities of Mathematica. This is pretty much copied from another answer by jose, but I don't need any assumptions here: TensorExpand[KroneckerProduct[X, X] + KroneckerProduct[-X, X]] (* ==> 0 *) TensorExpand[KroneckerProduct[2 X, 3 Y]] (* ==> 6 KroneckerProduct[X, Y] *) There is a ...


8

I often find that Simplify, etc work better when applied to parts of an expression. As I mentioned in this post, using something like Collect[expression, {selectedvariables}, Simplify[#, options -> values]& ] can work well in this respect. More generally, if you wish to simplify a particular Part, try expression[[index]] = ...


5

From solution provided by kirma to your previous question Sum[24 n + 12 n^2, {n, 1, Infinity}, Regularization -> "Dirichlet"] (* -2 *) From solution provided by xzczd to your previous question ramanujanSum[f_] := Block[{x, n}, FullSimplify[-Sum[ BernoulliB[n, 1]/n SeriesCoefficient[ f[x], {x, 0, n - 1}], {n, \[Infinity]}], n >= ...


5

We will go by solving one equation at a time and generating the corresponding replacement rules. Beware of possible numerical instabilities. The following is the equivalence between the code in your edited example and my code on the previous incarnation of this answer. I think this is enough for you to use it. Please note that the only claim on the ...


4

At first glance it seems hopeless - you have all those hyperbolic trig and regular trig functions in your exponent. But then you notice that that is all superfluous since the only two variables you care about, X2 and P2 don't go into any of those functions, so that other stuff is just a distraction. {X1,P1,r, φ, θ, η} are all just constants! What you are ...


3

How about: av = Array[Subscript[a, ##] &, {2}]; bv = Array[Subscript[b, ##] &, {2}]; KroneckerProduct[av, bv] + KroneckerProduct[-av, bv] {{0, 0}, {0, 0}}


3

As noted, what you want is to use a Gröbner basis to eliminate the parameter: curve = 2 {t (3 t^4 + 50 t^2 - 33), 7 t^6 - 60 t^4 + 15 t^2 + 2}/(t^2 + 1)^3; implicit = GroebnerBasis[Thread[{x, y} == curve], {x, y}, t] // First 550731776 - 41620992 x^2 + 585816 x^4 + 625 x^6 - 182250 x^4 y - 41620992 y^2 + 1171632 x^2 y^2 + 1875 x^4 y^2 + 364500 x^2 y^3 ...


3

Okay, sometimes you get so involved in an idea that you don't realize how foolish it is. I was fooled or seduced by the simplicity of the Chebyshev expansion. Basically, my original answer was a complicated way to do this: cosEq = 64 x^7 - 112 x^5 - 8 x^4 + 56 x^3 + 8 x^2 - 7 x - 1 /. x -> Cos[Pi t] //TrigToExp; t /. Solve[cosEq == 0 && 0 <= ...


3

Using the Zeta function you can calculate arbitrary expression like in your example. g = 24 Zeta [-1 ] + 12 Zeta [-2] (* -2 *)


2

If I understand the question properly, you would like to differentiate the expression f = Sum[c[k] Exp[-(a - t[k])^2], {k, kmax}] with respect to t[n], where n is an integer between 1 and kmax, to obtain (* 2 E^-(a - t[n])^2 c[n] (a - t[n]) *) Almost certainly, a similar question has been raised before, but I cannot find it now. In any case, the ...


1

As a recurrence: ComputePoly[{}] := 1; ComputePoly[{0}] := x1 ComputePoly[{1}] := x2 ComputePoly[l_List] := ComputePoly[l[[1 ;; 1]]]*ComputePoly[Rest@l] ComputePoly[{0, 1, 0, 1, 1, 1, 1}] (* x1^2 x2^5 *) Of course different recurrence relationships need different implementations. As you don't mention your actual one it's very difficult to provide more ...


1

I slightly modified the set partition code from the book Computational Discrete Mathematics by Pemmaraju and Skiena. kSetPartitions[{}, 0] := {{}} kSetPartitions[s_List, 0] := {} kSetPartitions[s_List, k_Integer] := {} /; (k > Length[s]) kSetPartitions[s_List, k_Integer] := {Map[{#} &, s]} /; (k === Length[s]) kSetPartitions[s_List, k_Integer] := ...


1

Second update -- I should state in simplest terms the issue the OP is facing. The set-up. The equations for a given a are eqs = Table[Power[Sqrt[λ2/(μ2 c2)], n] p[0, n + 1] == β[n] p[0, 0] + Sum[α[n, k] p[0, k], {k, 0, a}] /. NumVal, {n, 0, a - 1}]; All the variables involved in eqs are given by vars = Table[p[0, n], {n, 0, a}]; (* starts ...


1

Just another way to calculate volume of hypersphere and then relevant probability using recursion: vs[n_] := Most@Nest[{#[[2]]/(#[[3]] + 1), 2 Pi #[[1]], #[[3]] + 1} &, {1, 2, 0}, n] v[n_] := vs[n][[1]] The probabilities: Grid[Prepend[{#1, #2, N@#2} & @@@ ({#, v[#]/2^#} & /@ Range[10]), Style[#, Bold] & /@ {"n", ...



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