22
votes
Accepted
Transform Root objects into Trigonometric expressions
Disclaimer: This is not a full answer, but perhaps it's a start.
From an algebraic stand point this seems like a very hard problem. I attacked it with a more brute force approach. I guess a basis and ...
18
votes
Expressing a polynomial as a sum of squares
Here is a somewhat heuristic approach, that relies in this case on the SOS having integer coefficients. I will indicate an alteration that gives a numerical approximation in the general case.
Start ...
16
votes
Accepted
How to do algebra on unevaluated integrals?
Similar idea to belisarius, except in V10 we can inactivate Integrate to keep it from evaluating or even trying to evaluate:
...
16
votes
How does Mathematica calculate $\sin(\pi/5)$?
In the course of answering this question, I ran into a little bit of weirdness that doesn't square with my experience with previous versions of Mathematica. I think writing this answer is as good a ...
15
votes
Accepted
Lagrangian to Hamiltonian
Here is how you would do it using the standard add-on package VariationalMethods, which is meant for calculations like this:
...
14
votes
Accepted
Pull out scalars from NonCommutativeMultiply in commutator of SU2 spin algebra
Edit: a sparse array version for larger chains is given at the end.
Since you're specifically asking about $SU(2)$, we have a convenient representation in the form of the $2\times 2$ Pauli matrices. ...
14
votes
How to simplify -a*z+a*z to 0 where "a" is an expression
Expand takes forever, because it is trying to expand (u + x + y + z)^10000. Tell it not to.
...
14
votes
Accepted
Is Mathematica intended to be used to do lengthy algebraic calculations?
I do analytical calculations with Mma on the regular basis during already about 10 years in the area of theoretical solid state physics. Previously I did such analytical calculations by hand, now I do ...
14
votes
How to extract all the coefficients of a homogeneous polynomial
Using an undocumented function:
...
14
votes
Differentiating functions of vectors/matrices?
In this post I discuss a function MatrixD which attempts to take a matrix derivative following the guidelines given in the The Matrix Cookbook.
I still want to ...
13
votes
Accepted
How can I make Mathematica do, ArcTanh[x] + ArcTanh[y] = ArcTanh[x+y/1+xy]?
A little bit of trickery:
ArcTanh[x] + ArcTanh[y] // Tanh // TrigExpand // FullSimplify // ArcTanh
(* ArcTanh[(x + y)/(1 + x y)] *)
Note the parentheses.
Community wiki
12
votes
Is it possible to have Mathematica move all terms to one side of an inequality?
Since Mathematica 11.3 you can use SubtractSides, that works for equations and inequalities, for example
...
12
votes
12
votes
Accepted
Rearrange an algebraic expression so that each variable appears only once
The following approach transforms ans1 to ans2 and points the way to more general approaches.
As noted in the Question, ...
12
votes
Accepted
Rewrite a real polynomial in real (but only linear and quadratic) factors
As noted, one sticking point is that polynomial roots in general cannot be represented in Mathematica by anything other than Root[] objects. Nevertheless, it is ...
12
votes
Accepted
Factor a polynomial Root into Roots of smallest possible degree
A constructive approach
The problem can be solved if the form of the solution is given.
Define the two factors using a hint (that these should be cubic equations) in the original post
...
11
votes
How do I use "Factor" to get this form
HornerForm[x1 x2 + x1 x3 x4 + x1 x3 x5]
(* x1 (x2 + x3 (x4 + x5)) *)
11
votes
Finding coefficients in polynomial function
One liner:
Solve[PolynomialRemainder[6 x^3 - 5 x^2 - 12 x + k, 3 x + 2, x] == 0, k]
Community wiki
11
votes
Accepted
11
votes
Accepted
Computing the seven roots of a polynomial
poly = x^7 + x^6 - 18 x^5 - 35 x^4 + 38 x^3 + 104 x^2 + 7 x - 49;
Find an extension in which the polynomial splits:
...
10
votes
Distances between points in periodic cube
Very late to the party, but I'll show a method that's faster than anything posted so far and will be hard to beat.
First let's define our PeriodicDistance:
...
10
votes
What is the inside?
The precise details of the Mathematica engine are proprietary, therefore no one will be able to legally post a full answer to your question. The best information I am aware of comes from the Notes on ...
10
votes
Accepted
10
votes
Lagrangian to Hamiltonian
genCoords = {x[t]};
ke = 1/2 m x'[t]^2;
v = 1/2 k x[t]^2;
q = -c x'[t];
l = ke - v;
Solve for x'[t] in terms of ...
9
votes
Accepted
How to sort arguments of Times in nonstandard order?
You can create your own ...Form wrapper that will format Times as you want it.
Let's start with ordering function that can be ...
9
votes
Accepted
How to write polynomial expression as commutator form?
Update, December 22
I've developed a version that is more robust. I believe it should work in general, but I'm sure there are some corner cases that won't work (and probably some-not-so-corner cases ...
9
votes
Factor a polynomial Root into Roots of smallest possible degree
I'll show the resultant formulation for the degree 15 example.
The polynomial in question:
...
9
votes
Accepted
Finding an analytic solution of a cubic equation
It comes with which roots correspond to which branches of a cubic root in the exact expression. For instance, consider the simpler
$$y^3 = z$$
Then my three solutions are $y=\sqrt[3]{z}$, $y=(-1)^{2/...
9
votes
Accepted
Can't get Mathematica to simplify an expression
A few things of note:
Like @m_goldberg suggested, it is wise to explicitly state d ∈ Reals, s ∈ Reals.
Because you introduced .'...
9
votes
Accepted
Factor a polynomial over the reals
One way is to find the roots, separate into real and complex, further separate the complex ones into conjugate pairs, then reform as a factorization (taking into account the leading coefficient). I'll ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
algebraic-manipulation × 625simplifying-expressions × 119
polynomials × 97
symbolic × 70
equation-solving × 67
algebra × 44
expression-manipulation × 43
differential-equations × 32
linear-algebra × 30
replacement × 27
calculus-and-analysis × 26
matrix × 24
complex × 23
trigonometry × 22
functions × 19
factorization × 18
list-manipulation × 16
performance-tuning × 15
series-expansion × 15
summation × 13
output-formatting × 12
pattern-matching × 10
physics × 10
tensors × 10
operators × 10