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

learn more… | top users | synonyms

13
votes
1answer
312 views

ToNumberField won't recognize Root as an explicit algebraic number

Bug fixed in 10.0.0 In Mathematica 9.0.1, it appears that ToNumberField will not always recognize a Root object as an ...
8
votes
2answers
97 views

How to sort arguments of Times in nonstandard order?

Is there an elegant way to sort the arguments of Times in e.g. TraditionalForm so that factors go to the front and state ...
14
votes
4answers
1k views

Is there a way to Collect[] for more than one symbol?

Oftentimes you find yourself looking for polynomials in multiple variables. Consider the following expression: a(x - y)^3 + b(x - y) + c(x - y) + d as you can ...
5
votes
1answer
97 views

Distribute transpose on matrix multiplication

I need to do the following: Transpose[A.(B+C)]=Transpose[B].Transpose[A]+Transpose[C].Transpose[A] How should I do this in mathematica? So far mathematica does ...
5
votes
1answer
57 views

Is there a way to Collect[] for more than one symbol in Mathematica 10.0?

This question has already been asked three years ago (Is there a way to Collect[] for more than one symbol?) but I'm not allowed to comment since I'm new at Mathematica StackExchange. The first ...
14
votes
0answers
133 views

Undocumented fourth parameter of Collect; how long has it been there?

While tinkering with How to get a list of monomials of a polynomial without coefficients? on a whim I tried a fourth argument in Collect and found: ...
1
vote
1answer
57 views

Min function for functions f1, f2, [closed]

There are several "min" functions in Mathematica. In the "Numerical" category, there is a "Min" function that works on a numerical list. Then there's MinValue for finding the minimum of a whole ...
3
votes
2answers
56 views

Factor a specific sub-polynomial?

Consider the following example for a polynomial in several variables: ...
12
votes
4answers
606 views

How to implement dual numbers in Mathematica?

I wonder how can I implement dual numbers in Mathematica, so that all functions work well with them (as with complex numbers). Particularly, for each function $f$, ...
6
votes
0answers
204 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 ...
0
votes
1answer
30 views

How can I manipulate a long expression to order it by factors/derivatives of a particular function?

I have a Mathematica notebook that generates a linear expression involving derivatives of a given variable. Expanded (and simplified for our purposes), it looks something like this: \begin{equation} ...
14
votes
3answers
2k views

How can I convert a complex number into an exponent form

When I have an expression such as (1/4 + I/4) ((1 - 2 I) x + Sqrt[3] y) it is hard to get an intuition of the number. So I want to convert it to the complex ...
12
votes
2answers
281 views

Pull out scalars from NonCommutativeMultiply in commutator of SU2 spin algebra

I am trying to work on spin chains in Mathematica. That is, N spin-1/2 on a one-dimensional lattice with periodic boundary condition (N+1=1). I need therefore the SU2 spin algebra $S_z, S_+, S_-$ with ...
1
vote
1answer
141 views

Handling minus signs in mathematica

I am doing symbolic manipulations in Mathematica where expressions like $(-1)^{1/3}\left(-\log z \right)^{2/3}+\log z^{2/3}$ We see that clearly this expression is zero. But Mathematica does not ...
1
vote
1answer
47 views

2D plot using Manipulate command [closed]

Can anyone tell me what the problem is with the following code: y[x_ a_] := Sin[x (1 + a x)] Manipulate[Plot[y[x a], {x, 0, 6}], {a, 0, 2}] However, the ...
4
votes
1answer
87 views

Collect without grouping terms

The built-in function Collect, when applied to more than one variable, will group expressions by the first variable, as here: ...
0
votes
1answer
41 views

Grouping by multiple coefficients

Good day! I have an output equation that has a very large amount of coeff. b(x,y), like so: ...
4
votes
1answer
50 views

Ordering in noncommutative multiply

I have an expression like s ** p1 ** p1 ** p2 - s ** p1 ** p2 ** p1 Which should be zero because the commutator between p1 ...
2
votes
1answer
76 views

Moving certain variables to one side of the equation [duplicate]

I am having trouble moving certain variables from one side of the equation to the other. For example, if i want to solve for x1: ...
13
votes
2answers
266 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
1answer
53 views

How to reduce trigonometric expressions under special conditions

For the following problems I used "FullSimplify" and "TrigReduce" but I manage to reduce more ...
1
vote
1answer
80 views

How do I find the constant term of a multivariate polynomial, when (x^0)(y^0)?

So let's say f[x_,y_]:=(2x+2y+1)^2, when I type Coefficient[f[x,y],x y] I recieve 8. But what can I input to recieve 1, when ...
1
vote
4answers
92 views

How find constant term of quadratic with square already completed?

Suppose I have a quadratic polynomial in two variables x and y in which the squares with respect to ...
10
votes
9answers
1k 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] ...
16
votes
1answer
305 views

Why is ReplaceAll behaving like this?

I'm learning to use the ReplaceAll function and I found the behavior of which is quite confusing. For Sqrt[f[x, y]] /. f[___] -> u Mathematica returns ...
1
vote
0answers
55 views

Abstract Vectors [duplicate]

Is there a way to deal with abstract vectors in the following sense: Say I have a function f[y]. Now I want to evaluate ...
2
votes
1answer
62 views

Algebraic Manipulations with Indices

