Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Grouping terms under the radical

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120089] Re: Grouping terms under the radical
  • From: David Bailey <dave at removedbailey.co.uk>
  • Date: Fri, 8 Jul 2011 04:51:44 -0400 (EDT)
  • References: <iv46bq$fbl$1@smc.vnet.net>

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


  • Prev by Date: Re: Unwanted Recursion
  • Next by Date: Re: How to NSolve equation which involves NIntegrate?
  • Previous by thread: Re: Grouping terms under the radical
  • Next by thread: Re: Grouping terms under the radical