Group Abstract Group Abstract

Message Boards Message Boards

0
|
38 Views
|
4 Replies
|
1 Total Like
View groups...
Share
Share this post:

How to rationalize the denominator?

Posted 1 day ago

Sin[[Pi]/12] // Simplify

(-1 + Sqrt[3])/(2 Sqrt[2])

How to rationalize the denominator get the result as following:

(Sqrt[6] - Sqrt[2])/4
POSTED BY: Bill Blair
4 Replies

One aspect of Mathematica probably deserves some emphasis in light of this question:

Sqrt[2]/4 autosimplifies back to 1/(2 Sqrt[2]).

Powers with the same base are combined; square roots are combined. The following sequence is like swimming upstream:

(-1 + Sqrt[3])/(2 Sqrt[2]) $\rightarrow$ Sqrt[2](-1 + Sqrt[3])/4 $\rightarrow$ (-Sqrt[2] + Sqrt[6])/4

If you don't stop the flow of evaluation, the second expression is swept downstream to the first automatically. The third expression is stable, if you can get there.

Luckily, there is a factor -1 + Sqrt[3], which can be multiplied term-by-term by Sqrt[2] to prevent Sqrt[2] from recombining with 4 (provided there is a way to do that before Sqrt[2]/4 autosimplifies). If you did not have such a factor, then there would be no way to keep the denominator rationalized.

That hopefully gives an idea of what one is up against in rationalizing the denominator. Other forms of simplification can also run against the flow of the autosimplification built into Mathematica.

Note that using Simplify[] or FullSimplify[] may or may not succeed in producing the desired form in each case. They try to produce an equivalent expression with a minimal number of leaves in its expression-tree. That's a distinct goal from rationalizing.

If formatting output is the main goal — by which I mean that you are not going to use the output as further input, but you are going to use it only for people to see and to read — then there are more ways. For instance, HoldForm[] or boxes.

POSTED BY: Michael Rogers
Posted 1 day ago

Adding // Simplify to what you wrote gets for form that the OP desired.

POSTED BY: Jim Baldwin
Posted 1 day ago

Try Sin[\[Pi]/12] // FullSimplify which has a rational denominator but not the same form as you desired: $\frac{\sqrt{2-\sqrt{3}}}{2}$

POSTED BY: Jim Baldwin

Here is a way:

Sin[\[Pi]/12] // Apart // Together
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard