# Tag Info

## Hot answers tagged algebraic-manipulation

20 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 ...
17 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 ...
17 votes
Accepted

### What is Mathematica's equivalent to Maple's collect with distributed option?

CoefficientRules[eq, {x, y}] /. ({a_, b_} -> c_) :> c x^a y^b // Total Generalize it to a function: ...
• 66k
16 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: ...
• 97.3k
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 ...
• 131k
13 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 ...
• 36.5k
13 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 ...
• 18.3k
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.
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)) *)
• 13.7k
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]
11 votes
Accepted

### Extract common factor

I think PolynomialGCD is the most direct tool: ...
• 131k
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: ...
• 236k
11 votes
Accepted

### How do two equations multiply left by left equals right by right?

I much prefer MultiplySides[eq1, eq2] //Expand to BobHanlon's otherwise fine solution. It also generalizes quite nicely to ...
• 41.2k
11 votes

### What is Mathematica's equivalent to Maple's collect with distributed option?

Update 2: An alternative way to define a function that works like Maple's collect using CoefficientRules + FromCoefficientRules: ...
• 395k
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 ...
• 23.4k
10 votes
Accepted

### How can I simplify a super long expression?

It might help to be familiar with how expressions are structured in the Wolfram Language. Try reading through some of the tutorials here, particularly this one about expressions as trees and then this ...
• 408
10 votes

### Mathematica function equivalent to MATLAB's residue function (partial fraction expansion)

This is cheating, but: ...
10 votes
Accepted

### Working in Mathematica over a cyclotomic ring

PolynomialMod[x^20 + x^8 + x + 3, x^7 - 1] 3 + 2 x + x^6.
• 72.7k
10 votes
Accepted

### Present a logarithm in terms of two logarithms

There doesn't seem to be a single built-in function for the task, but I can think out a solution involving a bit manual analysis. First use PowerExpand: ...
• 66k
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

• 35.9k
9 votes
Accepted

### How to apply chain rule to a differential equation

deq = y''[x] + (epsilon - x^2) y[x]; deq /. {y -> (y[#^2] &)} /. x -> Sqrt[s] (*(epsilon - s) y[s] + 4 s y''[s] + 2 y'[s]*)
• 8,217

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