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


Groups > comp.soft-sys.math.mathematica > #7902

Re: Extract a part of expression

From "Scot T. Martin" <smartin@seas.harvard.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Extract a part of expression
Date 2012-01-17 08:32 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jf3bmc$na2$1@smc.vnet.net> (permalink)
References <201201162207.RAA15301@smc.vnet.net>

Show all headers | View raw


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@gmail.com]
Sent: Monday, January 16, 2012 17:07
Subject: 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)

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Extract a part of expression "Scot T. Martin" <smartin@seas.harvard.edu> - 2012-01-17 08:32 +0000

csiph-web