login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for ExampleSolve2 revision 1 of 1

1
Editor: test1
Time: 2023/09/22 14:46:31 GMT+0
Note:

changed:
-
The following example appeared in Maxima mailing list (Maxima could
not do it).  Here we solve it using FriCAS.  First we form
system of equations:
\begin{axiom}
-- Form system of equations
eqn1 := a1*x1^5 + a2*x2^5 + a3*x3^5 = 1 / 6
eqn2 := a1*x1^4 + a2*x2^4 + a3*x3^4 = 1 / 5
eqn3 := a1*x1^3 + a2*x2^3 + a3*x3^3 = 1 / 4
eqn4 := a1*x1^2 + a2*x2^2 + a3*x3^2 = 1 / 3
eqn5 := a1*x1 + a2*x2 + a3*x3 = 1 / 2
eqn6 := a1 + a2 + a3 = 1
eqns := [eqn1, eqn2, eqn3, eqn4, eqn5, eqn6];
\end{axiom}

Now we solve it
\begin{axiom}
solve(eqns, [a1, a2, a3, x1, x2, x3])
\end{axiom}
The solution above is not fully explicit, in first solotion we need to solve
quadratic equation in 'x2' (so this solution really represents two solutions,
one for each solution to the quadratic equation).  Similarly, second and
third solution contain quadratic equation in 'x3'.  Usualy such form
of solution is convenient for further computations.  But one can also
get more explicit version of solution using 'radicalSolve':
\begin{axiom}
radicalSolve(eqns, [a1, a2, a3, x1, x2, x3])
\end{axiom}
Note: not all equations have solutions in radicals and FriCAS can find
solutions in radicals only in relatively simple cases.  But system
above has simple solution in radicals and FriCAS can find it.


The following example appeared in Maxima mailing list (Maxima could not do it). Here we solve it using FriCAS. First we form system of equations:

fricas
(1) -> -- Form system of equations
eqn1 := a1*x1^5 + a2*x2^5 + a3*x3^5 = 1 / 6

\label{eq1}{{a 3 \ {{x 3}^{5}}}+{a 2 \ {{x 2}^{5}}}+{a 1 \ {{x 1}^{5}}}}={\frac{1}{6}}(1)
Type: Equation(Polynomial(Fraction(Integer)))
fricas
eqn2 := a1*x1^4 + a2*x2^4 + a3*x3^4 = 1 / 5

\label{eq2}{{a 3 \ {{x 3}^{4}}}+{a 2 \ {{x 2}^{4}}}+{a 1 \ {{x 1}^{4}}}}={\frac{1}{5}}(2)
Type: Equation(Polynomial(Fraction(Integer)))
fricas
eqn3 := a1*x1^3 + a2*x2^3 + a3*x3^3 = 1 / 4

\label{eq3}{{a 3 \ {{x 3}^{3}}}+{a 2 \ {{x 2}^{3}}}+{a 1 \ {{x 1}^{3}}}}={\frac{1}{4}}(3)
Type: Equation(Polynomial(Fraction(Integer)))
fricas
eqn4 := a1*x1^2 + a2*x2^2 + a3*x3^2 = 1 / 3

\label{eq4}{{a 3 \ {{x 3}^{2}}}+{a 2 \ {{x 2}^{2}}}+{a 1 \ {{x 1}^{2}}}}={\frac{1}{3}}(4)
Type: Equation(Polynomial(Fraction(Integer)))
fricas
eqn5 := a1*x1 + a2*x2 + a3*x3 = 1 / 2

\label{eq5}{{a 3 \  x 3}+{a 2 \  x 2}+{a 1 \  x 1}}={\frac{1}{2}}(5)
Type: Equation(Polynomial(Fraction(Integer)))
fricas
eqn6 := a1 + a2 + a3 = 1

\label{eq6}{a 3 + a 2 + a 1}= 1(6)
Type: Equation(Polynomial(Integer))
fricas
eqns := [eqn1, eqn2, eqn3, eqn4, eqn5, eqn6];
Type: List(Equation(Polynomial(Fraction(Integer))))

Now we solve it

fricas
solve(eqns, [a1, a2, a3, x1, x2, x3])

\label{eq7}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
\left[{a 1 ={\frac{5}{18}}}, \:{a 2 ={\frac{5}{18}}}, \:{a 3 ={\frac{4}{9}}}, \:{x 1 ={- x 2 + 1}}, \: \right.
\
\
\displaystyle
\left.{{{{10}\ {{x 2}^{2}}}-{{10}\  x 2}+ 1}= 0}, \:{x 3 ={\frac{1}{2}}}\right] (7)
Type: List(List(Equation(Fraction(Polynomial(Integer)))))

The solution above is not fully explicit, in first solotion we need to solve quadratic equation in x2 (so this solution really represents two solutions, one for each solution to the quadratic equation). Similarly, second and third solution contain quadratic equation in x3. Usualy such form of solution is convenient for further computations. But one can also get more explicit version of solution using 'radicalSolve':

fricas
radicalSolve(eqns, [a1, a2, a3, x1, x2, x3])

\label{eq8}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
\left[{a 1 ={\frac{5}{18}}}, \:{a 2 ={\frac{5}{18}}}, \:{a 3 ={\frac{4}{9}}}, \: \right.
\
\
\displaystyle
\left.{x 1 ={\frac{-{\sqrt{15}}+ 5}{10}}}, \:{x 2 ={\frac{{\sqrt{1
5}}+ 5}{10}}}, \:{x 3 ={\frac{1}{2}}}\right] 
(8)
Type: List(List(Equation(Expression(Integer))))

Note: not all equations have solutions in radicals and FriCAS can find solutions in radicals only in relatively simple cases. But system above has simple solution in radicals and FriCAS can find it.