6
$\begingroup$

I have two expressions:

expr = (a - R)^2 (a + 2 R)/(2 R^3);
factor = 1 - a^2/R^2;

I would like to write expr in terms of factor -- is there a function in Mathematica to help with this?

$\endgroup$
0

2 Answers 2

5
$\begingroup$

Rewrite your definitions as equations (i.e. using ==), then use Solve to solve for expr specifying that the R and a variables should be eliminated:

Clear[expr, factor]

Solve[
  {expr == (a - R)^2 (a + 2 R)/(2 R^3), factor == 1 - a^2/R^2},
  expr,
  {R, a}
]

Mathematica graphics

$\endgroup$
4
$\begingroup$

Using Eliminate

Eliminate[{expr == e, factor == f}, {a, R}]
3 f^2 + f^3 == (8 - 4 e) e
$\endgroup$
1
  • 3
    $\begingroup$ Alternatively: GroebnerBasis[{expr == (a - R)^2 (a + 2 R)/(2 R^3), factor == 1 - a^2/R^2}, {expr, factor}, {a, R}]. $\endgroup$ Feb 25, 2016 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.