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


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

Re: Separating square roots

From Murray Eisenberg <murray@math.umass.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Separating square roots
Date 2012-07-11 06:24 +0000
Message-ID <jtj669$5p0$1@smc.vnet.net> (permalink)
References <20120710044231.0F717683F@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


Here's a way, which is probably unnecessarily verbose.

   a = 3 + 5 x^2 + 7 x + Sqrt[5 + x] + 7 x Sqrt[5 + x];
   terms = List @@ a;
   Plus @@ Pick[terms, FreeQ[#, Sqrt[_]] & /@ terms]

On 7/10/12 12:42 AM, rhartley.anu@gmail.com wrote:
> I have an expression which is a sum of terms, some monomials
> and others involving square roots, such as
> A = 3  + 5 x^2 + 7 x + Sqrt[5+x] + 7 x Sqrt[5+x] (but much more complicated).
> I want to solve this, which involves separating terms with the square root
> from those that do not have a square root, then squaring each.
>
> I can not work out how to separate out those terms that have the square
> root.  I do not want to hard code, such as nosqrt = A[[1]] + A[[2]] , etc.
> Can anyone help?


-- 
Murray Eisenberg                     murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

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


Thread

Re: Separating square roots Murray Eisenberg <murray@math.umass.edu> - 2012-07-11 06:24 +0000

csiph-web