Linked Questions

2 votes
2 answers
4k views

Rewriting one expression using a variable representing another expression [duplicate]

I have two expressions: w1 = (a+b)/c^2; w2 = (a^3 + 3 a^2 b + 3 a b^2 + b^3)/c^6; How can I ask Mathematica to try to find an alternative expression for ...
O.C.'s user avatar
  • 23
4 votes
3 answers
183 views

Rule can not work? [duplicate]

For example I have this equation,I want to use c->a/b ,but it can not work $$ \frac{a^2}{b^2}+\frac{b^2}{a^2}+\frac{a}{b}+e^{a/b}+\frac{b}{a}+\log \left(\frac{a}{b}\right) $$ ...
我心永恒's user avatar
  • 1,562
0 votes
1 answer
3k views

How to write a variable in terms of the other [duplicate]

I have an equation that defines a variable like y=4x+a. I had another equation, z=x+2+4, I would like to know if there is a way in Mathematica to get an expression in which z= a*y+C, in which a and C ...
Paulo's user avatar
  • 1
2 votes
2 answers
401 views

Rewriting the set of equations in terms of new variables, using replacement rules when the expression contains partial derivatives [duplicate]

I am working with cumbersome equations, that contain a lot of terms. Here I will consider simple example: ...
Mikhail Genkin's user avatar
3 votes
1 answer
185 views

ReplaceAll with Powers [duplicate]

If I run the following code: a^2/b^2 /. {a/b -> c} I'm getting output: a^2/b^2 How can I obtain ...
Mieczmik's user avatar
0 votes
2 answers
808 views

Replacing a expression in another expression with a Variable [duplicate]

I want to set a symbol (or variable) for an expression. Here is an example: A x^2 + C x + D I want to reduce this expression to ...
Amir's user avatar
  • 1
3 votes
2 answers
197 views

