Re: find argument of function inside long result?
- To: mathgroup at smc.vnet.net
- Subject: [mg31320] Re: find argument of function inside long result?
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Sun, 28 Oct 2001 03:07:00 -0500 (EST)
- References: <9rdgub$7q5$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Jose,
expr = Sqrt[A[Sqrt[ a + Sqrt[b]][C[Sqrt[c + Sqrt[c]]]]]];
Cases[expr, Sqrt[arg_]-> arg, {0,Infinity}, Heads->True]
{b, a + Sqrt[b], c, Sqrt[c] + c,
A[Sqrt[a + Sqrt[b]][C[Sqrt[Sqrt[c] + c]]]]}
- {0,Infinity} causes the search to be through all "levels" of expression
- Heads->True causes the seach to include "heads" of expressions; for
example, without it we would not get b, a + Sqrt[b],.
--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
"jose flanigan" <jflanigan at netzero.net> wrote in message
news:9rdgub$7q5$1 at smc.vnet.net...
> I have a very long symbolic result that has several sqrt functions. I
> would like to extract the arguments of each of the sqrt's.
>
> How can I do this? The expression is too complicated to try and read it
off.
>
> thanks.
>