2 * Functions and Variables for Equations::
5 @c -----------------------------------------------------------------------------
6 @node Functions and Variables for Equations, , Equations, Equations
7 @section Functions and Variables for Equations
8 @c -----------------------------------------------------------------------------
11 @defvr {System variable} %rnum
12 Default value: @code{0}
14 @code{%rnum} is the counter for the @code{%r} variables introduced in solutions by
15 @mref{solve} and @mrefdot{algsys}. The next @code{%r} variable is numbered
18 See also @mref{%rnum_list}.
20 @opencatbox{Categories:}
21 @category{Algebraic equations}
25 @c -----------------------------------------------------------------------------
27 @defvr {System variable} %rnum_list
28 Default value: @code{[]}
30 @code{%rnum_list} is the list of variables introduced in solutions by
31 @mref{solve} and @mrefdot{algsys} @code{%r} variables are added to
32 @code{%rnum_list} in the order they are created. This is convenient for doing
33 substitutions into the solution later on.
35 See also @mref{%rnum}.
37 @c WHAT DOES THIS STATEMENT MEAN ??
38 It's recommended to use this list rather than doing @code{concat ('%r, j)}.
41 @c solve ([x + y = 3], [x,y]);
43 @c sol : solve ([x + 2*y + 3*z = 4], [x,y,z]);
45 @c for i : 1 thru length (%rnum_list) do
46 @c sol : subst (t[i], %rnum_list[i], sol)$
51 (%i1) solve ([x + y = 3], [x,y]);
52 (%o1) [[x = 3 - %r1, y = %r1]]
59 (%i3) sol : solve ([x + 2*y + 3*z = 4], [x,y,z]);
60 (%o3) [[x = - 2 %r3 - 3 %r2 + 4, y = %r3, z = %r2]]
67 (%i5) for i : 1 thru length (%rnum_list) do
68 sol : subst (t[i], %rnum_list[i], sol)$
72 (%o6) [[x = - 2 t - 3 t + 4, y = t , z = t ]]
77 @opencatbox{Categories:}
78 @category{Algebraic equations}
82 @c -----------------------------------------------------------------------------
84 @defvr {Option variable} algepsilon
87 @c WHAT IS algepsilon, EXACTLY ??? describe ("algsys") IS NOT VERY INFORMATIVE !!!
88 @code{algepsilon} is used by @mrefdot{algsys}
90 @opencatbox{Categories:}
91 @category{Algebraic equations}
95 @c -----------------------------------------------------------------------------
97 @defvr {Option variable} algexact
98 Default value: @code{false}
100 @code{algexact} affects the behavior of @mref{algsys} as follows:
102 If @code{algexact} is @code{true}, @code{algsys} always calls @mref{solve} and
103 then uses @mref{realroots} on @code{solve}'s failures.
105 If @code{algexact} is @code{false}, @code{solve} is called only if the
106 eliminant was not univariate, or if it was a quadratic or biquadratic.
108 Thus @code{algexact: true} does not guarantee only exact solutions, just that
109 @code{algsys} will first try as hard as it can to give exact solutions, and
110 only yield approximations when all else fails.
112 @c ABOVE DESCRIPTION NOT TOO CLEAR -- MAYBE EXAMPLES WILL HELP
114 @opencatbox{Categories:}
115 @category{Algebraic equations}
119 @c -----------------------------------------------------------------------------
121 @deffn {Function} algsys @
122 @fname{algsys} ([@var{expr_1}, @dots{}, @var{expr_m}], [@var{x_1}, @dots{}, @var{x_n}]) @
123 @fname{algsys} ([@var{eqn_1}, @dots{}, @var{eqn_m}], [@var{x_1}, @dots{}, @var{x_n}])
125 Solves the simultaneous polynomials @var{expr_1}, @dots{}, @var{expr_m} or
126 polynomial equations @var{eqn_1}, @dots{}, @var{eqn_m} for the variables
127 @var{x_1}, @dots{}, @var{x_n}. An expression @var{expr} is equivalent to an
128 equation @code{@var{expr} = 0}. There may be more equations than variables or
131 @code{algsys} returns a list of solutions, with each solution given as a list
132 of equations stating values of the variables @var{x_1}, @dots{}, @var{x_n}
133 which satisfy the system of equations. If @code{algsys} cannot find a solution,
134 an empty list @code{[]} is returned.
136 The symbols @code{%r1}, @code{%r2}, @dots{}, are introduced as needed to
137 represent arbitrary parameters in the solution; these variables are also
138 appended to the list @mrefdot{%rnum_list}
140 The method is as follows:
144 First the equations are factored and split into subsystems.
147 For each subsystem @var{S_i}, an equation @var{E} and a variable @var{x} are
148 selected. The variable is chosen to have lowest nonzero degree. Then the
149 resultant of @var{E} and @var{E_j} with respect to @var{x} is computed for each
150 of the remaining equations @var{E_j} in the subsystem @var{S_i}. This yields a
151 new subsystem @var{S_i'} in one fewer variables, as @var{x} has been eliminated.
152 The process now returns to (1).
155 Eventually, a subsystem consisting of a single equation is obtained. If the
156 equation is multivariate and no approximations in the form of floating point
157 numbers have been introduced, then @mref{solve} is called to find an exact
160 In some cases, @code{solve} is not be able to find a solution, or if it does
161 the solution may be a very large expression.
163 @c REMAINDER OF (3) IS PRETTY COMPLEX. HOW CAN IT BE CLARIFIED ??
164 If the equation is univariate and is either linear, quadratic, or biquadratic,
165 then again @code{solve} is called if no approximations have been introduced.
166 If approximations have been introduced or the equation is not univariate and
167 neither linear, quadratic, or biquadratic, then if the switch
168 @mref{realonly} is @code{true}, the function @mref{realroots} is called to find
169 the real-valued solutions. If @code{realonly} is @code{false}, then
170 @mref{allroots} is called which looks for real and complex-valued solutions.
172 If @code{algsys} produces a solution which has fewer significant digits than
173 required, the user can change the value of @mref{algepsilon} to a higher value.
175 If @code{algexact} is set to @code{true}, @code{solve} will always be called.
176 @c algepsilon IS IN Floating.texi -- MAY WANT TO BRING IT INTO THIS FILE
179 Finally, the solutions obtained in step (3) are substituted into
180 previous levels and the solution process returns to (1).
181 @c "PREVIOUS LEVELS" -- WHAT ARE THOSE ??
184 When @code{algsys} encounters a multivariate equation which contains floating
185 point approximations (usually due to its failing to find exact solutions at an
186 earlier stage), then it does not attempt to apply exact methods to such
187 equations and instead prints the message:
188 "@code{algsys} cannot solve - system too complicated."
190 Interactions with @mref{radcan} can produce large or complicated expressions.
191 In that case, it may be possible to isolate parts of the result with
192 @mref{pickapart} or @mrefdot{reveal}
194 Occasionally, @code{radcan} may introduce an imaginary unit @code{%i} into a
195 solution which is actually real-valued.
200 @c e1: 2*x*(1 - a1) - 2*(x - 1)*a2;
202 @c e3: a1*(-y - x^2 + 1);
203 @c e4: a2*(y - (x - 1)^2);
204 @c algsys ([e1, e2, e3, e4], [x, y, a1, a2]);
206 @c e2: -1 - y + 2*y^2 - x + x^2;
207 @c algsys ([e1, e2], [x, y]);
210 (%i1) e1: 2*x*(1 - a1) - 2*(x - 1)*a2;
211 (%o1) 2 (1 - a1) x - 2 a2 (x - 1)
214 (%i3) e3: a1*(-y - x^2 + 1);
216 (%o3) a1 (- y - x + 1)
217 (%i4) e4: a2*(y - (x - 1)^2);
219 (%o4) a2 (y - (x - 1) )
220 (%i5) algsys ([e1, e2, e3, e4], [x, y, a1, a2]);
221 (%o5) [[x = 0, y = %r1, a1 = 0, a2 = 0],
223 [x = 1, y = 0, a1 = 1, a2 = 1]]
227 (%i7) e2: -1 - y + 2*y^2 - x + x^2;
229 (%o7) 2 y - y + x - x - 1
230 (%i8) algsys ([e1, e2], [x, y]);
232 (%o8) [[x = - -------, y = -------],
236 [x = -------, y = - -------], [x = - -, y = - -], [x = 1, y = 1]]
240 @opencatbox{Categories:}
241 @category{Algebraic equations}
245 @c -----------------------------------------------------------------------------
247 @deffn {Function} allroots @
248 @fname{allroots} (@var{expr}) @
249 @fname{allroots} (@var{eqn})
251 Computes numerical approximations of the real and complex roots of the
252 polynomial @var{expr} or polynomial equation @var{eqn} of one variable.
254 The flag @mref{polyfactor} when @code{true} causes @code{allroots} to factor
255 the polynomial over the real numbers if the polynomial is real, or over the
256 complex numbers, if the polynomial is complex.
258 @code{allroots} may give inaccurate results in case of multiple roots.
259 If the polynomial is real, @code{allroots (%i*@var{p})} may yield
260 more accurate approximations than @code{allroots (@var{p})}, as @code{allroots}
261 invokes a different algorithm in that case.
263 @code{allroots} rejects non-polynomials. It requires that the numerator
264 after @code{rat}'ing should be a polynomial, and it requires that the
265 denominator be at most a complex number. As a result of this @code{allroots}
266 will always return an equivalent (but factored) expression, if
267 @code{polyfactor} is @code{true}.
269 For complex polynomials an algorithm by Jenkins and Traub is used
270 (Algorithm 419, @i{Comm. ACM}, vol. 15, (1972), p. 97). For real polynomials
271 the algorithm used is due to Jenkins (Algorithm 493, @i{ACM TOMS}, vol. 1,
277 @c eqn: (1 + 2*x)^3 = 13.5*(1 + x^5);
278 @c soln: allroots (eqn);
280 @c do (e2: subst (e, eqn), disp (expand (lhs(e2) - rhs(e2))));
285 (%i1) eqn: (1 + 2*x)^3 = 13.5*(1 + x^5);
287 (%o1) (2 x + 1) = 13.5 (x + 1)
288 (%i2) soln: allroots (eqn);
289 (%o2) [x = .8296749902129361, x = - 1.015755543828121,
291 x = .9659625152196369 %i - .4069597231924075,
293 x = - .9659625152196369 %i - .4069597231924075, x = 1.0]
295 do (e2: subst (e, eqn), disp (expand (lhs(e2) - rhs(e2))));
296 - 3.5527136788005E-15
298 - 5.32907051820075E-15
300 4.44089209850063E-15 %i - 4.88498130835069E-15
302 - 4.44089209850063E-15 %i - 4.88498130835069E-15
307 (%i4) polyfactor: true$
308 (%i5) allroots (eqn);
309 (%o5) - 13.5 (x - 1.0) (x - .8296749902129361)
312 (x + 1.015755543828121) (x + .8139194463848151 x
317 @opencatbox{Categories:}
318 @category{Polynomials}
319 @category{Numerical methods}
323 @c -----------------------------------------------------------------------------
325 @deffn {Function} bfallroots @
326 @fname{bfallroots} (@var{expr}) @
327 @fname{bfallroots} (@var{eqn})
329 Computes numerical approximations of the real and complex roots of the
330 polynomial @var{expr} or polynomial equation @var{eqn} of one variable.
332 In all respects, @code{bfallroots} is identical to @code{allroots} except
333 that @code{bfallroots} computes the roots using bigfloats. See
334 @mref{allroots} for more information.
336 @opencatbox{Categories:}
337 @category{Polynomials}
338 @category{Numerical methods}
342 @c -----------------------------------------------------------------------------
344 @defvr {Option variable} backsubst
345 Default value: @code{true}
347 @c WHAT IS THE CONTEXT HERE ?? (TO WHICH OTHER FUNCTION DOES THIS APPLY ??)
348 @c --- According to the documentation, to linsolve
349 When @code{backsubst} is @code{false}, prevents back substitution in
350 @mref{linsolve} after the equations have been triangularized. This may
351 be helpful in very big problems where back substitution would cause
352 the generation of extremely large expressions.
355 @c eq1 : x + y + z = 6$
356 @c eq2 : x - y + z = 2$
357 @c eq3 : x + y - z = 0$
358 @c backsubst : false$
359 @c linsolve ([eq1, eq2, eq3], [x,y,z]);
361 @c linsolve ([eq1, eq2, eq3], [x,y,z]);
364 (%i1) eq1 : x + y + z = 6$
365 (%i2) eq2 : x - y + z = 2$
366 (%i3) eq3 : x + y - z = 0$
367 (%i4) backsubst : false$
369 (%i5) linsolve ([eq1, eq2, eq3], [x,y,z]);
370 (%o5) [x = z - y, y = 2, z = 3]
372 (%i6) backsubst : true$
374 (%i7) linsolve ([eq1, eq2, eq3], [x,y,z]);
375 (%o7) [x = 1, y = 2, z = 3]
379 @opencatbox{Categories:}
380 @category{Algebraic equations}
384 @c -----------------------------------------------------------------------------
386 @defvr {Option variable} breakup
387 Default value: @code{true}
389 When @code{breakup} is @code{true}, @mref{solve} expresses solutions of cubic
390 and quartic equations in terms of common subexpressions, which are assigned to
391 intermediate expression labels (@code{%t1}, @code{%t2}, etc.).
392 Otherwise, common subexpressions are not identified.
394 @code{breakup: true} has an effect only when @mref{programmode} is @code{false}.
399 (%i1) programmode: false$
401 (%i3) solve (x^3 + x^2 - 1);
404 (%t3) (--------- + --)
411 (%t4) x = (- ---------- - -) %t3 + -------------- - -
417 (%t5) x = (---------- - -) %t3 + ---------------- - -
421 (%t6) x = %t3 + ----- - -
423 (%o6) [%t4, %t5, %t6]
424 (%i6) breakup: false$
425 (%i7) solve (x^3 + x^2 - 1);
431 (%t7) x = --------------------- + (--------- + --)
432 sqrt(23) 25 1/3 6 sqrt(3) 54
437 (- ---------- - -) - -
440 sqrt(23) 25 1/3 sqrt(3) %i 1
441 (%t8) x = (--------- + --) (---------- - -)
447 + --------------------- - -
453 (%t9) x = (--------- + --) + --------------------- - -
454 6 sqrt(3) 54 sqrt(23) 25 1/3 3
457 (%o9) [%t7, %t8, %t9]
460 @opencatbox{Categories:}
461 @category{Algebraic equations}
465 @c -----------------------------------------------------------------------------
467 @deffn {Function} dimension @
468 @fname{dimension} (@var{eqn}) @
469 @fname{dimension} (@var{eqn_1}, @dots{}, @var{eqn_n})
471 @code{dimen} is a package for dimensional analysis.
472 @code{load ("dimen")} loads this package.
473 @code{demo ("dimen")} displays a short demonstration.
474 @c I GUESS THIS SHOULD BE EXPANDED TO COVER EACH FUNCTION IN THE PACKAGE
476 @opencatbox{Categories:}
477 @category{Share packages}
481 @c -----------------------------------------------------------------------------
483 @defvr {Option variable} dispflag
484 Default value: @code{true}
486 @c WHAT DOES THIS MEAN ??
487 If set to @code{false} within a @code{block} will inhibit the display of output
488 generated by the solve functions called from within the @code{block}.
489 Termination of the @code{block} with a dollar sign, @code{$}, sets @code{dispflag} to
492 @opencatbox{Categories:}
493 @category{Algebraic equations}
494 @category{Display flags and variables}
498 @c THIS COULD BENEFIT FROM REPHRASING
500 @c -----------------------------------------------------------------------------
502 @deffn {Function} funcsolve (@var{eqn}, @var{g}(@var{t}))
504 Returns @code{[@var{g}(@var{t}) = ...]} or @code{[]}, depending on whether
505 or not there exists a rational function @code{@var{g}(@var{t})} satisfying
506 @var{eqn}, which must be a first order, linear polynomial in (for this case)
507 @code{@var{g}(@var{t})} and @code{@var{g}(@var{t}+1)}
510 @c eqn: (n + 1)*f(n) - (n + 3)*f(n + 1)/(n + 1) =
512 @c funcsolve (eqn, f(n));
515 (%i1) eqn: (n + 1)*f(n) - (n + 3)*f(n + 1)/(n + 1) =
517 (n + 3) f(n + 1) n - 1
518 (%o1) (n + 1) f(n) - ---------------- = -----
520 (%i2) funcsolve (eqn, f(n));
522 Dependent equations eliminated: (4 3)
524 (%o2) f(n) = ---------------
528 Warning: this is a very rudimentary implementation -- many safety checks
529 and obvious generalizations are missing.
531 @opencatbox{Categories:}
532 @category{Algebraic equations}
536 @c -----------------------------------------------------------------------------
538 @defvr {Option variable} globalsolve
539 Default value: @code{false}
541 When @code{globalsolve} is @code{true}, solved-for variables are assigned the
542 solution values found by @code{linsolve}, and by @mref{solve} when solving two
543 or more linear equations.
545 When @code{globalsolve} is @code{false}, solutions found by @mref{linsolve} and
546 by @code{solve} when solving two or more linear equations are expressed as
547 equations, and the solved-for variables are not assigned.
549 When solving anything other than two or more linear equations, @code{solve}
550 ignores @code{globalsolve}. Other functions which solve equations (e.g.,
551 @mref{algsys}) always ignore @code{globalsolve}.
556 @c globalsolve: true$
557 @c solve ([x + 3*y = 2, 2*x - y = 5], [x, y]);
560 @c globalsolve: false$
562 @c solve ([x + 3*y = 2, 2*x - y = 5], [x, y]);
567 (%i1) globalsolve: true$
568 (%i2) solve ([x + 3*y = 2, 2*x - y = 5], [x, y]);
587 (%i5) globalsolve: false$
589 (%i7) solve ([x + 3*y = 2, 2*x - y = 5], [x, y]);
606 @opencatbox{Categories:}
607 @category{Linear equations}
611 @c THIS DESCRIPTION NEEDS WORK AND EXAMPLES
612 @c MERGE IN TEXT FROM share/integequations/inteqn.usg
613 @c AND EXAMPLES FROM .../intexs.mac
615 @c --- I'm not sure that all examples from share/integequations/intexs.mac
616 @c are handled correctly by ieqn.
618 @c -----------------------------------------------------------------------------
620 @deffn {Function} ieqn (@var{ie}, @var{unk}, @var{tech}, @var{n}, @var{guess})
622 @code{inteqn} is a package for solving integral equations.
623 @code{load ("inteqn")} loads this package.
625 @var{ie} is the integral equation; @var{unk} is the unknown function;
626 @var{tech} is the technique to be tried from those given in the lists
627 below; (@var{tech} = @code{first} means: try the first technique which
628 finds a solution; @var{tech} = @code{all} means: try all applicable
629 techniques); @var{n} is the maximum number of terms to take for
630 @code{taylor}, @code{neumann}, @code{firstkindseries}, or
631 @code{fredseries} (it is also the maximum depth of recursion for the
632 differentiation method); @var{guess} is the initial guess for
633 @code{neumann} or @code{firstkindseries}.
635 Two types of equations are considered. A second-kind equation of the
642 p(x) = q(x, p(x), I w(x, u, p(x), p(u)) du)
649 $$p\left(x\right)=q\left(x, p\left(x\right) , \int_{a\left(x\right)}
650 ^{b\left(x\right)}{w\left(x, u, p\left(x\right), p\left(u\right)\right)
654 and a first-kind equation with the form
660 f(x) = I w(x, u, p(u)) du
667 $$f\left(x\right)=\int_{a\left(x\right)}^{b\left(x\right)}
668 {w\left(x, u, p\left(u\right)\right)\;du}$$
671 The different solution techniques used require particular forms of the
672 expressions @var{q} and @var{w}. The techniques available are the following:
674 @b{Second-kind equations}
676 @item @code{flfrnk2nd}: For fixed-limit, finite-rank integrands.
677 @item @code{vlfrnk}: For variable-limit, finite-rank integrands.
678 @item @code{transform}: Laplace transform for convolution types.
679 @item @code{fredseries}: Fredholm-Carleman series for linear equations.
680 @item @code{tailor}: Taylor series for quasi-linear variable-limit equations.
681 @item @code{neumann}: Neumann series for quasi-second kind equations.
682 @item @code{collocate}: Collocation using a power series form for p(x)
683 evaluated at equally spaced points.
686 @b{First-kind equations}
688 @item @code{flfrnk1st}: For fixed-limit, finite-rank integrands.
689 @item @code{vlfrnk}: For variable-limit, finite-rank integrands.
690 @item @code{abel}: For singular integrands
691 @item @code{transform}: See above
692 @item @code{collocate}: See above
693 @item @code{firstkindseries}: Iteration technique similar to neumann series.
696 The default values for the 2nd thru 5th parameters in the calling form
699 @var{unk}: @code{@var{p}(@var{x})}, where @var{p} is the first function
700 encountered in an integrand which is unknown to Maxima and @var{x} is the
701 variable which occurs as an argument to the first occurrence of @var{p} found
702 outside of an integral in the case of @code{secondkind} equations, or is the
703 only other variable besides the variable of integration in @code{firstkind}
704 equations. If the attempt to search for @var{x} fails, the user will be asked
705 to supply the independent variable. @var{tech}: @code{first}. @var{n}: 1.
706 @var{guess}: @code{none} which will cause @code{neumann} and
707 @code{firstkindseries} to use @code{@var{f}(@var{x})} as an initial guess.
711 (%i1) load("inteqn")$
713 (%i2) e: p(x) - 1 -x + cos(x) + 'integrate(cos(x-u)*p(u),u,0,x)$
715 (%i3) ieqn(e, p(x), 'transform);
716 default 4th arg, number of iterations or coll. parms.: 1
717 default 5th arg, initial guess: none
721 (%i4) e: 2*'integrate(p(x*sin(u)), u, 0, %pi/2) - a*x - b$
723 (%i5) ieqn(e, p(x), 'firstkindseries);
724 default 4th arg, number of iterations or coll. parms.: 1
725 default 5th arg, initial guess: none
727 (%t5) [2 a x + %pi b, firstkindseries, 1, approximate]
731 @opencatbox{Categories:}
732 @category{Integral equations}
736 @c -----------------------------------------------------------------------------
738 @defvr {Option variable} ieqnprint
739 Default value: @code{true}
741 @code{ieqnprint} governs the behavior of the result returned by the
742 @mref{ieqn} command. When @code{ieqnprint} is @code{false}, the lists returned
743 by the @code{ieqn} function are of the form
745 [@var{solution}, @var{technique used}, @var{nterms}, @var{flag}]
747 where @var{flag} is absent if the solution is exact.
749 Otherwise, it is the word @code{approximate} or @code{incomplete} corresponding
750 to an inexact or non-closed form solution, respectively. If a series method was
751 used, @var{nterms} gives the number of terms taken (which could be less than
752 the n given to @code{ieqn} if an error prevented generation of further terms).
754 @opencatbox{Categories:}
755 @category{Integral equations}
759 @c -----------------------------------------------------------------------------
761 @deffn {Function} lhs (@var{expr})
763 Returns the left-hand side (that is, the first argument) of the expression
764 @var{expr}, when the operator of @var{expr} is one of the relational operators
765 @code{< <= = # equal notequal >= >},
766 @c MENTION -> (MARROW) IN THIS LIST IF/WHEN THE PARSER RECOGNIZES IT
767 one of the assignment operators @code{:= ::= : ::}, or a user-defined binary
768 infix operator, as declared by @mrefdot{infix}
770 When @var{expr} is an atom or its operator is something other than the ones
771 listed above, @code{lhs} returns @var{expr}.
773 See also @mrefdot{rhs}
781 @c [lhs (aa < bb), lhs (aa <= bb), lhs (aa >= bb),
783 @c [lhs (aa = bb), lhs (aa # bb), lhs (equal (aa, bb)),
784 @c lhs (notequal (aa, bb))];
785 @c e1: '(foo(x) := 2*x);
786 @c e2: '(bar(y) ::= 3*y);
789 @c [lhs (e1), lhs (e2), lhs (e3), lhs (e4)];
794 (%i1) e: aa + bb = cc;
800 (%i4) [lhs (aa < bb), lhs (aa <= bb), lhs (aa >= bb),
802 (%o4) [aa, aa, aa, aa]
803 (%i5) [lhs (aa = bb), lhs (aa # bb), lhs (equal (aa, bb)),
804 lhs (notequal (aa, bb))];
805 (%o5) [aa, aa, aa, aa]
806 (%i6) e1: '(foo(x) := 2*x);
808 (%i7) e2: '(bar(y) ::= 3*y);
814 (%i10) [lhs (e1), lhs (e2), lhs (e3), lhs (e4)];
815 (%o10) [foo(x), bar(y), x, x]
818 (%i12) lhs (aa ][ bb);
822 @opencatbox{Categories:}
823 @category{Expressions}
827 @c REVISIT -- THERE'S PROBABLY MORE TO SAY HERE
829 @c -----------------------------------------------------------------------------
831 @deffn {Function} linsolve ([@var{expr_1}, @dots{}, @var{expr_m}], [@var{x_1}, @dots{}, @var{x_n}])
833 Solves the list of simultaneous linear equations for the list of variables.
834 The expressions must each be polynomials in the variables and may be equations.
835 If the length of the list of variables doesn't match the number of
836 linearly-independent equations to solve the result will be an empty list.
838 When @mref{globalsolve} is @code{true}, each solved-for variable is bound to
839 its value in the solution of the equations.
841 When @mref{backsubst} is @code{false}, @code{linsolve} does not carry out back
842 substitution after the equations have been triangularized. This may be
843 necessary in very big problems where back substitution would cause the
844 generation of extremely large expressions.
846 When @mref{linsolve_params} is @code{true}, @code{linsolve} also generates the
847 @code{%r} symbols used to represent arbitrary parameters described in the manual
848 under @mrefdot{algsys} Otherwise, @code{linsolve} solves an under-determined
849 system of equations with some variables expressed in terms of others.
851 When @mref{programmode} is @code{false}, @code{linsolve} displays the solution
852 with intermediate expression (@code{%t}) labels, and returns the list of labels.
854 See also @mrefcomma{algsys} @mrefdot{eliminate} and @mrefdot{solve}
859 @c e2: 2*a*x - y = 2*a^2;
861 @c [globalsolve: false, programmode: true];
862 @c linsolve ([e1, e2, e3], [x, y, z]);
863 @c [globalsolve: false, programmode: false];
864 @c linsolve ([e1, e2, e3], [x, y, z]);
866 @c [globalsolve: true, programmode: false];
867 @c linsolve ([e1, e2, e3], [x, y, z]);
870 @c [globalsolve: true, programmode: true];
871 @c linsolve ([e1, e2, e3], '[x, y, z]);
877 (%i2) e2: 2*a*x - y = 2*a^2;
879 (%o2) 2 a x - y = 2 a
880 (%i3) e3: y - 2*z = 2;
882 (%i4) [globalsolve: false, programmode: true];
884 (%i5) linsolve ([e1, e2, e3], [x, y, z]);
885 (%o5) [x = a + 1, y = 2 a, z = a - 1]
886 (%i6) [globalsolve: false, programmode: false];
888 (%i7) linsolve ([e1, e2, e3], [x, y, z]);
896 (%o9) [%t7, %t8, %t9]
898 (%o9) [z = a - 1, y = 2 a, x = a + 1]
899 (%i10) [globalsolve: true, programmode: false];
901 (%i11) linsolve ([e1, e2, e3], [x, y, z]);
909 (%o13) [%t11, %t12, %t13]
911 (%o13) [z : a - 1, y : 2 a, x : a + 1]
913 (%o14) [a + 1, 2 a, a - 1]
914 (%i15) [globalsolve: true, programmode: true];
916 (%i16) linsolve ([e1, e2, e3], '[x, y, z]);
917 (%o16) [x : a + 1, y : 2 a, z : a - 1]
919 (%o17) [a + 1, 2 a, a - 1]
922 @opencatbox{Categories:}
923 @category{Linear equations}
927 @c DO ANY FUNCTIONS OTHER THAN linsolve RESPECT linsolvewarn ??
929 @c -----------------------------------------------------------------------------
930 @anchor{linsolvewarn}
931 @defvr {Option variable} linsolvewarn
932 Default value: @code{true}
934 When @code{linsolvewarn} is @code{true}, @mref{linsolve} prints a message
935 "Dependent equations eliminated".
937 @opencatbox{Categories:}
938 @category{Linear equations}
942 @c -----------------------------------------------------------------------------
943 @anchor{linsolve_params}
944 @defvr {Option variable} linsolve_params
945 Default value: @code{true}
947 When @code{linsolve_params} is @code{true}, @mref{linsolve} also generates
948 the @code{%r} symbols used to represent arbitrary parameters described in
949 the manual under @mrefdot{algsys} Otherwise, @code{linsolve} solves an
950 under-determined system of equations with some variables expressed in terms of
953 @opencatbox{Categories:}
954 @category{Linear equations}
958 @c -----------------------------------------------------------------------------
959 @anchor{multiplicities}
960 @defvr {System variable} multiplicities
961 Default value: @code{not_set_yet}
963 @code{multiplicities} is set to a list of the multiplicities of the individual
964 solutions returned by @mref{solve} or @mrefdot{realroots}
965 @c NEED AN EXAMPLE HERE
967 @opencatbox{Categories:}
968 @category{Algebraic equations}
969 @category{Polynomials}
973 @c -----------------------------------------------------------------------------
975 @deffn {Function} nroots (@var{p}, @var{low}, @var{high})
977 Returns the number of real roots of the real univariate polynomial @var{p} in
978 the half-open interval @code{(@var{low}, @var{high}]}. The endpoints of the
979 interval may be @code{minf} or @code{inf}.
981 @code{nroots} uses the method of Sturm sequences.
984 @c p: x^10 - 2*x^4 + 1/2$
985 @c nroots (p, -6, 9.1);
988 (%i1) p: x^10 - 2*x^4 + 1/2$
989 (%i2) nroots (p, -6, 9.1);
993 @opencatbox{Categories:}
994 @category{Polynomials}
995 @category{Numerical methods}
1001 @c -----------------------------------------------------------------------------
1003 @deffn {Function} nthroot (@var{p}, @var{n})
1005 where @var{p} is a polynomial with integer coefficients and @var{n} is a
1006 positive integer returns @code{q}, a polynomial over the integers, such that
1007 @code{q^n = p} or prints an error message indicating that @var{p} is not a
1008 perfect nth power. This routine is much faster than @mref{factor} or even
1011 @opencatbox{Categories:}
1012 @category{Polynomials}
1016 @c -----------------------------------------------------------------------------
1018 @defvr {Option variable} polyfactor
1019 Default value: @code{false}
1021 The option variable @code{polyfactor} when @code{true} causes
1022 @mref{allroots} and @mref{bfallroots} to factor the polynomial over the real
1023 numbers if the polynomial is real, or over the complex numbers, if the
1024 polynomial is complex.
1026 See @code{allroots} for an example.
1028 @opencatbox{Categories:}
1029 @category{Polynomials}
1030 @category{Numerical methods}
1034 @c -----------------------------------------------------------------------------
1035 @anchor{programmode}
1036 @defvr {Option variable} programmode
1037 Default value: @code{true}
1039 When @code{programmode} is @code{true}, @mrefcomma{solve}@w{}
1040 @mrefcomma{realroots} @mrefcomma{allroots} and @mref{linsolve} return solutions
1041 as elements in a list.
1042 @c WHAT DOES BACKSUBSTITUTION HAVE TO DO WITH RETURN VALUES ??
1043 (Except when @mref{backsubst} is set to @code{false}, in which case
1044 @code{programmode: false} is assumed.)
1046 When @code{programmode} is @code{false}, @code{solve}, etc. create intermediate
1047 expression labels @code{%t1}, @code{%t2}, etc., and assign the solutions to them.
1048 @c NEED AN EXAMPLE HERE
1050 @opencatbox{Categories:}
1051 @category{Algebraic equations}
1052 @category{Polynomials}
1056 @c -----------------------------------------------------------------------------
1058 @defvr {Option variable} realonly
1059 Default value: @code{false}
1061 When @code{realonly} is @code{true}, @mref{algsys} returns only those solutions
1062 which are free of @code{%i}.
1064 @opencatbox{Categories:}
1065 @category{Algebraic equations}
1069 @c -----------------------------------------------------------------------------
1071 @deffn {Function} realroots @
1072 @fname{realroots} (@var{expr}, @var{bound}) @
1073 @fname{realroots} (@var{eqn}, @var{bound}) @
1074 @fname{realroots} (@var{expr}) @
1075 @fname{realroots} (@var{eqn})
1077 Computes rational approximations of the real roots of the polynomial @var{expr}
1078 or polynomial equation @var{eqn} of one variable, to within a tolerance of
1079 @var{bound}. Coefficients of @var{expr} or @var{eqn} must be literal numbers;
1080 symbol constants such as @code{%pi} are rejected.
1082 @code{realroots} assigns the multiplicities of the roots it finds
1083 to the global variable @mrefdot{multiplicities}
1085 @code{realroots} constructs a Sturm sequence to bracket each root, and then
1086 applies bisection to refine the approximations. All coefficients are converted
1087 to rational equivalents before searching for roots, and computations are carried
1088 out by exact rational arithmetic. Even if some coefficients are floating-point
1089 numbers, the results are rational (unless coerced to floats by the
1090 @mref{float} or @mref{numer} flags).
1092 When @var{bound} is less than 1, all integer roots are found exactly.
1093 When @var{bound} is unspecified, it is assumed equal to the global variable
1094 @mrefdot{rootsepsilon}
1096 When the global variable @mref{programmode} is @code{true}, @code{realroots}
1097 returns a list of the form @code{[x = @var{x_1}, x = @var{x_2}, ...]}.
1098 When @code{programmode} is @code{false}, @code{realroots} creates intermediate
1099 expression labels @code{%t1}, @code{%t2}, @dots{},
1100 assigns the results to them, and returns the list of labels.
1105 @c realroots (-1 - x + x^5, 5e-6);
1106 @c ev (%[1], float);
1107 @c ev (-1 - x + x^5, %);
1110 (%i1) realroots (-1 - x + x^5, 5e-6);
1114 (%i2) ev (%[1], float);
1115 (%o2) x = 1.167303085327148
1116 (%i3) ev (-1 - x + x^5, %);
1117 (%o3) - 7.396496210176905E-6
1121 @c realroots (expand ((1 - x)^5 * (2 - x)^3 * (3 - x)), 1e-20);
1125 (%i1) realroots (expand ((1 - x)^5 * (2 - x)^3 * (3 - x)), 1e-20);
1126 (%o1) [x = 1, x = 2, x = 3]
1127 (%i2) multiplicities;
1131 @opencatbox{Categories:}
1132 @category{Polynomials}
1133 @category{Numerical methods}
1137 @c -----------------------------------------------------------------------------
1139 @deffn {Function} rhs (@var{expr})
1141 Returns the right-hand side (that is, the second argument) of the expression
1142 @var{expr}, when the operator of @var{expr} is one of the relational operators
1143 @code{< <= = # equal notequal >= >},
1144 @c MENTION -> (MARROW) IN THIS LIST IF/WHEN THE PARSER RECOGNIZES IT
1145 one of the assignment operators @code{:= ::= : ::}, or a user-defined binary
1146 infix operator, as declared by @mrefdot{infix}
1148 When @var{expr} is an atom or its operator is something other than the ones
1149 listed above, @code{rhs} returns 0.
1151 See also @mrefdot{lhs}
1159 @c [rhs (aa < bb), rhs (aa <= bb), rhs (aa >= bb),
1161 @c [rhs (aa = bb), rhs (aa # bb), rhs (equal (aa, bb)),
1162 @c rhs (notequal (aa, bb))];
1163 @c e1: '(foo(x) := 2*x);
1164 @c e2: '(bar(y) ::= 3*y);
1167 @c [rhs (e1), rhs (e2), rhs (e3), rhs (e4)];
1172 (%i1) e: aa + bb = cc;
1178 (%i4) [rhs (aa < bb), rhs (aa <= bb), rhs (aa >= bb),
1180 (%o4) [bb, bb, bb, bb]
1182 (%i5) [rhs (aa = bb), rhs (aa # bb), rhs (equal (aa, bb)),
1183 rhs (notequal (aa, bb))];
1185 (%o5) [bb, bb, bb, bb]
1186 (%i6) e1: '(foo(x) := 2*x);
1188 (%i7) e2: '(bar(y) ::= 3*y);
1189 (%o7) bar(y) ::= 3 y
1192 (%i9) e4: '(x :: y);
1194 (%i10) [rhs (e1), rhs (e2), rhs (e3), rhs (e4)];
1195 (%o10) [2 x, 3 y, y, y]
1196 (%i11) infix ("][");
1198 (%i12) rhs (aa ][ bb);
1202 @opencatbox{Categories:}
1203 @category{Expressions}
1207 @c -----------------------------------------------------------------------------
1208 @anchor{rootsconmode}
1209 @defvr {Option variable} rootsconmode
1210 Default value: @code{true}
1212 @code{rootsconmode} governs the behavior of the @code{rootscontract} command.
1213 See @mref{rootscontract} for details.
1215 @opencatbox{Categories:}
1216 @category{Expressions}
1217 @category{Simplification flags and variables}
1223 @c -----------------------------------------------------------------------------
1224 @anchor{rootscontract}
1225 @deffn {Function} rootscontract (@var{expr})
1227 Converts products of roots into roots of products. For example,
1228 @code{rootscontract (sqrt(x)*y^(3/2))} yields @code{sqrt(x*y^3)}.
1230 When @mref{radexpand} is @code{true} and @mref{domain} is @code{real},
1231 @code{rootscontract} converts @mref{abs} into @mrefcomma{sqrt} e.g.,
1232 @code{rootscontract (abs(x)*sqrt(y))} yields @code{sqrt(x^2*y)}.
1234 There is an option @mref{rootsconmode} affecting @code{rootscontract} as
1238 Problem Value of Result of applying
1239 rootsconmode rootscontract
1241 x^(1/2)*y^(3/2) false (x*y^3)^(1/2)
1242 x^(1/2)*y^(1/4) false x^(1/2)*y^(1/4)
1243 x^(1/2)*y^(1/4) true (x*y^(1/2))^(1/2)
1244 x^(1/2)*y^(1/3) true x^(1/2)*y^(1/3)
1245 x^(1/2)*y^(1/4) all (x^2*y)^(1/4)
1246 x^(1/2)*y^(1/3) all (x^3*y^2)^(1/6)
1249 When @code{rootsconmode} is @code{false}, @code{rootscontract} contracts only
1250 with respect to rational number exponents whose denominators are the same. The
1251 key to the @code{rootsconmode: true} examples is simply that 2 divides into 4
1252 but not into 3. @code{rootsconmode: all} involves taking the least common
1253 multiple of the denominators of the exponents.
1255 @code{rootscontract} uses @mref{ratsimp} in a manner similar to
1256 @mrefdot{logcontract}
1261 @c rootsconmode: false$
1262 @c rootscontract (x^(1/2)*y^(3/2));
1263 @c rootscontract (x^(1/2)*y^(1/4));
1264 @c rootsconmode: true$
1265 @c rootscontract (x^(1/2)*y^(1/4));
1266 @c rootscontract (x^(1/2)*y^(1/3));
1267 @c rootsconmode: all$
1268 @c rootscontract (x^(1/2)*y^(1/4));
1269 @c rootscontract (x^(1/2)*y^(1/3));
1270 @c rootsconmode: false$
1271 @c rootscontract (sqrt(sqrt(x) + sqrt(1 + x))
1272 @c *sqrt(sqrt(1 + x) - sqrt(x)));
1273 @c rootsconmode: true$
1274 @c rootscontract (sqrt(5 + sqrt(5)) - 5^(1/4)*sqrt(1 + sqrt(5)));
1277 (%i1) rootsconmode: false$
1278 (%i2) rootscontract (x^(1/2)*y^(3/2));
1281 (%i3) rootscontract (x^(1/2)*y^(1/4));
1284 (%i4) rootsconmode: true$
1285 (%i5) rootscontract (x^(1/2)*y^(1/4));
1286 (%o5) sqrt(x sqrt(y))
1287 (%i6) rootscontract (x^(1/2)*y^(1/3));
1290 (%i7) rootsconmode: all$
1291 (%i8) rootscontract (x^(1/2)*y^(1/4));
1294 (%i9) rootscontract (x^(1/2)*y^(1/3));
1297 (%i10) rootsconmode: false$
1298 (%i11) rootscontract (sqrt(sqrt(x) + sqrt(1 + x))
1299 *sqrt(sqrt(1 + x) - sqrt(x)));
1301 (%i12) rootsconmode: true$
1302 (%i13) rootscontract (sqrt(5+sqrt(5)) - 5^(1/4)*sqrt(1+sqrt(5)));
1306 @opencatbox{Categories:}
1307 @category{Simplification functions}
1311 @c -----------------------------------------------------------------------------
1312 @anchor{rootsepsilon}
1313 @defvr {Option variable} rootsepsilon
1314 Default value: 1.0e-7
1316 @code{rootsepsilon} is the tolerance which establishes the confidence interval
1317 for the roots found by the @mref{realroots} function.
1318 @c IS IT GUARANTEED THAT |ACTUAL - ESTIMATE| < rootepsilon OR IS IT SOME OTHER
1319 @c NOTION ?? NEED EXAMPLE HERE
1321 @opencatbox{Categories:}
1322 @category{Polynomials}
1323 @category{Numerical methods}
1329 @c -----------------------------------------------------------------------------
1331 @deffn {Function} solve @
1332 @fname{solve} (@var{expr}, @var{x}) @
1333 @fname{solve} (@var{expr}) @
1334 @fname{solve} ([@var{eqn_1}, @dots{}, @var{eqn_n}], [@var{x_1}, @dots{}, @var{x_n}])
1336 Solves the algebraic equation @var{expr} for the variable @var{x} and returns a
1337 list of solution equations in @var{x}. If @var{expr} is not an equation, the
1338 equation @code{@var{expr} = 0} is assumed in its place.
1339 @var{x} may be a function (e.g. @code{f(x)}), or other non-atomic expression
1340 except a sum or product. @var{x} may be omitted if @var{expr} contains only one
1341 variable. @var{expr} may be a rational expression, and may contain
1342 trigonometric functions, exponentials, etc.
1344 The following method is used:
1346 Let @var{E} be the expression and @var{X} be the variable. If @var{E} is linear
1347 in @var{X} then it is trivially solved for @var{X}. Otherwise if @var{E} is of
1348 the form @code{A*X^N + B} then the result is @code{(-B/A)^1/N)} times the
1349 @code{N}'th roots of unity.
1351 If @var{E} is not linear in @var{X} then the gcd of the exponents of @var{X} in
1352 @var{E} (say @var{N}) is divided into the exponents and the multiplicity of the
1353 roots is multiplied by @var{N}. Then @code{solve} is called again on the
1354 result. If @var{E} factors then @code{solve} is called on each of the factors.
1355 Finally @code{solve} will use the quadratic, cubic, or quartic formulas where
1358 In the case where @var{E} is a polynomial in some function of the variable to be
1359 solved for, say @code{F(X)}, then it is first solved for @code{F(X)} (call the
1360 result @var{C}), then the equation @code{F(X)=C} can be solved for @var{X}
1361 provided the inverse of the function @var{F} is known.
1363 @mref{breakup} if @code{false} will cause @code{solve} to express the solutions
1364 of cubic or quartic equations as single expressions rather than as made
1365 up of several common subexpressions which is the default.
1367 @mref{multiplicities} - will be set to a list of the multiplicities of the
1368 individual solutions returned by @code{solve}, @mrefcomma{realroots} or
1369 @mrefdot{allroots} Try @code{apropos (solve)} for the switches which affect
1370 @code{solve}. @mref{describe} may then by used on the individual switch names
1371 if their purpose is not clear.
1373 @code{solve ([@var{eqn_1}, ..., @var{eqn_n}], [@var{x_1}, ..., @var{x_n}])}
1374 solves a system of simultaneous (linear or non-linear) polynomial equations by
1375 calling @mref{linsolve} or @mref{algsys} and returns a list of the solution
1376 lists in the variables. In the case of @mref{linsolve} this list would contain
1377 a single list of solutions. It takes two lists as arguments. The first list
1378 represents the equations to be solved; the second list is a
1379 list of the unknowns to be determined. If the total number of
1380 variables in the equations is equal to the number of equations, the
1381 second argument-list may be omitted.
1383 @c I think this is not true --hgeyer
1386 @c solution exists, then @code{singular} will be displayed.
1388 When @mref{programmode} is @code{false}, @code{solve} displays solutions with
1389 intermediate expression (@code{%t}) labels, and returns the list of labels.
1391 When @mref{globalsolve} is @code{true} and the problem is to solve two or more
1392 linear equations, each solved-for variable is bound to its value in the solution
1397 @c FOLLOWING ADAPTED FROM example (solve)
1399 @c solve (asin (cos (3*x))*(f(x) - 1), x);
1400 @c ev (solve (5^f(x) = 125, f(x)), solveradcan);
1401 @c [4*x^2 - y^2 = 12, x*y - x = 2];
1402 @c solve (%, [x, y]);
1403 @c solve (1 + a*x + x^3, x);
1406 @c ev (x^6 - 1, %[1]);
1410 @c ev (%th(2), %[1]);
1413 (%i1) solve (asin (cos (3*x))*(f(x) - 1), x);
1415 solve: using arc-trig functions to get a solution.
1416 Some solutions will be lost.
1418 (%o1) [x = ---, f(x) = 1]
1420 (%i2) ev (solve (5^f(x) = 125, f(x)), solveradcan);
1422 (%o2) [f(x) = --------]
1424 (%i3) [4*x^2 - y^2 = 12, x*y - x = 2];
1426 (%o3) [4 x - y = 12, x y - x = 2]
1428 (%i4) solve (%, [x, y]);
1429 (%o4) [[x = 2, y = 2], [x = .5202594388652008 %i
1430 - .1331240357358706, y = .07678378523787788
1431 - 3.608003221870287 %i], [x = - .5202594388652008 %i
1432 - .1331240357358706, y = 3.608003221870287 %i
1433 + .07678378523787788], [x = - 1.733751846381093,
1434 y = - .1535675710019696]]
1436 (%i5) solve (1 + a*x + x^3, x);
1439 sqrt(3) %i 1 sqrt(4 a + 27) 1 1/3
1440 (%o5) [x = (- ---------- - -) (--------------- - -)
1446 - --------------------------, x =
1448 sqrt(4 a + 27) 1 1/3
1449 3 (--------------- - -)
1453 sqrt(3) %i 1 sqrt(4 a + 27) 1 1/3
1454 (---------- - -) (--------------- - -)
1458 (- ---------- - -) a
1460 - --------------------------, x =
1462 sqrt(4 a + 27) 1 1/3
1463 3 (--------------- - -)
1467 sqrt(4 a + 27) 1 1/3 a
1468 (--------------- - -) - --------------------------]
1470 sqrt(4 a + 27) 1 1/3
1471 3 (--------------- - -)
1473 (%i6) solve (x^3 - 1);
1474 sqrt(3) %i - 1 sqrt(3) %i + 1
1475 (%o6) [x = --------------, x = - --------------, x = 1]
1477 (%i7) solve (x^6 - 1);
1478 sqrt(3) %i + 1 sqrt(3) %i - 1
1479 (%o7) [x = --------------, x = --------------, x = - 1,
1482 sqrt(3) %i + 1 sqrt(3) %i - 1
1483 x = - --------------, x = - --------------, x = 1]
1485 (%i8) ev (x^6 - 1, %[1]);
1489 (%o8) ----------------- - 1
1497 (%i11) solve (%, x);
1498 (%o11) [x = - 1, x = 1]
1499 (%i12) ev (%th(2), %[1]);
1503 The symbols @code{%r} are used to denote arbitrary constants in a solution.
1506 @c solve([x+y=1,2*x+2*y=2],[x,y]);
1509 (%i1) solve([x+y=1,2*x+2*y=2],[x,y]);
1511 solve: dependent equations eliminated: (2)
1512 (%o1) [[x = 1 - %r1, y = %r1]]
1515 See @mref{algsys} and @mref{%rnum_list} for more information.
1517 @opencatbox{Categories:}
1518 @category{Algebraic equations}
1522 @c -----------------------------------------------------------------------------
1523 @anchor{solvedecomposes}
1524 @defvr {Option variable} solvedecomposes
1525 Default value: @code{true}
1527 When @code{solvedecomposes} is @code{true}, @code{solve} calls
1528 @mref{polydecomp} if asked to solve polynomials.
1529 @c OTHERWISE WHAT HAPPENS -- CAN'T SOLVE POLYNOMIALS, OR SOME OTHER METHOD IS USED ??
1531 @opencatbox{Categories:}
1532 @category{Algebraic equations}
1536 @c -----------------------------------------------------------------------------
1537 @anchor{solveexplicit}
1538 @defvr {Option variable} solveexplicit
1539 Default value: @code{false}
1541 When @code{solveexplicit} is @code{true}, inhibits @mref{solve} from returning
1542 implicit solutions, that is, solutions of the form @code{F(x) = 0} where
1543 @code{F} is some function.
1544 @c NEED AN EXAMPLE HERE
1546 @opencatbox{Categories:}
1547 @category{Algebraic equations}
1551 @c -----------------------------------------------------------------------------
1552 @anchor{solvefactors}
1553 @defvr {Option variable} solvefactors
1554 Default value: @code{true}
1556 @c WHAT IS THIS ABOUT EXACTLY ??
1557 When @code{solvefactors} is @code{false}, @mref{solve} does not try to factor
1558 the expression. The @code{false} setting may be desired in some cases where
1559 factoring is not necessary.
1560 @c NEED AN EXAMPLE HERE
1562 @opencatbox{Categories:}
1563 @category{Algebraic equations}
1567 @c -----------------------------------------------------------------------------
1568 @anchor{solvenullwarn}
1569 @defvr {Option variable} solvenullwarn
1570 Default value: @code{true}
1572 When @code{solvenullwarn} is @code{true}, @mref{solve} prints a warning message
1573 if called with either a null equation list or a null variable list. For
1574 example, @code{solve ([], [])} would print two warning messages and return
1577 @opencatbox{Categories:}
1578 @category{Algebraic equations}
1582 @c -----------------------------------------------------------------------------
1583 @anchor{solveradcan}
1584 @defvr {Option variable} solveradcan
1585 Default value: @code{false}
1587 When @code{solveradcan} is @code{true}, @mref{solve} calls @mref{radcan}@w{}
1588 which makes @code{solve} slower but will allow certain problems containing
1589 exponentials and logarithms to be solved.
1590 @c NEED AN EXAMPLE HERE
1592 @opencatbox{Categories:}
1593 @category{Algebraic equations}
1597 @c -----------------------------------------------------------------------------
1598 @anchor{solvetrigwarn}
1599 @defvr {Option variable} solvetrigwarn
1600 Default value: @code{true}
1602 @c MAYBE THIS CAN BE CLARIFIED
1603 When @code{solvetrigwarn} is @code{true}, @mref{solve} may print a message
1604 saying that it is using inverse trigonometric functions to solve the equation,
1605 and thereby losing solutions.
1606 @c NEED AN EXAMPLE HERE
1608 @opencatbox{Categories:}
1609 @category{Algebraic equations}