Replacement rule for a quotient

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

  1. 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 ?

    Many thanks in advance,

    cheers,
    Nicolas
     
    Nicolas Girard, Sep 15, 2005
    #1
    1. Advertisements

  2. 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 ?
    |
    | Many thanks in advance,
    |
    | cheers,
    | Nicolas
    |
     
    Jens-Peer Kuska, Sep 16, 2005
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.