Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7947 > unrolled thread

Re: Extract a part of expression

Started byBob Hanlon <hanlonr357@gmail.com>
First post2012-01-17 11:01 +0000
Last post2012-01-17 11:01 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Extract a part of expression Bob Hanlon <hanlonr357@gmail.com> - 2012-01-17 11:01 +0000

#7947 — Re: Extract a part of expression

FromBob Hanlon <hanlonr357@gmail.com>
Date2012-01-17 11:01 +0000
SubjectRe: Extract a part of expression
Message-ID<jf3kf0$qa5$1@smc.vnet.net>
expr = HoldForm[(x^2 Cos[x] (Sin[2 x] Tan[x]))/(E^x*x*Csc[x]^2)];

expr /. x_/y_ -> x // ReleaseHold

x^2*Sin[x]*Sin[2*x]

expr /. x_/y_ -> y // ReleaseHold

E^x*x*Csc[x]^2


Bob Hanlon

On Mon, Jan 16, 2012 at 5:07 PM, Miguel Gil <misvrne@gmail.com> wrote:
> How I can extract the full numerator (or denominator) of an expression of the form g (x) / w (x)?.
> I tried to do with Numerator [expr], but returns a wrong result. I tried with the attribute HoldForm [expr] and can not get the correct result.
>
> For example:
>  expr = (x ^ 2 Cos [x] (Sin [2x], Tan [x ]))/( E ^ x * x * Csc [x] ^ 2)
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web