Questions tagged [algebraic-manipulation]

The art of manipulating an algebraic expression into the desired form.

Filter by
Sorted by
Tagged with
0 votes
0 answers
59 views

Redundancy in Solve

Solve[{ a[1] a[2] == a[3] a[4], a[1]^2 == a[4]^2, a[1] a[3] == a[2] a[4], a[2]^2 == a[3]^2 }] returns ...
user avatar
1 vote
1 answer
58 views

Finding Hamiltonian from a perturbative Action

I am given a perturbative action $$\frac{S}{\mathcal{T}}=\int dt\sum _{n=0,1} (\dot{c_n}{}^2-c_n^2 \omega _n^2)+7.11 c_0^3+35.3 c_0 c_1^2+4.66 c_0 \dot{c_0}{}^2+1.32 c_0 \dot{c_1}{}^2-7.57 \dot{c_0} ...
user avatar
  • 181
4 votes
2 answers
135 views

Rewriting algebraic expressions as combinations of other expressions

I would like to write x^5 + 1/x^5 in terms of x^2 + 1/x^2, x^3 + 1/x^3 and ...
user avatar
  • 219
1 vote
1 answer
36 views

How to use System`Private`AssumptionAccess and Assumptions`*?

I see this function is used by some symbols in Assumptions`*, and it HasDownCode and does not ...
user avatar
  • 1,463
0 votes
0 answers
42 views

Eliminate works on small system of Equations, but fails on big ones

I am trying to calculate the Hamiltonian of a system in terms of momenta. When applying the Eliminate function on a small toy system it works as expected ...
user avatar
2 votes
0 answers
44 views

Division by 0 Error when checking whether something is equal to zero

I was running a program and suddenly got Divide::infy messages coming from the following (rather ugly) expression. ...
user avatar
  • 928
1 vote
0 answers
46 views

Simplifying RegionUnion call after CylindricalDecomposition

I want to simplify unions of output from CylindricalDecomposition calls. Consider: ...
user avatar
8 votes
2 answers
117 views

Efficient algorithm for calculating polynomial that has roots of a certain form

I have looked into this specific question on Math.SE concerning a more "mechanical" approach to finding a polynomial $p \in \mathbb{Q}[x]$ satisfying $p(\sqrt{2}+\sqrt{3}) = 0$. The user MJD ...
user avatar
  • 183
0 votes
0 answers
37 views

recognize overall factor in a variable

I have an expression (not necessarily a polynomial) which I know is proportional to an overall power of a symbolic constant, so something like $x^a (...)$. What is the best way to get $a$?
user avatar
-1 votes
1 answer
46 views

Factorize expression by specific term [closed]

I am new to Mathematica but I would like to know how to force Mathematica to factorize an expression by a specific term. Exemple, imagine I have a term like this: And I have an expression like this: ...
user avatar
1 vote
0 answers
61 views

Easy upper and lower bounds for curve genus in Mathematica

I am writing a Mathematica code in which I need, at some point, to compute genus of a lot of curves given by polynomial equations in 2 variables in affine coordinates. Unfortunately, this is possible ...
user avatar
1 vote
2 answers
46 views

Expression of the infinite summation result of a series

The infinite sum of a series should be $\sum_{n=1}^{\infty} \frac{x^{4 n+1}}{4 n+1}$ $=\frac{1}{4} \ln \frac{1+x}{1-x}+\frac{1}{2} \arctan x-x \quad(-1<x<1)$ However, ...
user avatar
  • 1,365
0 votes
0 answers
48 views

showing that CylindricalDecomposition returns partition the space

I have 24 objects returned from eight calls to CylindricalDecomposition, say $exp_1$ ... $exp_24$. The objects are in the three dimensional reals, $(a, b, c)$, so ...
user avatar
2 votes
3 answers
192 views

Which level of complexity of equations that Mathematica Solve or Reduce functions cannot deal with?

Here I have a system of equations which takes $B$ matrix as input, and output the solutions. The code works very well for 4-rows matrices $B$ that I tried, however it is hard to give solutions in ...
user avatar
1 vote
1 answer
74 views

Solve: the system contains a nonreal constant

The equations I wanted to solve is as follows ...
user avatar
1 vote
1 answer
91 views

How to get this expression in a wanted form

This is the endresult of integration calculation (I*Log[(b - I*z)/(b + I*z)])/(2*b) See the question integral calculation post This endresult must transformed to a ...
user avatar
  • 649
0 votes
0 answers
27 views

handling roots in mathematica [duplicate]

I am looking for the solution of: $\text{Solve}\left[-\frac{\alpha }{\sqrt{1-L}}-\frac{L t}{2}=-\alpha -2,L,Reals,\text{Assumptions}\to 0\leq \alpha \&\& 0<t\right]$ Mathematica is giving ...
user avatar
5 votes
3 answers
124 views

