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


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

Re: Grouping terms under the radical

From David Bailey <dave@removedbailey.co.uk>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Grouping terms under the radical
Date 2011-07-08 08:56 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <iv6gnt$s52$1@smc.vnet.net> (permalink)
References <iv46bq$fbl$1@smc.vnet.net>

Show all headers | View raw


On 07/07/2011 12:47, paulvonhippel at yahoo wrote:
> This must be a classic question. When I input
>   Sqrt[(2 n)]
> Mathematica displays the output as Sqrt[2] Sqrt[n] -- i.e., both 2 and
> n are under their own radical. The display of output doesn't change if
> I impose the assumption that n>  0.
>
> This is fine from a mathematical point of view, but it looks
> unconventional when pasted into a paper. It seems to me most authors
> would keep the 2 and the n under a common radical -- how can I get
> Mathematica to do the same?
>
> Thanks!
>
>
These issues are a bit tricky, because there are certain algebraic 
operations that happen automatically inside Mathematica - so any attempt 
to rearrange an expression is instantly undone. One answer is to apply a 
transformation rule to alter your expression using HoldForm to block the 
reverse transformation:

Sqrt[2 n] /. (a_^n_) (b_^ n_) -> HoldForm[a b]^n

This works well, but with two caveats:

1)    The output can't be used in a further calculation unless the 
HoldForm is removed.

2)    Some kinds of pasting operations seem to paste with the HoldForm 
made explicit again, as I just discovered by trying to paste the result 
into this email! However, you can certainly convert the expression into 
an image, and paste that - which is probably what you would need to do 
anyway to keep the expression structure.

Variants of the above construction can be used to improve the appearance 
of many expressions, for example, humans tend to prefer 1/Sin[a] to 
Csc[a], which Mathematica 'prefers'.

David Bailey
http://www.dbaileyconsultancy.co.uk

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


Thread

Grouping terms under the radical paulvonhippel at yahoo <paulvonhippel@yahoo.com> - 2011-07-07 11:47 +0000
  Re: Grouping terms under the radical David Bailey <dave@removedbailey.co.uk> - 2011-07-08 08:56 +0000

csiph-web