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
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]) ...
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 ...
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 ...
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 : ...
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 ...
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, ...
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 ...
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 ...
10
votes
2answers
2k 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 ...
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 ...
54
votes
2answers
10k views

What is the difference between a few simplification techniques?

I am trying to understand the difference between Refine, Simplify and FullSimplify, and when ...
10
votes
2answers
8k 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 ...
10
votes
2answers
1k 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) + g(x)\right)dx}=\int{f(x)...
10
votes
4answers
505 views

How do I invoke the default complexity function?

Documentation on ComplexityFunction says: With the default setting ComplexityFunction->Automatic, forms are ranked ...
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
530 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 ...
8
votes
3answers
1k 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 ...
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 ...
28
votes
4answers
609 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 ...
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} ...
12
votes
2answers
8k views

Remove annoying Conjugate

Here is an expression ...
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 ...
4
votes
2answers
1k views

Replacing gamma at half integers by double factorial

It is well-known that for any positive integer $n$ the equality $\Gamma(n+\frac12)=\sqrt\pi\,(2n-1)!!/2^n$ holds, where $!!$ stands for the double factorial. I am using ...
5
votes
4answers
957 views

Fullsimplify does not simplify Abs'[1.-a]

I have to simplyfy an expression involving Abs' This works: FullSimplify[Abs'[1 - a], a ∈ Reals] Sign[1 - a] but this does ...
5
votes
1answer
497 views

Using Hold correctly with Simplify and ComplexityFunction

It seems like Mathematica immediately evaluates the expression Sqrt@I to (-1)^(1/4). I'm trying to use ...
3
votes
2answers
593 views

How can I simplify $\log(512)$ to $9\log(2)$?

Can you explain me about the result of Integrate. ...
6
votes
3answers
3k views

Removing Abs from Abs[a + Exp[I*c]b]^2

Title says it all. Mathematica produces sometimes expressions of the form Abs[a + Exp[I*c]b]^2 where all three quantities a, b and c are positive real numbers. ...
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 ...
7
votes
1answer
2k views

Trace of FullSimplify

I have a symbolic function and I used FullSimplify command to simplify the equation given below. I am calculating it by hand but I couldn't reach the same solution. ...
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: ...
2
votes
1answer
349 views

Simplify expression to Abs

FullSimplify[Sqrt[1/(a^2 b^2)], Element[{a, b}, Reals]] gives Abs[1/(a b)] How do I simplify the following expression <...
11
votes
4answers
6k 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
1answer
217 views

Simplify oversimplifies. What to do about it?

According to Mathematica 10: $$\mbox{Simplify}\left[\frac{\frac{1}{t^2}-1}{(t+\frac{1}{t})^2}\right]==\frac{1-t^2}{(1+t^2)^2}$$ However, the first equation does not tolerate $t=0$ because of a ...
4
votes
1answer
524 views

Simplify equations with pattern assumptions

When simplifying an expression using Simplify[expr, assumptions], the assumptions has to be explicit. Is it possible to simplify an expression with pattern ...
3
votes
1answer
116 views

Simplifying expressions with head Max

(I saw: Unable to evaluate reasonable max expression but this seems an even easier case an I thought it worth posting) See the following simplifications of Max operators, which are all very ...
2
votes
2answers
2k views

Simplifying expressions with square roots

I would like Mathematica to simplify this expression: $4 \left(16 \sqrt{\left(-1+2 c^2\right)^2}-32 c^2 \sqrt{\left(-1+2 c^2\right)^2}+\sqrt{\left(1-8 c^2+8 c^4\right)^2}\right)^2$ ...
2
votes
1answer
248 views

Arrange equation in normal form

Is there a way, or if not, how could one define a function which takes an equation in any form (for example as given by FullSimplify): $$(A+X_0) x+By=3x$$ and ...
24
votes
1answer
801 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 ...
11
votes
2answers
2k views

a problem about simplifing conjugate

the situation is as follows ...
9
votes
4answers
936 views

Counting multiplications (complexity function)

I'm trying to count the number of times multiplication appears in an expression (for the purpose of constructing a ComplexityFunction that would help me simplify a terrible algebraic expression for ...
6
votes
2answers
1k views

Why doesn't FullSimplify simplify expressions with DiracDelta?

I want to simplify a complicated expression with some Dirac delta distributions, but FullSimplify does not do what I want. Specifically, I want ...
5
votes
3answers
537 views

Transform Piecewise[] into sum of indicators

I'm interested in transforming a piecewise defined function into a sum of indicator functions, ultimately with the aim to be better able to integrate them. As an example I would like to transform the ...
4
votes
1answer
512 views

What's the correct method to simplify exponentials?

I have a sum of exponentials that I'd like to simplify. The issue is when I use Simplify, Mathematica loves to factor out one exponential factor. See below: $$e^{-i ...
18
votes
3answers
509 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 ...
4
votes
1answer
564 views

How to decompose a complex expression containing repeated subexpressions? [duplicate]

Suppose I have an expression like ...
9
votes
3answers
890 views

Simplifying the trace of a matrix expression

I have a long expression involving matrices that I derived using the NCAlgebra package. Can I simplify the trace of the expression? For example, say b is a scalar (...
4
votes
1answer
292 views

Can't simplify Abs[a*Cos[x]]^2

Why doesn't FullSimplify[ Abs[a*Cos[x]]^2, Assumptions -> {{a, x} ∈ Reals}] simplify to (a*Cos[x])^2 but this query <...
6
votes
1answer
979 views

Does the Im function work with symbolic arguments?

Does the Im function work with symbolic arguments? ...
6
votes
1answer
294 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 ...
5
votes
2answers
702 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: ...