MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

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)




  • 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