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

learn more… | top users | synonyms

1
vote
1answer
114 views

Mathematica spitting code back when using Resolve over a large range of interest

I've just started using Mathematica and have encountered my first issue. Below are two commands which only differ in the range of values I am asking Mathematica to check. The first works fine, but the ...
34
votes
6answers
4k views

Finding real roots of negative numbers (for example, $\sqrt[3]{-8}$)

Say I want to quickly calculate $\sqrt[3]{-8}$, to which the most obvious solution is $-2$. When I input $\sqrt[3]{-8}$ or Power[-8, 3^-1], Mathematica gives the ...
0
votes
0answers
57 views

Rearranging 5 equations

I am trying to rearrange 5 equations in terms of 5 variables. I have the equations for y1, y2, ...
1
vote
0answers
43 views

Use of Mathematica to put equation into vector form

Is there a way to put the following equation of a line into vector form using Mathematica (or a Mathematical package)? $\displaystyle ...
7
votes
1answer
137 views

Extract common subexpressions from expressions [duplicate]

I am trying to evaluate multiple independent expressions with common parts. I would like Mathematica to somehow give me this common parts. It's probably not so clear, so let me give you an example. ...
3
votes
1answer
74 views

Pulling powers to the outside of expressions (inverting PowerExpand)

Is there something like an inverse of PowerExpand that pulls powers to the outside of expressions: $$ x^2 y^2 \leadsto (x y)^2 \\ x^2/y^2 \leadsto (x/y)^2 $$ I ...
1
vote
0answers
93 views
5
votes
1answer
116 views

Speed up MinimalPolynomial

My Mathematica code runs slowly MinimalPolynomial[Sqrt[2] + Sqrt[3]+ Sqrt[5]+ Sqrt[7]+ Sqrt[11]+ Sqrt[13], x] runs slowly, but the Maple version ...
1
vote
1answer
79 views

Find the solution of A^2+AB+B^2 = f(a,b,c) [closed]

I wanted to ask the following question: I need to find the solutions (a particular one is enough!) A and B of the equation $A^2 + AB + B^2 = (a^2+ab+b^2)(c^2+cd+c^2)$ How can I do it? Thank ...
0
votes
0answers
72 views

Using one complicated equation to reduce another