I am absolutely new to Mathematica, but I've heard it is a pretty powerful tool for symbolic calculations. My problem (stated generally): I have three dimensional array. I define a symbolic operator ...
0
votes
3answers
60 views

Simplifying Terms in a Matrix

Given the following 3 matrices: M1=1/3*{{1,1,1},{1,α,α^2},{1,α^2,α]}} Z1={{Z+Zg,Zg,Zg},{Zg,Z+Zg,Zg},{Zg,Zg,Z+Zg}} M2={{1,1,1},{1,α^2,α},{1,α,α^2}} where alpha ...
5
votes
1answer
72 views

Working with quantum mechanics spins

I've written the following code for simple quantum mechanics operators on spin states: It seems to work, but the output could be better - how do I let Mathematics know that $0**\ 0==0$, and can I ...
4
votes
1answer
162 views

Is Mathematica intended to be used to do lengthy algebraic clculations? [closed]

The last two days I spent improving my Mathematica skills regarding rather simple algebraic calculations: discrete FT splitting sums combining sums changing summation indices replacing a sum with a ...
36
votes
6answers
6k 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 ...
1
vote
1answer
133 views

Forcing solutions to avoid Root[]

I'm solving a system of ordinary non-homogeneous differential equations (4 equations). The solutions will include some algebraic equations solutions as known from text books due to the use of an eigen ...
8
votes
0answers
57 views

Finding simplifying substitutions for an integral involving limits and integrand

[The following is based on a William Lowell Putnam Mathematical Competition problem.] Consider the definite integral: $I = \int\limits_2^4 \frac{\sqrt{\log (9-x)}}{\sqrt{\log (9-x)}+\sqrt{\log ...
27
votes
8answers
1k views

How do I get my equation to have the form $(x-a)^2 + (y-b)^2 + (z-c)^2-d = 0$?

I want Mathematica to express the equation $$-11 - 2 x + x^2 - 4 y + y^2 - 6 z + z^2=0$$ in the form $$(x - 1)^2 + (y - 2)^2 + (z - 3)^2 - 25=0$$ How do I tell Mathematica to do that?
10
votes
3answers
2k views

How can I rationalize the denominator of an expression?

Mathematica doesn't rationalize the denominator automatically, and I haven't found anything in the documentation about it. But I found an old post on MathGroup, which proposes a solution using ...
5
votes
1answer
70 views

Rearrange an algebraic expression so that each variable appears only once

Mathematica gave me a solution to an equation in this form: ans1 = (b c)/(a - a c + b c) $\text{ans1} = \frac{b c}{a - a c + b c}$ From solving the same equation ...
9
votes
3answers
840 views

Square both sides of an equation?

Can I define an equation (for example, x+1 == y^2 + 2), and tell Mathematica to square both sides? If not, what is an equivalent way to achieve this?
1
vote
2answers
78 views

Solving equations using algebra [duplicate]

Has anyone ever solved an equation for students using algebraic steps? For example, you start with the equation. 2x+3 = 5 Then you show subtracting 3 from both ...
1
vote
0answers
222 views

Solving Symbolically Equations with Vectors and Matrices

I want to solve equations with vector variables and vector/matrix parameters symbolically. As a basic example I would like to be able to solve something like $[I-aG]x=b$ where $a,b \in \mathbb{R}^l$ ...
10
votes
2answers
471 views

InverseSeries of multiple variables and multiple equations

CONTEXT Let us consider a bit of the Universe in which we draw spheres (see a high resolution image here). Astronomers have shown that the density within these spheres could be predicted quite ...
2
votes
3answers
114 views

How to make $a1**a2** \cdots **an=0$ for a given $n$?

In order to optimize my computation and save memory, I'd like to modify NonCommutativeMultiply so that for a given $n$ one has $a1**a2** \cdots **an=0$ for any $a1, a2, \ldots, an$. To make it ...
20
votes
1answer
519 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 ...
4
votes
2answers
408 views

Force a negative square root to be interpreted as an I

I have expressions like $$\sqrt{-\sqrt{1+x^2}} $$ how can I force mathematica to systematically rewrite this as $$i(1+x^2)^{1/4} \quad ? $$
1
vote
1answer
69 views

Simplification of algebraic expression

I found an entry of a matrix from two different methods using mathematica. Which are given as; g/(Sqrt[2] Sqrt[1 + g^2 - Sqrt[1 + g^2]]) and ...
1
vote
2answers
100 views

Simplifying an expression given a known variable relation

I am wondering if there is a way to simplify an algebraic expression given a known variable equation using Mathematica. For instance, I wish to simplify an expression for the heat change in a process: ...
0
votes
2answers
112 views

Collect is not giving me the result I expect

When I evaluate Collect[(a ((G m ω)/c^3)^(1/2) + b ((G m ω)/c^3)^(1/2)), c] I get this: ...
1
vote
1answer
62 views

I need to move X to right side without solving or simplifying anything else

I need to manipulate this equation where x is on the left side of the equation. I will be using this in excel and all other numbers will actually be referencing cells so I need x moved to the right ...
10
votes
4answers
7k views

Factoring polynomials to factors involving complex coefficients

I've run into some problems using Factor on polynomials with complex coefficient factors. Reading the documentation it looks like it only factors over the ...
1
vote
1answer
100 views

Collect powers of variables and integers separately?

Let expr contain a sum of powers of x with some coefficients ci. The exponents of ...