Questions tagged [simplifying-expressions]

Questions on manipulating complicated expressions and making them look simpler using Simplify, FullSimplify and Reduce.

Filter by
Sorted by
Tagged with
72
votes
5answers
4k views

Advice for Mathematica as Mathematician's Aid

I use Mathematica mainly as an aid in symbolic attacks on problems, usually intermediate or harder and often number theoretic. While Reduce, ...
55
votes
4answers
7k 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]) ...
54
votes
2answers
11k views

What is the difference between a few simplification techniques?

I am trying to understand the difference between Refine, Simplify and FullSimplify, and when ...
47
votes
2answers
2k 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 ...
38
votes
2answers
1k 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, $...
30
votes
1answer
1k views

A better simplification function

I am creating this question and posting an answer to it as a help for those who have problems with Mathematica simplification oddities that appear in other questions on the site. First of all, there ...
30
votes
1answer
5k 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 ...
29
votes
3answers
2k 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 ...
29
votes
1answer
3k views

A one line proof that one is zero using Mathematica 10

a = (Sqrt[2] + 1) (Sqrt[2] - 1) - 1; {a/a, Simplify[a]/a, b/b == Simplify[b]/b} {1, 0, True} This one line "proof" that ...
28
votes
4answers
611 views

FullSimplify wrongly reduces expression to zero

Bug introduced in 9.0 and persisting through 11.0 I get the following output with a fresh Mathematica (ver 10.0.2.0 on Mac) session ...
26
votes
4answers
3k views

Is it possible to get this 'nicer' solution for an integral from Mathematica?

I'm on 11.3.0 for macOS (64-bit). On a recent CAS-enabled exam question a few weeks ago I was required to evaluate the following integral: $$ \int_0^5\left(\sqrt[3]{125-x^3}\right)^2\,dx $$ In ...
26
votes
4answers
1k 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 h^2\right)^2}...
24
votes
1answer
803 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 ...
23
votes
1answer
7k views

What is the proper way to verify that two expressions are equivalent?

First of all, it appears to me that $$\left|\frac{1}{x} + x^2\right| = \frac{|1 + x^3|}{|x|}$$ is true. I don't know why, but my attempt to verify it in Mathematica failed. ...
21
votes
1answer
621 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 ...
20
votes
4answers
12k views

Simplify expressions with Log

How can I get Mathematica to simplify the following expression n Log[a] + m Log[b] - m Log[a + b] - n Log[a + b] into ...
20
votes
2answers
1k 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: ...
20
votes
3answers
5k 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} ...
19
votes
3answers
1k 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 ...
19
votes
4answers
3k 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 ...
18
votes
3answers
517 views

Why does Mathematica simplify $x/x\to1$?

If I enter x/x, I get 1. Such behavior leads to this: Simplify[D[Sqrt[x^2], x, x]] 0 ...
18
votes
1answer
464 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 ...
16
votes
4answers
14k 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 ...
16
votes
1answer
614 views

How to enlarge Mathematica's knowledge about certain functions?

I'm often troubled with the following task. I need to carry out symbolical computations involving certain special functions. Let me take as an example Barnes gamma-function. It is included in ...
16
votes
3answers
5k 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. ...
15
votes
2answers
15k 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 : ...
15
votes
2answers
427 views

Factor a polynomial Root into Roots of smallest possible degree

Suppose I have a polynomial Root representing an algebraic number. I want to represent it as a product of several polynomial Root...
15
votes
1answer
223 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 ...
15
votes
1answer
320 views

A puzzling result of “FullSimplify”

When I input: FullSimplify[(1 - a^2)/b^2, a^2 + b^2 == 1] the result is the ideal answer 1; However,if I input: ...
14
votes
1answer
3k 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 ...
14
votes
2answers
1k views

Behavior of Reduce with variables as domain

When using Reduce, I accidentally put a set of variables as the domain. To my surprise, it not only seems that Reduce expects ...
14
votes
2answers
2k views

Simplify assumes Boolean 1 and 0 in logical expressions

Per this chat discussion and this previous question where I encountered the strange behaviour: ...
14
votes
2answers
371 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}= x\...
14
votes
1answer
553 views

What's wrong with Simplify and FullSimplify?

I have a quite complex list of equations and inequalities I combine to a boundary condition for my cost function. After investigation of two days I found the bug (I really name it a bug!). One of my ...
14
votes
1answer
605 views

Why is this evaluation halved when adding units?

Bug introduced in 9.0 or earlier and persisting through 11.2 or later Why does this strange behavior occur when dealing with units and quantities? ...
13
votes
2answers
912 views

Is there a way to to substitute for symbols, simplify, and back-substitute?

In papers in physics and mathematics one often encounters longer mathematical expressions which have to be, for intuition and typesetting, expressed using symbols standing for recurring patterns in ...
13
votes
1answer
540 views

How to prevent simplification?

I have a question about the concept of simplification. I want to explain it with an example. When I write $4/8$ in mathematica, output is 1/2. How can I return ...
13
votes
3answers
7k views

Complex number operations: telling Mathematica variables are real

I want to do Conjugate[a + b*I], but when I do that, the solution is Conjugate[a] - I*Conjugate[b]; when for me, a and b are ...
13
votes
3answers
4k views

Combining cosine or sine terms into a single cosine or sine

A function that is the sum of two cosine terms of the same frequency x[t_] := a1 Cos[w0 t + b1] + a2 Cos[w0 t + b2]; can be simplified to a single ...
13
votes
1answer
513 views

Simplify with TransformationFunctions, Bug?

I want to use custom transformation functions in Simplify, but Mathematica does not seem to use them properly. Consider the following ...
13
votes
0answers
208 views

Bug? Numerical calculation error with FullSimplify and arbitrary precision

Bug introduced after 5.2, fixed in 8.0, reintroduced in 9.0 and persisting through 11.2 Is this a bug? If I do FullSimplify[n E^(0``10 n)] then it returns <...
12
votes
2answers
725 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: <...
12
votes
3answers
2k views

Why does Simplify[b-a] give -a+b and not b-a?

Simplify[b - a] results in -a + b. I prefer b - a, which is a bit simpler (3 symbols instead ...
12
votes
2answers
552 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 x^4+...
12
votes
2answers
8k views

Remove annoying Conjugate

Here is an expression ...
12
votes
3answers
15k views

Mathematica not simplifying square root expressions even with assumptions

I have the following expression: expr=(Sqrt[2]r Sqrt[(4+r^2) (2+r (r+Sqrt[4+r^2]))])/(4+r (r+Sqrt[4+r^2])) Then ...
12
votes
1answer
7k views

Properly Force Mathematica to Simplify Log Expressions/Rules

I want to be able to expand $\log(x^n e^x) = n \log(x) +x$: FullSimplify[Log[x^n Exp[x]], x > 0 && Element[n, Integers] && n > 1] yields <...
12
votes
1answer
468 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 ...
12
votes
1answer
580 views

Mathematica 10 unable to Simplify[Cos[2 ArcCos[A]]]

Mathematica 10 evaluates Simplify[Cos[2 ArcCos[A]]] as Cos[2 ArcCos[A]], instead of the desired ...
12
votes
3answers
522 views

How can we simplify equivalent sums over different index variables?

The following should be True for any function x: ...