(Relative noob here so don't assume much!) I need to use a vector equation (with $N-1$ entries) in the general form $y_j(x_{i,j},x_{i,j+1},x_{i,j-1})=0, i=1...3, j=1...N-1; x_{i,0}=x_{i,N}=0$, ...
1
vote
1answer
54 views

How to factorise a variable out of an indefinite sum?

(I should start by saying I'm a total beginner with Mathematica, so if the answer needs code I'll need it spelled out quite clearly, the learning curve for this is proving steep!) Basically what I am ...
2
votes
1answer
45 views

How to pick out terms in a linear equation with a positive coefficient?

Basically I have a really large output which looks like a long linear equation $AAA-BAA-CAA+DAA+...-ZZZ$ And I only am concerned about those terms that have a positive coefficient (i.e. a plus in ...
1
vote
1answer
42 views

PiecewiseExpand doesn't take all kind of assumptions

Running PiecewiseExpand[expr, assum] does not work with all kind of assumptions. For example, the following line will not split the expression with absolute values in the chambers, considering m1=m2. ...
2
votes
3answers
190 views

How to obtain non-trivial solution of equal ratios

How can I obtain a non-trivial solution of the following: $$\frac{a}{b+c}=\frac{b}{c+a}=\frac{c}{a+b}$$ The answer is $a=b=c=1$.
7
votes
4answers
430 views

Distances between points in periodic cube

How can one implement more efficiently/elegantly/memory savvily the following function which returns a matrix of all Euclidian distances between points in 3D within a cube of width ...
12
votes
1answer
236 views

ToNumberField won't recognize Root as an explicit algebraic number

In Mathematica 9.0.1, it appears that ToNumberField will not always recognize a Root object as an explicit algebraic number. ...
0
votes
0answers
52 views

Ordering oscillators with negative powers: Infinite loops

I have been working with ordering of oscillators for example $[a,a^\dagger]=1$ and I have a fairly stable code. I have needed to use inverse oscillators for example expressions like $a^m ...
4
votes
1answer
104 views

Infinite expression encountered when simplifying ArcTan sums although the result is finite

If I attempt to simplify the sum ArcTan[1/x] + ArcTan[x] with ArcTan[ Simplify[ TrigExpand[ Tan[ ArcTan[1/x] + ArcTan[x]]]]] ...
0
votes
0answers
50 views

Split absolute value in chambers

I usually expand expression containing absolute values, with the PiecewiseExpand[] function. ...
1
vote
0answers
70 views

Transform Root objects into Trigonometric expressions

Consider the Root objects roots = Table[Root[-1 + 27 #1^2 - 162 #1^4 + 243 #1^6 &, i],{i,1,6}] These can be expressed in terms trigonometric functions as ...
1
vote
1answer
103 views

Factoring terms out of a polynomial

I don't do much algebra in Mathematica and was surprised to discover, while attempting to answer this question, that I had no idea how to factor out an expression from a polynomial. The question was, ...
2
votes
2answers
105 views

Choosing a branch of the square root when performing a series expansion

I have the following problem. Consider expression f=Sqrt[(x-2y)^2] There is an obvious ambiguity in the definition of f ...
6
votes
8answers
909 views

Defining a function that completes the square given a quadratic polynomial expression

How can I write a function that would complete the square in a quadratic polynomial expression such that, for example, CompleteTheSquare[5 x^2 + 27 x - 5, x] ...
1
vote
1answer
56 views
1
vote
1answer
61 views

If statement and elements of an imported data

I import a data file: SetDirectory["C:\\Users\\SE7EN\\Desktop\\mathematica\\test"]; dd = Import["data.dat", "Table"] Out[2] = {{1}, {2}, {3}, {4}, {5}, {6}, {7}} ...
4
votes
1answer
114 views

Generate expressions equivalent to rooted trees

I would like to know how to generate all rooted trees on $n$ vertices using Mathematica? More precisely, I am interested in generating algebraic expressions equivalent to rooted trees and constructed ...
1
vote
1answer
104 views

What is the inside?

What is the inside of the Mathematica command, solve, for a system of equations like the following? $$\eqalign{ (x +2\phantom{3} z)^2 + (y +\phantom{3} w)^2 &= 52\cr (x + 30z)^2 + (y + 3w)^2 ...
-2
votes
1answer
96 views

Algebra problem [closed]

I have recently run into an algebra problem that goes as follows. Using the numbers 1-9 A + B + C + D = EF E + F + G + H = CJ B + G + J = ?D total = B? where ...
2
votes
1answer
53 views

How to distribute PermutationProduct over the sum

Assuming I have two elements of the permutation group algebra $a_1$, $a_2$ such that $a_i=\sum_{p\in S_n}\alpha_pp$, I want to define a linear product $\odot$ that distributes over the sum and pulls ...
0
votes
2answers
73 views

Expand expression into quotient of negative power series

I have a function T(z) and want to expand it to the following form: At the end I want to have a list of equations, which can calculate a0, a1, a2, b0, b1 and b2 with different values of h1, h2, ...
6
votes
1answer
218 views

Maple like collect command in Mathematica

In Maple I often simplify expressions for functions of same argument using the collect command: > collect(a*f(x)+f(y)+x*f(x), f, factor) (a+x)*f(x)+f(y) where ...
0
votes
1answer
90 views

Impose an specific Trigonometric expansion with TrigExpand

Is there a way to impose in mathematica an specific trigonometric expansion with TrigExpand? I have various double-angle expressions for cosine and sine in my ...
0
votes
1answer
105 views

Replacement rules in combination with pure functions to make a change of variables

I have defined my function in this way w = f[r,Θ] ; After some calculations i obtained my results with respect to the previous function. For instance: ...
0
votes
1answer
76 views

Manipulating formal vectors

I want to work with a formal vector space spanned by integer triplets: $$ V=\text{span}\{(a,b,c):a,b,c\in\mathbb N^3\}, $$ such that Mathematica can do additions for me. For example,if I input ...
1
vote
0answers
45 views

How to make noncommutative multiplication agree with commutative multiplication

I need a noncommutative multiplication that is Associative Distributive $A**0=0$, $A**1=A$ Agrees with the commutative multiplication ($A**(k B)=(k A)**B=k (A**B)$) I have found a code ...
0
votes
1answer
75 views

Force multiplication by a single factor [closed]

I have an expression that Mathematica decides to return in the general form: y = f ( a/f + b/Sqrt[f + 2] + c*f^2/Sqrt[f + 2]) (actually my expression is much ...
13
votes
1answer
446 views

Block Matrix Algebra with Mathematica

I have come up with some BlockMatrix Algebra for Mathematica to make notations easier. I have the following: ...
1
vote
0answers
73 views

Define inverse for the custom operator

I want to define simple matrix algebra (inspired by the following posts: Block Matrix Algebra with Mathematica ; How to define custom operators ). I assume the funtion ...
6
votes
1answer
120 views

Is there a version of Together that doesn't cancel common factors?

I'm running code that produces a long combination of rational functions with free constants that need to be tuned such that the combination vanishes. My current method is to put the combination over ...
12
votes
7answers
2k views

How do I replace a variable in a polynomial?

How do I substitue z^2->x in the following polynomial z^4+z^2+4? z^4+z^2+4 /. z^2->x ...
4
votes
0answers
75 views

Transform an expression to remove the singularity

I have the expression Sin[c x]/c. Clearly it is undefined at $c=0$, but that is merely a removable singularity, since $$\frac{\sin(cx)}c=x\frac{\sin(cx)}{cx}= ...
1
vote
2answers
92 views

How to get a rule for, e.g., (x + y) to apply to (-x - y), etc.?

For example, the substitution (x + y) -> s fails here: In[1]:= (-x - y) /. (x + y) -> s Out[1]= -x - y Of course, I ...
6
votes
1answer
217 views

How to substitute the following conditions into an expression?

I have an expression: $p=a\;b\; x + b^2\; y + a\;c\; z$. I want to substitute $a\;b=1$, $b^2 = 2$ and $a\;c = 4$ to obtain $p = x + 2y + 4z$. How can I tell Mathematica to do that? I dont know how to ...
0
votes
0answers
23 views

Jacobian matrix formation from polynomial expressions [duplicate]

I want to find the jacobian matrix for 3 polynomial expression with 3 variables.. the polynomial expressions have the degree of 8.how to form it.?
3
votes
2answers
139 views

Exploiting a relation among constants

Say I have two arbitrary real constants $p,q$ that satisfy $p^2+q^2=1$. Is there any way to easily declare this relation in Mathematica? Edit More specifically I have this (among others) expression: ...
5
votes
5answers
324 views

Isolating characters in a string

I'm struggling to find the right function in mathematica to isolate specific characters in a string. I have got a formula as string (I imported it from an excelfile) like this: y = 0.97*x1 + ...
1
vote
2answers
90 views

Grouping constants in expressions

Starting from the general expression: i A(a x + b y + c z + ...) + j B(a' x + b' y + c' z + ...) + k C(a'' x +b'' y + c'' z + ...) I'd like to rearrange it to ...
2
votes
2answers
113 views

Simplification with assumptions

I'm trying to make Mathematica do some simplifications for me. I have the expression ((1 + s[1]) (-1 + s[2]) )/(-1 + s[1] s[2]) and want to simplify this with ...
3
votes
1answer
73 views

How to order lexicographically the monomers of a parametrized polynomial?

I want to order lexicographically the monomials in a "parametrized polynomial", i.e. polynomials whose "symbolic bits" may be either "variables" or "parameters". For example: ...