0
$\begingroup$

When I evaluate

Collect[(a ((G m ω)/c^3)^(1/2) + b ((G m ω)/c^3)^(1/2)), c]

I get this:

a Sqrt[(G m ω)/c^3] + b Sqrt[(G m ω)/c^3]

Here is a snapshot of the output.

The actual unwanted output

So, both c-terms are not being collected together. I have c in two different terms in the expanded form.

I expected the following:

expected output

How can I get the form I want?

$\endgroup$
7
  • 2
    $\begingroup$ What is your expected output? $\endgroup$ Commented Dec 6, 2014 at 18:01
  • $\begingroup$ I believe that Collect does exactly what it is intended to do here. $\endgroup$ Commented Dec 6, 2014 at 20:35
  • $\begingroup$ I have edited my question. Please see if it can be put off hold. $\endgroup$ Commented Dec 7, 2014 at 9:04
  • $\begingroup$ I don't get it. You ask Mathematica to collect powers of a and that is precisely what it does. There is one zeroth order term and a first order term in a. Why you expect it to work on c is an enigma to me. $\endgroup$ Commented Dec 7, 2014 at 15:21
  • $\begingroup$ @SjoerdC.deVries , hey, yeah, the question got wrong. It should be 'c' there - ' b ((G m ω)/c^3)^(1/2)), c]'. But even with 'c', it doesn't collect c at a single place. But the method suggested by Karsten 7. works. $\endgroup$ Commented Dec 8, 2014 at 8:42

2 Answers 2

4
$\begingroup$

Try this:

    expr = (a ((G m \[Omega])/c^3)^(1/2) + b ((G m \[Omega])/c^3)^(1/2));

Simplify[expr, {G > 0, c > 0, m > 0, \[Omega] > 0}]

(*   (a + b) Sqrt[(G m \[Omega])/c^3]   *)

Have fun!

$\endgroup$
3
$\begingroup$

You can get the desired output using

PowerExpand[(a ((G m ω)/c^3)^(1/2) + b ((G m ω)/c^3)^(1/2)), c] // Together

$\frac{a \sqrt{G m \omega }+b \sqrt{G m \omega }}{c^{3/2}}$

as

PowerExpand[(a ((G m ω)/c^3)^(1/2) + b ((G m ω)/c^3)^(1/2)), c]

$\frac{a \sqrt{G m \omega }}{c^{3/2}}+\frac{b \sqrt{G m \omega }}{c^{3/2}}$
gets c out of the square roots and Together converts the sum into a single rational function.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.