Notebook[]
Prime # problem:
In[]:=
PrimeQ[143]
Out[]=
False
FactorInteger@143
Out[]=
{{11,1},{13,1}}
In[]:=
fs=Factor[y^3-y-336]
Out[]=
(-7+y)(48+7y+
2
y
)
In[]:=
soly=y/.Solve[fs[[2]]==0]
Out[]=

1
2
(-7-
143
),
1
2
(-7+
143
)
In[]:=
Simplify[soly-3]
Out[]=
-
1
2
(-13+
143
),
1
2
(13+
143
)
Yields a rather awkward solution, in that it requires multiplying through by .
In[]:=
x/.soly
Out[]=
{x,x}
In[]:=
Solve[soly==0,x]
Out[]=
{}
Problem, solve eqn. with cube roots.
In[]:=
sols=x/.Solve[x^1/3-2==12/x^1/3,x]
Out[]=
3-
21
,3+
21

In[]:=
Simplify@%
Out[]=
-
1/3
(-1-
13
)
,
1/3
(1-
13
)
,-
1/3
(-1+
13
)
,-
2/3
(-1)
1/3
(-1+
13
)
,
1/3
(1+
13
)
,
2/3
(-1)
1/3
(1+
13
)

In[]:=
rules=Solve[x^(1/3)-2==12./x^(1/3),x]
Out[]=
{{x97.6888}}
In[]:=
(x^(1/3)-2-12/x^(1/3))/.rules[[1]]​​Simplify@%
Out[]=
-8.88178×
-16
10
Out[]=
-8.88178×
-16
10
In[]:=
Simplify%
Out[]=
Simplify-2-
6
1/3
(5+2
13
)
+2
1/3
(5+2
13
)
0
In[]:=
Evaluate-2.-
6
1/3
5+2
13

+2
1/3
5+2
13


Out[]=
0.
Switch rows in a matrix.
In[]:=
​​X={{a1,a2,a3},{a4,a5,a6},{a7,a8,a9}}​​X//MatrixForm
Out[]=
{{a1,a2,a3},{a4,a5,a6},{a7,a8,a9}}
Out[]//MatrixForm=
a1
a2
a3
a4
a5
a6
a7
a8
a9
In[]:=
{{2,4,6},{2,2,2},{5,4,3}}.X//MatrixForm
Out[]//MatrixForm=
2a1+4a4+6a7
2a2+4a5+6a8
2a3+4a6+6a9
2a1+2a4+2a7
2a2+2a5+2a8
2a3+2a6+2a9
5a1+4a4+3a7
5a2+4a5+3a8
5a3+4a6+3a9
No. Solve didn’t work (work not shown}) Try Linear Solve.
In[]:=
LinearSolve[{{2,4,6},{2,2,2},{5,4,3}},{{2,2,2},{2,4,6},{5,4,3}}]
LinearSolve
:Linear equation encountered that has no solution.
Out[]=
LinearSolve[{{2,4,6},{2,2,2},{5,4,3}},{{2,2,2},{2,4,6},{5,4,3}}]
In[]:=
{{2,4,6},{2,2,2},{5,4,3}}//MatrixForm
Out[]//MatrixForm=
2
4
6
2
2
2
5
4
3
In[]:=
X//MatrixForm
Out[]//MatrixForm=
a1
a2
a3
a4
a5
a6
a7
a8
a9
In[]:=
m={{2,4,7},{2,2,2},{5,4,3}}​​b={{2,2,2},{2,4,7},{5,4,3}}​​x=LinearSolve[m,b]
Out[]=
{{2,4,7},{2,2,2},{5,4,3}}
Out[]=
{{2,2,2},{2,4,7},{5,4,3}}
Out[]=
{1,-18,-45},0,34,
165
2
,{0,-14,-34}
In[]:=
Det[m]​​Det[b]
Out[]=
-2
Out[]=
2
In[]:=
Evaluate[m.x]​​b
Out[]=
{{2,2,2},{2,4,7},{5,4,3}}
Out[]=
{{2,2,2},{2,4,7},{5,4,3}}
In[]:=
Print["Answer = x = ",x]
Answer = x = {1,-18,-45},0,34,
165
2
,{0,-14,-34}
〉
​