How can I use ReplaceRepeated (//.) in this case? [duplicate]

Consider the following case: (a^3*b) //. {a^2 -> c, a*b -> d} instead of c d the output is: ...
mattiav27's user avatar
  • 6,687
1 vote
1 answer
158 views

Reverse substitution [duplicate]

If you apply rules and then simplify you may get something like. (25 A^2 hbar Sqrt[π])/Sqrt[hbar m w] How would you get mathematica to rewrite this in terms of E ...
ions me's user avatar
  • 881
2 votes
1 answer
312 views

How can I simplify the result of a differential equation by using my own defined expressions? [duplicate]

I want to solve the following differential equation with mathematica: α β * w''''''[ξ] + ( 1 + α - p ) * w''''[ξ] + p/β * w''[ξ] = 0 The answer seems at ...
alisha's user avatar
  • 45
0 votes
3 answers
56 views

How to replace polynomials numerically? [duplicate]

We know that the value of this equation is 0 x2 y1 - x1 y2 == 0 For the following equation, there is a correlation between the polynomial parts of the known ...
csn899's user avatar
  • 4,051
1 vote
0 answers
149 views

Introducing new variables implicitly [duplicate]

I have a calculation expr111 = cs[giso, xiso, 1, 1, 1] that gives the result -((k x)/(2 (1 + 1/4 k (x^2 + y^2 + z^2)))) I ...
John's user avatar
  • 11
1 vote
2 answers
114 views

How do I format expressions so that replacement rules correctly apply to exponents? [duplicate]

I have a series of rules that I would like to apply to a series of expressions with variables, but cannot get Mathematica to correctly recognize that these rules should apply when my variables have ...
Susan's user avatar
  • 11
1 vote
1 answer
113 views

Solving for a constant multiplier of a variable [duplicate]

I would like to make this manipulation: Solve[r Sin[α[t]] + l Cos[ϕ[t]] Sin[γ[t]] == 0, l*Cos[ϕ[t]]] But it seems that the ...
Bendesarts's user avatar
  • 1,099
0 votes
1 answer
103 views

Substitution inside an expression [duplicate]

I'm trying to get mathematica to replace an expression with a reduced form. I wanted to replace $(k/w)$ with $h$ in a particular expression, and I've tried something like: ...
DRG's user avatar
  • 877
0 votes
0 answers
66 views

Simplify symbolic expression in terms of constants [duplicate]

Say I have an expression $a+b+a\times b$ and I define $c:= a\times b$. How do I get Mathematica to write $a+b+a\times b$ in terms of $c$, i.e. $a+b+c$?
BillyJean's user avatar
  • 1,273
0 votes
1 answer
48 views

Reducing Output length by introducing new variables [duplicate]

I have outputs like "expression/(1+3*c^2) +anotherexpression/(1+3*c^2)" and so on. Is there any way to set 1/(1+3*c^2)=A where A is a new variable so that the output reads like "A*expression+A*...
Trac3's user avatar
  • 1
1 vote
0 answers
39 views

replacement rules don't account for signs [duplicate]

I would like to make a single replacement rule that disregards the sign. I have the following expression: ...
Alejandro Marcos Aragon's user avatar
0 votes
0 answers
32 views

Algebraic substitutions not working? [duplicate]

I have been trying to simplify this matrix $$ \left( \begin{array}{cc} \frac{1}{2} \left(-2 g \sqrt{1-\text{tauA}} \sqrt{1-\text{tauB}}+\text{mu} \text{tauA}+\text{mu} \text{tauB}+\text{...
neilps2000's user avatar
32 votes
6 answers
20k views

Replacing composite variables by a single variable

To replace a single variable by another variable, one can simply use the the replace all (/.) operator (e.g., ...
user001's user avatar
  • 1,397
22 votes
7 answers
19k 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 ...
niklasfi's user avatar
  • 2,623
32 votes
3 answers
3k 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 ...
Rex Kerr's user avatar
  • 421
16 votes
2 answers
3k 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 ...
Void's user avatar
  • 415
16 votes
3 answers
2k views

Find subexpression to minimize leafcount after replacment with temporary variable

Given an expression expr, is there an automated way to find a subexpression subexpr such that replacing ...
Bill Simpson's user avatar
9 votes
3 answers
3k views

Replace expressions with symbols

First of all: I'm new to Mathematica, so I would appreciate it if the answers are quite complete. I have the result of calculation that is expressed in $\sin$ and $\cos$. Now, all of these can be ...
JT_NL's user avatar
  • 983
10 votes
3 answers
510 views

Matching (y/x)^u terms wherever the appear in an expression

Mathematica keeps rewriting expressions, so it is hard to figure what pattern to use. I am trying to replace all occurrences of $\frac{y}{x}$ by $t$, but Mathematica re-writes $\frac{1}{\left(\frac{y}...
Nasser's user avatar
  • 143k
6 votes
1 answer
1k views

Reduce an equation by putting a new variable

I have the following equation given: $$ (26-x)\cdot\sqrt{5x-1} -(13x+14)\cdot\sqrt{5-2x} + 12\sqrt{(5x-1)\cdot(5-2x) }= 18x+32. $$ In order to solve it, I want to substitute $t = \sqrt{5x - 1}-\sqrt{...
minthao_2011's user avatar
  • 4,503
1 vote
1 answer
5k views

Express in terms of a new variable [closed]

I have a simple expression: s=4a(x+y)^3 I want to express s in terms of b where b=x+y. That is s will become 4ab^3. How to achieve this in Mathematica?
Boja's user avatar
  • 11
2 votes
3 answers
514 views

Question on alternate forms of polynomial output

EDIT: Would it be possible to do something like let $y=ax+b$ then use Collect[] or Apart[] on the new expression? How would I go about this. I've tried using Collect[%,ax+b], Collect[%,{ax+b}], and ...
Kvo's user avatar
  • 275
3 votes
3 answers
640 views

Replacing a sum of expressions

I have an equation which Mathematica solves but gives a huge output. However I notice in this output that the same expression occurs many times. Namely: $E=864 a^6 - 432 a^4 b^2 + 54 a^2 b^4 - b^6 + ...
Phibert's user avatar
  • 147
2 votes
1 answer
1k views

How to transform an expression using algebraical instead of pattern rules [duplicate]

I would like to transform rules algebraically. A very simple example would be: - k^2 - 2 k x + x^2 /. {2*k -> 1} This transforms to: - $$k^2-2 k x+x^2$$ ...
Blair Azzopardi's user avatar
3 votes
1 answer
434 views

Collecting factors of polynomials

First up, I'm new to Mathematica and MathematicaSE, so please correct me if I'm doing anything wrong. My problem is the following: I have a bunch of complicated polynomials in $3$ variables $x_1,x_2,...
Tom Bombadil's user avatar
2 votes
2 answers
115 views

Force using function definitions when simplifying

So, I have my function, such as f[x_,y_]:=(1-x/y)^(1/2); This function enters a big expression that contains variables x and y, as well as the function f. Now I ...
ThisGuy's user avatar
  • 121
1 vote
4 answers
399 views

Replace a sum of squared variables by a new variable squared

Is there any way to tell Mathematica to replace $\kappa^2 + k_z^2 \rightarrow k^2$ in an expression? I want to make a result more readable, e.g. something like this: $$\frac{2 k_z^3 \sqrt{k_z^2 + \...
rubenvb's user avatar
  • 191
0 votes
3 answers
441 views

How to simplify an expression by substitution?

Sometime Solve and DSolve give a finial form of the solution, which is fine in may applications. However, in some cases, one may ...
Enter's user avatar
  • 1,229
2 votes
1 answer
418 views

How to Collect $x$ powers to group $\sqrt{x}$ and $\sqrt{1+x}$ together?

I have been failing to apply Collect[#, x]& to render a like-power series of $x^k$. Here $k = \frac52, \frac32, \frac12,\frac{-1}2$, etc. The major issue is: ...
Lee David Chung Lin's user avatar
2 votes
1 answer
386 views

Substituting variables inside a matrix

I'm trying to substitute some dependent variables into equations inside of a matrix, however $Replace[]$ and and $/.$ don't seem to work. The equation in question is just a vector matrix of ...
Brandon's user avatar
  • 105
1 vote
1 answer
475 views

Writing a trigonometric expression in terms of another [duplicate]

This is related to another question, in which one wants to rewrite a function of a single variable in terms of another function of that variable. Here I have a function of multiple variables. I want ...
New Developer's user avatar
1 vote
2 answers
167 views

How to "reversely" replace definitions?

I have the following problem at hand. 1.) I have a list of definitions like ...
A friendly helper's user avatar
1 vote
3 answers
202 views

Substitution in expressions

As the title suggests, I want in an expression to to some substitutions. For example in the expression $\mathcal{L}^+_0+\mathcal{L}^-_0+\mathcal{L}^+_0+\mathcal{L}^-_0+\mathcal{L}_1$ I want to ...
hal's user avatar
  • 783
1 vote
0 answers
233 views

How to simplify expressions

I read several similar posts but I have not found a solution yet. However, I think that my problem should be quite easy. So here we are. Relations ...
Vaggelis_Z's user avatar
  • 8,760
3 votes
1 answer
140 views

Replacing patterns (determinants) in a rational multivariate function and/or getting `replacementFunction` to work on a multi-linear expression

Given a rational multivariate function known to contain determinants, what is the best way to rewrite the function in terms of the determinants? A simple example: ...
jjstankowicz's user avatar
1 vote
2 answers
99 views

Applying a simple transformation rule when Plus automatically simplifies

I have the following simple rules: {x2-x1->s1, -(x2-x1)->-s1, x3-x2->s2, -(x3-x2)->-s2} I want to apply that rule to the following: ...
N D's user avatar
  • 25
3 votes
2 answers
96 views

Treat 2 variable as 1

Is there anyway to treat two variable, that are a result of expansion, as one? To use Solve[] I can do ...
I should change my Username's user avatar
1 vote
0 answers
142 views

How to Pattern Match complicated patterns? [closed]

How can I get the output expressed in terms of p1 and p2 instead of exponentials? ...
Jerry Guern's user avatar
  • 4,602
1 vote
0 answers
131 views

How does PacletInstall work? And is it possible to find packages using PacletInstall?

It seems that many packages published could be installed using PacletInstall . For example, from this Rubi install instruction webpage, we could see the comman: ...
shelure21's user avatar
  • 165
1 vote
1 answer
58 views

How to simplify expression depending on former definition?

If a = x + y b = x - y u = a + b v = a This gives me for u/v the expression (2 x)/(x + y)...
user57467's user avatar
  • 2,728
2 votes
1 answer
53 views

Replace subexpression that appears as inverse too

I have eq=Sqrt[(g m)/h] Tanh[Sqrt[h/(g m)] t] then I am trying to replace Sqrt[m g/h] by a symbol ...
user avatar
0 votes
0 answers
84 views

Assign a variable to an expression in Mathematica

I have the following matrix {{a^2 + b + \[Sqrt](m + n) + 5, 23 x + 7 a}, {14 b, a^2 + b + \[Sqrt](m - n) + 5}} I want to replace the expressions ...
H. Kenan's user avatar
  • 663
0 votes
1 answer
79 views

Is there a way to use identities in Mathematica efficiently? [duplicate]

Imagine I have defined a variable l=p/(a*b) Let's say I perform some operations, and I get the final answer to be p/a. But all I ...
megamence's user avatar
  • 101
0 votes
0 answers
72 views

Problem with replacing products involving identical variables due to the rewrite to powrs

This is most easily explained with an example: Say I have a b^2 or a b a and I want to replace ...
Kvothe's user avatar
  • 4,419

15 30 50 per page