How to get a factor extracted from a list?

I want to simplify the following expression:

{1/Sqrt, 1/Sqrt}

How can I get the factor 1/Sqrt in front of the parenthesis like:

1/Sqrt {1, 1}

??

• It is not possible to put the expression into that form, as the multiplication would evaluate immediately. It may be possible to have 1/Sqrt and {1, 1} as separate results, but in that case it is very important to make it clear what factors should or shouldn't be extracted. What about {Sqrt, Sqrt, 7, 5/2}? – Szabolcs Sep 5 '16 at 9:54
• I get your argument. However, to rapidly grasp the symmetry of a matrix by eye (I'm talking of 3x3 or 4x4 matrix) one would reduce/simplify the matrix. I just wanted to enforce MMA to do that for me... Your example is of course totally asymmetric :D – Kay Sep 5 '16 at 10:03
• Maybe just multiply manually with the factor that seems relevant by visual inspection (Sqrt here). Or even use MatrixPlot, which should help in quickly determining a symmetry visually (then verify manually). – Szabolcs Sep 5 '16 at 10:05
• Possible duplicate: mathematica.stackexchange.com/questions/70131/… – Michael E2 Nov 5 '16 at 0:12

v = {1/Sqrt, 1/Sqrt};

c = PolynomialGCD @@ v;

c*Defer @@ {v/c}
{1, 1}/Sqrt

If you just want to view it you can try this.

Here is a mixed matrix with some parts that have Sqrt in the denominator and some parts that do not.

matrix = {{1/Sqrt, 2/Sqrt}, {3, Sqrt}, {4, 3/Sqrt},
{2./Sqrt, a/Sqrt}};

MatrixForm[matrix]

$$\left( \begin{array}{cc} \frac{1}{\sqrt{2}} & \sqrt{2} \\ 3 & \sqrt{2} \\ 4 & \frac{3}{\sqrt{2}} \\ 1.41421 & \frac{a}{\sqrt{2}} \\ \end{array} \right)$$

Now multiply it by the Sqrt

matrix2=Sqrt*matrix;

MatrixForm[matrix2]

$$\left( \begin{array}{cc} 1 & 2 \\ 3 \sqrt{2} & 2 \\ 4 \sqrt{2} & 3 \\ 2. & a \\ \end{array} \right)$$

matrix2 the simplified matrix with 1/Sqrt factored out.

In order to see it with the 1/Sqrt outside try

HoldForm[1/Sqrt] HoldForm[Evaluate[matrix2]] Now you can get a temporary peek at the matrix with 1/Sqrt moved to the outside.

Given the vector

v = {1/Sqrt, 4/Sqrt, (x + 3)/Sqrt};

The following code

c = PolynomialGCD @@ v;
Print[c, " ", (v/c) // MatrixForm];

Outputs what you want

$$\frac{1}{\sqrt{2}} \begin{pmatrix} 1\\ 4\\ 3 + x\\ \end{pmatrix}$$