I want to simplify the following expression:
{1/Sqrt[2], 1/Sqrt[2]}
How can I get the factor 1/Sqrt[2] in front of the parenthesis like:
1/Sqrt[2] {1, 1}
??
I want to simplify the following expression:
{1/Sqrt[2], 1/Sqrt[2]}
How can I get the factor 1/Sqrt[2] in front of the parenthesis like:
1/Sqrt[2] {1, 1}
??
v = {1/Sqrt[2], 1/Sqrt[2]};
c = PolynomialGCD @@ v;
c*Defer @@ {v/c}
{1, 1}/Sqrt[2]
If you just want to view it you can try this.
Here is a mixed matrix with some parts that have Sqrt[2] in the denominator and some parts that do not.
matrix = {{1/Sqrt[2], 2/Sqrt[2]}, {3, Sqrt[2]}, {4, 3/Sqrt[2]},
{2./Sqrt[2], a/Sqrt[2]}};
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[2]
matrix2=Sqrt[2]*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[2] factored out.
In order to see it with the 1/Sqrt[2] outside try
HoldForm[1/Sqrt[2]] HoldForm[Evaluate[matrix2]]

Now you can get a temporary peek at the matrix with 1/Sqrt[2] moved to the outside.
Given the vector
v = {1/Sqrt[2], 4/Sqrt[2], (x + 3)/Sqrt[2]};
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}$$
1/Sqrt[2]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[2], Sqrt[3], 7, 5/2}? – Szabolcs Sep 05 '16 at 09:54Sqrt[2]here). Or even useMatrixPlot, which should help in quickly determining a symmetry visually (then verify manually). – Szabolcs Sep 05 '16 at 10:05