# Formula replace

**URL:** <https://community.wolfram.com/t/formula-replace/7143>\
**Category:** Questions\
**Tags:** mathematica, algebra\
**Created:** [November 7, 2015, 5:44am UTC](https://community.wolfram.com/t/formula-replace/7143 "2015-11-07T05:44:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![astroyan045](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@astroyan045](https://community.wolfram.com/u/astroyan045)\
**Post date:** [November 7, 2015, 5:44am UTC](https://community.wolfram.com/t/formula-replace/7143/1 "2015-11-07T05:44:16Z")

</div>

Hi! Here I have a question.

Given a = b / c, S = ( ( b/c ) + 1 ) / ( b\*( 1 - 1/c ) ).

Does anyone know how to convert ( ( b/c ) + 1 ) / ( b\*( 1 - 1/c ) ) to ( a+1 ) / ( b-a ) with Mathematica?

Thanks!

---

<div class="post-metadata">

**Author:** ![nma](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@nma](https://community.wolfram.com/u/nma)\
**Post date:** [November 7, 2015, 6:06am UTC](https://community.wolfram.com/t/formula-replace/7143/2 "2015-11-07T06:06:27Z")

</div>

I do not know now an easier way other that direct replacement and to expand the denominator. See FullForm of `S0` to see the need rules.

```
Clear[a, b, c, S0]
S0 = ((b/c) + 1)/(b*(1 - 1/c))
rule = (b/c) -> a;
(Numerator[S0] /. rule)/(Expand@Denominator[S0] /. rule)

```

![8605Untitled.png](https://global.discourse-cdn.com/wolfram/original/3X/5/2/52ef90ca9cc49f55b5f3a83557002d97e75e3dca.png)

---

<div class="post-metadata">

**Author:** ![astroyan045](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@astroyan045](https://community.wolfram.com/u/astroyan045)\
**Post date:** [November 7, 2015, 8:40am UTC](https://community.wolfram.com/t/formula-replace/7143/3 "2015-11-07T08:40:13Z")

</div>

Complicated but good! Thank you!

---

<div class="post-metadata">

**Author:** ![sghuisman](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sghuisman/32/27850_2.png) [@sghuisman](https://community.wolfram.com/u/sghuisman)\
**Post date:** [November 7, 2015, 10:39am UTC](https://community.wolfram.com/t/formula-replace/7143/4 "2015-11-07T10:39:43Z")

</div>

A good way of eliminating c, is by using the command `Eliminate`, or by using it simply like this:

```
Solve[a==b/c,c]
((b/c)+1)/(b*(1-1/c)) /. %
Simplify[%]

```
