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[1]:= expr=(x^2 Cos[x] (Sin[2x]+Tan[x]))/(E^x*x*Csc[x]^2) Out[1]= E^-x x Cos[x] Sin[x]^2 (Sin[2 x]+Tan[x]) In[2]:= expr//FullForm Out[2]//FullForm= Times[Power[E,Times[-1,x]],x,Cos[x],Power[Sin[x],2],Plus[Sin[Times[2,x]],Tan[x]]] In[3]:= List@@expr Out[3]= {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)

**References**:**Extract a part of expression***From:*Miguel Gil <misvrne@gmail.com>