Questions on manipulating complicated expressions and making them look simpler using Simplify, FullSimplify and Reduce.
31
votes
2answers
551 views
Is it possible to make Mathematica reformulate an expression in a more numerically stable way?
I'm writing a numerical optimization, and I'm having a problem with an expression of the form
$$ e^{-t} (1+\mathrm{erf}(t)) $$
The overall shape of the function looks correct, but when $t$ is small, ...
28
votes
2answers
914 views
What is the difference between a few simplification techniques?
I am trying to understand the difference between Refine, Simplify and FullSimplify, and when ...
21
votes
2answers
269 views
Why does Simplify ignore an assumption?
Here is the example:
Simplify[x + y, x + y == a]
Simplify[x + y, x + y == 5]
Mathematica 9 output:
x+y
5
I expect the ...
20
votes
4answers
553 views
An apparently “simple” limit?
Let $c$ and $h$ be real values.
I was using Mathematica to compute the limit $(h \rightarrow \infty)$ of the following expression:
$$
\frac{\left(h^2 +c^2 h^2 + \sqrt{4 h^2+\left(h^2+c^2 ...
20
votes
1answer
191 views
How can I see which transformations Simplify attempts?
The documentation for Simplify[expr] says that it performs a sequence of algebraic and other transformations on expr, and returns the simplest form it finds. How can I see which transformations it ...
17
votes
3answers
375 views
Can I simplify an expression into form which uses my own definitions?
This seems like a simple thing to do, but I couldn't find anything relevant from Mathematica documentation.
So suppose I have an expression:
a*b/(a + a*Cos[a/b])
...
17
votes
3answers
397 views
How can I completely ban usage of some functions in output and mandate use of others?
For example, I hate that Mathematica uses Pochhammer symbol in outputs and prefer all the expressions in Gamma function. How can ...
15
votes
2answers
446 views
Why doesn't FullSimplify drop the Re function from an expression known to be real?
For some reason Mathematica does not properly simplify this expression:
...
13
votes
3answers
181 views
Common subexpression from two expressions
I am working with some unpleasantly tedious polynomials, which need to be manipulated in various ways (integrate with respect to some variable, differentiate with respect to another). Since these ...
12
votes
1answer
98 views
How to instruct FullSimplify to assume that PossibleZeroQ returns correct result?
Sometimes I have a really huge expression that cannot be significantly simplified by FullSimplify. I would like to, so to speak, "simplify with faith" using ...
12
votes
1answer
135 views
Unable to evaluate reasonable max expression
Consider the following statement:
Max[0, Sqrt[1 - Cos[4 \[Theta]]]]
You'll find that Mathematica won't evaluate this, because it doesn't know the range of ...
11
votes
2answers
374 views
Surprises simplifying simple polynomials
I came across some somewhat surprising behavior of Simplify today, on something very simple. Let's take two cubic polynomials that we know have the same value:
...
11
votes
3answers
652 views
Why doesn't Mathematica simplify a square root of an expression that equals a square of a positive real?
When I try and simplify this expression:
...
11
votes
0answers
540 views
Simplify matrix algebra
I'm trying to simplify some matrix linear algebra, for example, simplify
$$\big(a1\times(A1\cdot A2)\big)\cdot\Big(a2\times A3\cdot A4+(a3\times A5)\cdot(a4\times A6)\Big)^{T}$$
where lower case ...
10
votes
2answers
1k views
How to specify assumptions before evaluation?
If I request mathematica evaluate an integral for me, I'll often get a more general ConditionalExpression than I want. Example :
...
10
votes
3answers
340 views
How do I simplify expressions with square roots?
I want
$\left\{\frac{1}{1+\sqrt{2}-\sqrt{3}},\sqrt{5-2 \sqrt{6}},\sqrt{4+\sqrt{15}}\right\}$
to be simplified to
$\left\{\frac{1}{4} \left(2+\sqrt{2}+\sqrt{6}\right), \sqrt{3}-\sqrt{2}, \frac{1}{2}
...
10
votes
1answer
280 views
Is my expression too complicated for FullSimplify or am I doing something wrong?
I have a messily defined function $v(h, w)$ with $h, w \in \mathbb{R}$ and with a removable singularity at $h=1/2$, and I am trying to prove some of its properties using Mathematica. In particular I ...
10
votes
1answer
333 views
How to get FullSimplify to fully simplify my expression with custom complexity function?
To simplify based on the visual complexity of an expression (i.e. the complexity of the function as displayed in the notebook instead of the internal form, which in some cases may be substantially ...
9
votes
1answer
288 views
Simplify Sin[x]/x to Sinc[x]
I have an expression in the form of $\tt \frac{Sin[x]}{x}$ that I would like to simplify to the form of Sinc[x]. I've tried the ...
9
votes
4answers
157 views
FullSimplify Over Reals Automatically
Frequently, Mathematica will produce some expression in a complicated form, with a number of unset variables. For me, it is rare that I would be interested in solutions that are generalized to both ...
9
votes
3answers
1k views
Strategies for simplifying complicated expressions
I have a very complicated expression involving trigonometric functions, complex numbers etc. You may find it here as it is too long to be pasted here. You may also find a screenshot of it here.
...
8
votes
2answers
261 views
Shaping/simplifying equations in a certain way
A problem I am occasionally facing is to simplify an equation not to it's shortest form but to a form that is simple by other means. Often, this is grouping the term according to certain functions, ...
7
votes
2answers
384 views
Why aren't these additions of integrals and summations equal?
I have the following code:
Simplify[Integrate[f[x] + g[x], x] == Integrate[f[x], x] + Integrate[g[x], x]]
To test:
$$\int{\left(f(x) + ...
7
votes
2answers
363 views
Simplifying the derivative of $|x|$
Context
In[855]:= D[Abs[x], x] /. x -> 1
Out[855]= Derivative[1][Abs][1]
In[856]:= D[x, x] /. x -> 1
Out[856]= 1
Question
Why is ...
7
votes
2answers
268 views
How to deduce a generator formula for a polynomial sequence?
Consider a polynomial sequence $\{p_n\}$ generated by some (simple) rule:
$$
\begin{array}{l}
p_1(x)=x \\
p_2(x)=2 x-x^2 \\
p_3(x)= x^3-3 x^2+3 x \\
p_4(x)=-x^4+4 x^3-6 x^2+4 x \\
p_5(x)= x^5-5 ...
7
votes
3answers
228 views
FullSimplify does not work on this expression with no unknowns
I can't reproduce this simple example from Habrat, 2010 ("Mathematica : a Problem-Centered Approach"). It is supposed to demonstrate the functionality of ...
7
votes
1answer
188 views
RootSum result manipulation/simplification
Consider the sum
sum1 = Sum[ k/( k^7 - 2 k + 3), {k, Infinity}]
...
7
votes
1answer
166 views
Why doesn't FullSimplify get rid of the common factor in this expression?
FullSimplify does not get rid of the z factor in the following expression:
...
7
votes
1answer
445 views
Assumptions on unknown functions
I'm trying to do analytic calculations in a quantum mechanic harmonic oscillator basis. Specifically I want to be able to evaluate functions of the many particle density.
I define the following ...
6
votes
4answers
870 views
Checking if two trigonometric expressions are equal
Say I have two trigonometric expressions which are a bit complicated. Is there a quick way to check if they reduce to the same thing (that they are equal) using Mathematica?
I was solving this: $y'' ...
6
votes
3answers
293 views
Sum over binary digits of integer
This might seem like a simple enough question but Mathematica seems to simplify inadequately here:
How would you sum over the digits of an arbitrary binary number?
I already tried this:
...
6
votes
2answers
305 views
How do I simplify a vector expression?
I am doing vector analysis. I have figured out that the following expression won't be simplified in Mathematica:
Simplify[Dot[x, y] - Dot[y, x]]
I think the ...
6
votes
4answers
2k 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 ...
6
votes
4answers
227 views
Attaching persistent assumptions to symbol definition
Is it possible to attach assumptions to a symbol? This relates to this question. Most of my work involves physical equations, i.e. there are basic assumptions on variables that will always hold true ...
6
votes
1answer
298 views
How to Simplify equations over a Ring with Mathematica?
For example, when we work over a ring, the equation x^3=0 does not imply x^2=0 or x=0, but ...
6
votes
1answer
113 views
How to reduce expressions with complex coefficients in the form of a+0.*I
I'm trying to get an eigenvalue equation in Mathematica, and the result is an expression with coefficients of the form a + 0. I. For example,
Is there any clever ...
6
votes
1answer
321 views
Simplify an expression containing NonCommutativeMultiply
How does mathematica evaluate the following expression to zero:
...
6
votes
1answer
493 views
Why does this sum not simplify properly?
I was trying to get Mathematica to simplify some moderately ugly sums and I ran into some pretty weird behaviour, which I tracked down to the following example. I'm working with ...
6
votes
0answers
91 views
What are the default TransformationFunctions used in Simplify and FullSimplify?
If I do
Simplify[(c^3 - s^3)^2 - (s^3 + c^3)^2,
TransformationFunctions -> Automatic]
(i.e. a verbose version of default behaviour), what transformation ...
6
votes
0answers
146 views
Faster simplification of linear combinations of some specific functions
After some profiling I've found that my program spends most of its time in the simplification step. The program uses my simplification function many times (over different data). My calculation is not ...
5
votes
2answers
136 views
5
votes
2answers
169 views
Inequality with assumptions not simplifying
Can someone explain to me why the following does not simplify to True (as all constituents are positive)?
...
5
votes
2answers
138 views
Why isn't Simplify doing more simplification of this expression?
When I try this
Simplify[(1-a)*(1/(1+x*m))^(1-a)(1+m)^(1-a) +
(1-a)*(x*m)^a*((x*m)/(1+x*m))^(1-a)*(1+m)^(1-a)]
the output is
$$\frac{(1-a) (1+m)^{1-a} ...
5
votes
1answer
213 views
Validating simplifications analytically
I have a rather complex expression which I would like to simplify and check my work along the way (Mathematica does not simplify very basic things and it is frustrating me). In the following example, ...
5
votes
2answers
254 views
Replacements/Substitutions in Mathematica
I am a new user of Mathematica and have some questions about the simplifications of calculated expressions.
I am unable to attach an image of the session, but my Mathematica commands are:
...
5
votes
2answers
256 views
How to group the powers of one variable?
Consider the following expression:
$\sqrt{a x} \sqrt{b x}$
What do I use to make it simplify to:
$\sqrt{ab} x$
I tried actually everything (Simplify, FullSimplify, Collect and so on...) and such ...
5
votes
2answers
258 views
Log of products to sum of logs
I have a log of products:
$$\log \left(\prod _{i=1}^n \left( g(a(i,i)) \prod _{k=1}^i f(a(i,k))\right)\right)$$
That I turn into a sum of logs (I know everything involved is nice enough):
$$\sum ...
5
votes
1answer
159 views
Is there a way to track the Simplify process?
Is there any way to track how Mathematica actually performs Simplify, so that we can see what those "Automatic" transformation functions it applies are and how it ...
5
votes
1answer
76 views
How to apply tags to expression terms?
I often see on this site and at the mathgroup the repeated questions on how to rearrange expression that Mathematica "likes" to keep in one form, but the user prefers in another. Consider this trivial ...
5
votes
0answers
48 views
Faster way to perform SameQ[Reduce[…], Reduce[…]]
I'm have some expressions that I need to confirm the equality of. SameQ[Reduce[...], Reduce[...]] works like a charm for the more simple expressions, however when ...

