Questions tagged [algebraic-manipulation]
The art of manipulating an algebraic expression into the desired form.
749
questions
4
votes
2
answers
91
views
Normalizing the output of Apart
My question is closely related to this one but the accepted answer does not meet my needs.
I have a rational function $f(x)$ in one variable which admits a partial fraction decomposition of the form
$$...
1
vote
1
answer
47
views
Manipulating the list with variables
I am trying to find the maximum element of the list for a given value of variable $c$.
The example of the list is as follows:
...
1
vote
1
answer
70
views
CylindricalDecomposition with symbolic variables
CylindricalDecomposition is a powerful function that can (for instance) compute the limits for each variable in integrals over a region. Suppose the region is:
<...
4
votes
1
answer
267
views
How to achieve the transformation using DSolveChangeVariables introduced in Mathematica 13.1?
I have a PDE (1D Schrödinger equation) as follows:
$$iu_t-\frac12 u_{xx}-\left(|u|^2-A\right)u=0$$
Applying the following transformations to the PDE,
$$\operatorname{u}(x,y,t)=\operatorname{u}(\xi) e^{...
0
votes
0
answers
101
views
Modulus square of an complex expression
I have an expression:
E^(I*((-k)*x + \[Xi] - (t + 1/2)^y/(\[Beta]*Subscript[b, 2]*(Subscript[a, 2] + 2*k*Subscript[b, 2]))))
I want to get modulus square of this ...
-1
votes
1
answer
67
views
ComplexExpand over various imaginary parts? [closed]
I have an equation
a=(c+ I d);
b=(e+ I f);
I want to solve
dd=(a C0 * b K C0)/(a C0 + b K C0);
both e and f are imaginary ...
6
votes
1
answer
300
views
Express polynomials as sum of squares
Well, while SOStools of Matlab can express a polynomials as SOS (Sum Of Squares) by the following theorem:
A multivariate polynomial p in n variables and of degree 2d is a sum of squares if
and only ...
1
vote
0
answers
58
views
How to understand the very long confusing output of a command?
I have a complicated expression with many parameters
...
2
votes
2
answers
150
views
Rewriting an expression while using another parameter
I wish to rewrite V and M with the given A. I have provided what the end result is supposed to look like.
Here is V
...
0
votes
0
answers
43
views
Resolve integral using additional equation
Usually Mathematica does a good job simplifying integrals:
\[Integral](um[x] qm'[x] + um'[x] qm[x] +
wm[x] wm'[x]) \[DifferentialD]x
gives the output
...
0
votes
0
answers
42
views
How to mimic Expand with Thread?
I want to mimic Expand[(a + b) (c + d)] with Thread.
My attempt below does not provide the correct result:
...
0
votes
0
answers
80
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
...
1
vote
1
answer
115
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} ...
4
votes
2
answers
372
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 ...
2
votes
1
answer
65
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 ...
0
votes
0
answers
50
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
...
2
votes
0
answers
58
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.
...
1
vote
0
answers
51
views
Simplifying RegionUnion call after CylindricalDecomposition
I want to simplify unions of output from CylindricalDecomposition calls.
Consider:
...
9
votes
2
answers
156
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 ...
0
votes
0
answers
64
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$?
-1
votes
1
answer
79
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:
...
1
vote
0
answers
181
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 ...
1
vote
2
answers
59
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,
...
1
vote
0
answers
115
views
Apart behaves differently depending on specific alphabetic letters of variables
I have stumbled across some weird behaviour with Apart.
ans1 = Apart[(x1/r2 + x2/r1)/(1/r1 + 1/r2)]
Gives
...
2
votes
3
answers
213
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 ...
1
vote
1
answer
155
views
Solve: the system contains a nonreal constant
The equations I wanted to solve is as follows
...
1
vote
1
answer
98
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 ...
0
votes
0
answers
28
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 ...
6
votes
3
answers
208
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 ...
1
vote
1
answer
120
views
Mathematical Concept Mapping
I would like to build a mathematical concept map. The basic idea is that I want to be able to know, for any type of mathematical operation, what the underlying principles are for that operation. For ...
4
votes
3
answers
316
views
Transforming implicit solutions of an ODE involving InverseFunction to an explicit form
When I DSolve a nonlinear differential equation:
...
1
vote
0
answers
51
views
Calculate special function by conditional FunctionExpand
I want to calculate an expression with Whittaker's W function
$$f(z)=\sum _{v,k=0}^{\infty } z^{\frac{k+v}{2}} W\left(\frac{k-v}{2},- \frac{k+v+1}{2},z\right),\tag{1}$$
however for some input ...
2
votes
0
answers
184
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 ...
5
votes
1
answer
232
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}{\...
2
votes
0
answers
115
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 ...
3
votes
0
answers
133
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 ...
0
votes
1
answer
42
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 ...
2
votes
2
answers
145
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 ...
0
votes
0
answers
167
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:
...
2
votes
1
answer
145
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 ...
0
votes
1
answer
82
views
Transforming one exponential expression to multiplication of exponential expressions [duplicate]
I have the following expression:
Exp[a * x + b * y + c * z]
I want to write this expression as:
...
4
votes
1
answer
626
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 ...
0
votes
1
answer
239
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
...
1
vote
3
answers
127
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 ...
0
votes
1
answer
45
views
How to remove Wrong relations after LogicalExpand?
I have a complex relation which I need to expand and represnt it clear and nice. So I used LogicalExpand (LE). I know LE does only the simple expansion and nothing further. but it creates some wrong ...
2
votes
2
answers
119
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 ...
1
vote
1
answer
70
views
LogicalExpand does not work correct?
I have a boolean expression and need to distribute all it's part. I used LogicalExpand and it works fine somehow. but I see for some sub-parts it does not Simpify or solve it. I tried Simplify for ...
0
votes
1
answer
233
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 (...
1
vote
1
answer
86
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})...
2
votes
1
answer
443
views
How to expand a function as a linear combination of other functions?
I would like to be able to expand certain functions as linear combinations of other specified functions when I know that the original function can be represented in such a way e.g. we know that $\sin^{...