Factoring a quadratic form associated with a $4 \times 4$ matrix into a sum of four squares

The matrix W = $\left( \begin{array}{cccc} 5 & 7 & 6 & 5 \\ 7 & 10 & 8 & 7 \\ 6 & 8 & 10 & 9 \\ 5 & 7 & 9 & 10 \\ \end{array} \right)$ has a ...
user avatar
  • 485
4 votes
3 answers
256 views

Transforming implicit solutions of an ODE involving InverseFunction to an explicit form

When I DSolve a nonlinear differential equation: ...
user avatar
  • 97
1 vote
0 answers
47 views

Defining a non-commutative algebra

I'm new to Mathematica, and I'm trying to learn the ropes. I'm trying to write a little boson algebra engine, with basic useful functions such as non-commutative algebra, normal-ordering and vacuum ...
user avatar
  • 11
5 votes
1 answer
184 views

Third/Fourth derivative of cross-entropy loss

I need a nice formula for the third (or fourth derivative if it's easier) of cross-entropy loss $\frac{\partial^3 J}{\partial z^3}$ where $$J(p(z)) = -\sum_i q_i\log p(z)_i$$ $$p(z)_i=\frac{\exp z_i}{\...
user avatar
2 votes
0 answers
106 views

A remarkable elimination involving the basic reproduction number R0

I have a polynomial pol of third order, whose coefficients depend on 5 parameters, and whose free coefficient is proportional to R0-1, where R0 is a certain rational function of the parameters (the ...
user avatar
  • 896
2 votes
0 answers
87 views

Implementing einsum in Mathematica

I've been using Carl Woll's einsum function, but it's missing the ability to handle repeated indices. For instance np.einsum('i,i->i',w, w) will perform a ...
user avatar
0 votes
1 answer
35 views

Spotting and condensing expressions in output

I am running some symbolic scripts to generate a model problem. One of my outputs is This is generated by the Mathematica code or, in Mathematica format (owing to the fancy lettering and formatting ...
user avatar
2 votes
2 answers
87 views

Speeding up ComplexExpand

I have a code where I have to take the dot product of two lists, that contain some symbols, and then use ComplexExpand. For a long list it take a very long time and ...
user avatar
  • 14.5k
0 votes
0 answers
127 views

Fully expanding and distributing a symbolic sum

I have quite a large expression I want to simplify. For example, this can be generated by a recursive definition: ...
user avatar
2 votes
1 answer
58 views

Expand tensor expressions with matrix powers and outer products

I would like to have TensorExpand distribute across repeated matrices involving outer products. This question notes that ...
user avatar
4 votes
1 answer
203 views

Stability analysis of coupled ODE's

I'd like to reproduce Panel A of Figure 7 (red curve) of this paper, which represents the steady-state solutions of four coupled ODE's, and verify this claim that the diagonal branch in the Z-shape ...
user avatar
0 votes
1 answer
125 views

Solving a system of differential-algebraic equations

I am trying to solve a coupled system of differential-algebraic equations as follows. First define a list of 6 equations ...
user avatar
  • 313
1 vote
3 answers
77 views

How to help Eliminate simplify simultaneous equations

I have a set of three moderately simple simultaneous equations that I'd like to simplify and eliminate a set of variables for (this is a simple example of a more general class of problem - but I'd ...
user avatar
2 votes
2 answers
78 views

Compute real and imaginary part of parametrized complex rational expression

I would like to compute the real and imaginary part of a complex valued rational function $Z_b=\frac{1}{\frac{1}{\frac{1}{C_1 \text{i$\omega $}}+L \text{i$\omega $}+R}+C_2 \text{i$\omega $}}$ that ...
user avatar
0 votes
1 answer
72 views

Collecting coefficients of non-commutative products from an expression

I am trying to manipulate a Hamiltonian with non-commutative operators, $a_j,a_j^\dagger$. After some algebra using NCAlgebra package in Mathematica, I have an expression like, $$H = C_1 (b**a) + C_2 (...
user avatar
1 vote
1 answer
73 views

Wrong limit appears [closed]

Consider the following limit $$ \lim_{x\to-\infty}x-\sqrt{x^2+7x} $$ Going through some algebra leads to $$\begin{align} \lim_{x\to-\infty}x-\sqrt{x^2+7x}&=\lim_{x\to-\infty}\frac{(x-\sqrt{x^2+7x})...
user avatar
  • 4,138
10 votes
5 answers
888 views

Simplify radical expression (a + b - Sqrt[a^2 - b^2])/Sqrt[a + b]

I have the following expansions: $\frac{a+b-\sqrt{a^2-b^2}}{\sqrt{a+b}}$ and $a>b>0$ Obviously we can simplify it further by hand $\sqrt{a+b}-\sqrt{a-b}$, but Mathematica doesn't know how to ...
user avatar
  • 4,856
1 vote
1 answer
126 views

Ordinary differential equation with variable (polynomial) coefficients -form of solution

If you have a differential equation with polynomial coefficients then quite remarkably Mathematica can find a solution. For example for the second order differential equation $ y''(t)+b y'(t)+\left(\...
user avatar
  • 14.5k
6 votes
2 answers
200 views

Get rid of a certain variable in a fraction's numerator

Consider expression $\frac{a - b}{a + b}$. When I apply $FullSimplify[\frac{a - b}{a + b}]$, I get $-1 + \frac{2a}{a+b}$, effectively getting rid of $b$ in the numerator. However, I want to get rid of ...
user avatar
  • 163
1 vote
2 answers
152 views

Obtaining inequality between two variables

I have two variables ...
user avatar
  • 270
0 votes
1 answer
40 views

Trigonometric simplification .Correct syntax? [closed]

I cannot simplify this expression any further, which should result in 7. Could you please provide me with the correct syntax, I have tried several without success. $$Assumptions[A + B + C == 0 , ...
user avatar
  • 480
1 vote
1 answer
105 views

Rewrite a variable in terms of another variable

I have two variables t = 1/Sqrt[2] (Sqrt[1 + Cos[a]] + Sqrt[1 - Cos[a]] + Sqrt[1 + Cos[b]] + Sqrt[1 - Cos[b]] + Sqrt[1 + Cos[c]] + Sqrt[1 - Cos[c]]) and <...
user avatar
  • 270
1 vote
1 answer
53 views

Grouping together same exponent terms in a multivariate monomial

This is a rather simple question but for some reason, I am spending too much time on this. Suppose I have a monomial in 4 variables, each raised to some linear combination of 3 exponent variables: <...
user avatar
  • 181
3 votes
0 answers
61 views

What is the ComplexityFunction used by FullSimplify in Mathematica 12? [duplicate]

I was surprised to see FullSimplify make my expressions numerically unstable. The result can be summarized below: ...
user avatar
1 vote
1 answer
61 views

Conjugate transpose of noncommutative matrix multiplication

I have: $$p=iab$$ $p,a,b$ are operators. So in mathematica I am writing this as: p=I*a**b Conjugate of above is $$-iba$$ In mathematica I tried ...
user avatar
  • 1,163
7 votes
2 answers
287 views

Telling Mathematica to treat square roots as real valued

I often deal with problems which I know are real-valued, but Mathematica skips some simplifications because it doesn't know which branch of Sqrt to take. Is there ...
user avatar
1 vote
1 answer
215 views

Simplifying quantum operators (ladder operators with multiple modes)

Similar to this question, I am interested in working with an implementation of quantum ladder operators. I've been trying to use this "Quantum Mathematica Package" to solve some lengthy ...
user avatar
2 votes
2 answers
71 views

Formal substitution of exponential factors in an expression

Assume that we have some complex algebraic expression, like Exp[(a t + b s)/w] ( t Exp[ q t] w + q Exp[q s] Exp[-2 s] + a^2 Exp[3 s] + s t + 1 ) Now, this is just ...
user avatar
  • 143
3 votes
0 answers
113 views

Commutator of QFT Operators $[\hat{a}_p, \hat{a}^\dagger_k]$ and 4-Momentum Integrals

I just recently started looking into CAS (i.e. i have very little experience in Mathematica), specifically for doing basic calculations in Quantum Field Theory. For that i would like to define $\hat{a}...
user avatar
  • 131
0 votes
0 answers
40 views

Issues in expanding expressions with formal sums

I have a very long expression involving formal sums to infinity, unfixed functions and several variables. In this very long expression, I need a typical term, like $\frac{6 A \sigma \sum _{n=0}^{\...
user avatar
0 votes
0 answers
37 views

How to rearrange terms in an expression to a particular form (e.g. A/w-> A*(1/w)

I have a huge expression for which the numerators are a big mess, involving numbers, variables, formal sums and unevaluted function, let's call the numerators Ai, with i=1,2,...n This "beast"...
user avatar
3 votes
1 answer
54 views

Expression should vanish under assumptions. How can I use Mathematica to simplify this type of of expression (and similar)?

This is maybe the worst type of question because it is super specific, but I am hoping that some Mathematica function or rule exists (built-in or custom) that can be helpful for simplifying a somewhat ...
user avatar
0 votes
1 answer
81 views

How to simplify for a ratio of two variables

Say I have an equation like $$2 z \ln[\frac{a v_{2}^{2}}{b_{2}}]+(v_{1}-2v_{2}) - z \ln[\frac{a v_{1}^{2}}{b_{1}}]\geq0$$ ...
user avatar
  • 3,842

1
2 3 4 5
13