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


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

Re: Extract a part of expression

Started by"Scot T. Martin" <smartin@seas.harvard.edu>
First post2012-01-17 08:32 +0000
Last post2012-01-17 08:32 +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 "Scot T. Martin" <smartin@seas.harvard.edu> - 2012-01-17 08:32 +0000

#7902 — Re: Extract a part of expression

From"Scot T. Martin" <smartin@seas.harvard.edu>
Date2012-01-17 08:32 +0000
SubjectRe: Extract a part of expression
Message-ID<jf3bmc$na2$1@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@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)

[toc] | [standalone]


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


csiph-web