Message Boards Message Boards

Replace terms within a polynomial function with other terms?

Hi all,

I would like to ask if there's a way to replace a few terms within a polynomial function into another term.

For example of my work, I have a term of

 1 - 6 \[Lambda]^2 + 10 \[Lambda]^4   

and I would like to replace the term

-\[Lambda]^2

within the the polynomial into X^2,

so that the final answer should be =

1 + 6 X + 10 X^2

Thank you,

Regards, Syed

2 Replies

In general, one can use the function Eliminate:

Eliminate[{f == 1 - 6 \[Lambda]^2 + 10 \[Lambda]^4, -\[Lambda]^2 == x}, \[Lambda]]
Solve[%, f]

to eliminate a variable (lambda in your case) from multiple equations (2 in your case)...

POSTED BY: Sander Huisman
Posted 8 years ago
In[1]:= eq1 = 1 - 6 \[Lambda]^2 + 10 \[Lambda]^4

Out[1]= 1 - 6 \[Lambda]^2 + 10 \[Lambda]^4

In[2]:= eq1 /. Power[\[Lambda], n_] -> (-x)^(n /2)

Out[2]= 1 + 6 x + 10 x^2

In order to find out what expression Mathematica is using and which you have to replace you can use

FullForm[eq1]
POSTED BY: Michael Helmle
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract