       Re: Extract a part of expression

• To: mathgroup at smc.vnet.net
• Subject: [mg124322] Re: Extract a part of expression
• From: "Scot T. Martin" <smartin at seas.harvard.edu>
• Date: Tue, 17 Jan 2012 03:20:40 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <201201162207.RAA15301@smc.vnet.net>

```Miguel, your question is not very well posed (e.g,. your original expressed of (Sin[2x],Tan[x]) gives a syntax error), but commands below should nevertheless give you some hints so that you can figure out the answer once you pose the question:

In:= expr=(x^2 Cos[x] (Sin[2x]+Tan[x]))/(E^x*x*Csc[x]^2)

Out= E^-x x Cos[x] Sin[x]^2 (Sin[2 x]+Tan[x])

In:= expr//FullForm

Out//FullForm= Times[Power[E,Times[-1,x]],x,Cos[x],Power[Sin[x],2],Plus[Sin[Times[2,x]],Tan[x]]]

In:= List@@expr

Out= {E^-x,x,Cos[x],Sin[x]^2,Sin[2 x]+Tan[x]}

________________________________________
From: Miguel Gil [misvrne at gmail.com]
Sent: Monday, January 16, 2012 17:07
To: mathgroup at smc.vnet.net
Subject: [mg124322] Extract a part of expression

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)

```

• Prev by Date: Re: plotting histograms with do loop
• Next by Date: Re: How to remove the Null character in a Table?
• Previous by thread: Re: Extract a part of expression
• Next by thread: Re: Extract a part of expression