Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get Mathematica to actually *add* fractions?

214 views
Skip to first unread message

cdj

unread,
Apr 9, 2003, 1:55:17 AM4/9/03
to
Hi,

Like the subject says, but take for example:

(2/(3x)) + (6/x) + (x/(x + 3))

Sending to the kernel simply gives:

20/3x + x/(3+x)

What I wanted/hoped for was the common-denominator version:

(3x^2 + 20x + 60)/(3x(x+3))

Is there any way to get Mathematica to give the one-denominator
version of sums of fractions?

thanks,

cdj

Jens-Peer Kuska

unread,
Apr 9, 2003, 5:11:11 AM4/9/03
to
Hi,

?Together

Together[expr] puts terms in a sum over a common denominator, and
cancels \
factors in the result.

Regards
Jens

Dr Bob

unread,
Apr 9, 2003, 5:12:12 AM4/9/03
to
(2/(3x)) + (6/x) + (x/(x + 3)) // Together

(60 + 20*x + 3*x^2)/ (3*x*(3 + x))

Bobby

On Wed, 9 Apr 2003 01:33:41 -0400 (EDT), cdj <a_cj...@hotmail.com> wrote:

> Hi,
>
> Like the subject says, but take for example:
>
> (2/(3x)) + (6/x) + (x/(x + 3))
>
> Sending to the kernel simply gives:
>
> 20/3x + x/(3+x)
>
> What I wanted/hoped for was the common-denominator version:
>
> (3x^2 + 20x + 60)/(3x(x+3))
>
> Is there any way to get Mathematica to give the one-denominator
> version of sums of fractions?
>
> thanks,
>
> cdj
>
>

--
maj...@cox-internet.com
Bobby R. Treat


Y.A.Tesiram

unread,
Apr 9, 2003, 5:17:30 AM4/9/03
to
Hi,
Use Factor,

(2/(3x)) + (6/x) + (x/(x + 3)) // Factor

Yas

Kyriakos Chourdakis

unread,
Apr 9, 2003, 5:19:33 AM4/9/03
to
In[9]:=
Together[(20*x)/3 + x/(3 + x)]

Out[9]=
(63*x + 20*x^2)/(3*(3 + x))

K.

__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer

Adam Smith

unread,
Apr 10, 2003, 3:42:29 AM4/10/03
to
Use the command Together[]

thing = (2/(3x)) + (6/x) + (x/(x + 3))

Out[1]=
20/(3*x) + x/(3 + x)

In[2]:=
Together[thing]

Out[2]=
(60 + 20*x + 3*x^2)/(3*x*(3 + x))

Together can be a powerful tool when trying to obtain a specific form
of the result. Just be aware that it is sometimes very time consuming
(if not nearly impossible) to get Mathematica to return a final form
that exactly matches some desired form (say that is quoted in a text).

Adam Smith

a_cj...@hotmail.com (cdj) wrote in message news:<b70ck5$8al$1...@smc.vnet.net>...

cdj

unread,
Apr 10, 2003, 3:53:06 AM4/10/03
to
Kyriakos Chourdakis <tuxed...@yahoo.com> wrote in message news:<b70oj6$9lh$1...@smc.vnet.net>...

> In[9]:=
> Together[(20*x)/3 + x/(3 + x)]

Perfect - thanks a bunch everyone!

cdj

David Park

unread,
Apr 10, 2003, 3:57:23 AM4/10/03
to
Use Together.

German Buitrago A.

unread,
Apr 11, 2003, 2:24:38 AM4/11/03
to
In[1]:=
2/(3*x) + 6/x + x/(x + 3)

Out[1]=
20/(3*x) + x/(3 + x)

In[2]:=
Together[2/(3*x) + 6/x +
x/(x + 3)]

Out[2]=
(60 + 20*x + 3*x^2)/
(3*x*(3 + x))

Germán Buitrago A.
Manizales, Colombia

0 new messages