# Replacement rule for a quotient

Discussion in 'Mathematica' started by Nicolas Girard, Sep 15, 2005.

1. ### Nicolas GirardGuest

Hi all,
I'm afraid I couldn't find how to write the replacement rule that would
transform, for instance

a^2.c^3.d.e a
----------- + -
b^2.f^3.g b

into

c^3.d.e
q^2.-------- + q
f^3.g

where . is the standard Times[] and ^ is the standard Power[].

Could you please give me a hand for this ?

cheers,
Nicolas

Nicolas Girard, Sep 15, 2005

2. ### Jens-Peer KuskaGuest

Hi,

a^2*c^3*d*e/(b^2*f^3*g) + a/b /. a -> q*b

a^2*c^3*d*e/(b^2*f^3*g) + a/b /. b -> a/q

a^2*c^3*d*e/(b^2*f^3*g) + a/b /. a^n_.*c_.*b^m_.
/; n + m == 0 :> q*c

Regards
Jens

"Nicolas Girard" <>
schrieb im Newsbeitrag
| Hi all,
| I'm afraid I couldn't find how to write the
replacement rule that would
| transform, for instance
|
|
| a^2.c^3.d.e a
| ----------- + -
| b^2.f^3.g b
|
| into
|
| c^3.d.e
| q^2.-------- + q
| f^3.g
|
|
| where . is the standard Times[] and ^ is the
standard Power[].
|
| Could you please give me a hand for this ?
|