Difference between solve's `r` and `c` solution parameters

asked 2021-09-27 18:01:32 +0100

dsejas gravatar image

updated 2021-09-27 18:13:53 +0100

Hello, everybody! The author of this related question pointed out an interesting fact: if a system of equations has parameters in its solutions, sometimes the parameters are written as rN and sometimes as cN, where N is a positive integer.

As far as I can tell, the rs are produced by Maxima's solve() function, while the cs are produced by Maxima's to_poly_solve() function. Indeed, consider the following system (obtained from a comment in the mentioned question):

a_1, a_2, b_1, b_2 = var('a_1, a_2, b_1, b_2')
eq1 = a_2^2 - a_2*a_1^2 == 0
eq2 = a_2*b_2 - 2*a_1*a_2*b_1 + a_2*b_2 - a_1^2*b_1 == 0
eqs = [eq1, eq2]

If we solve with

from sage.calculus.calculus import maxima
m = maxima(eqs)
sols = m.solve([a_1,a_2,b_1,b_2])

then, we get

[[a_1 == 0, a_2 == 0, b_1 == r31, b_2 == r32],
 [a_1 == r33, a_2 == 0, b_1 == 0, b_2 == r34],
 [a_1 == r35, a_2 == r35^2, b_1 == r36, b_2 == 1/2*(2*r35 + 1)*r36]]

The r parameters seem to indicate real parameters, as indicated by this answer by @kcrisman (sorry to ping you). However, it can clearly be seen that complex parameters are also acceptable. Moreover, the code

from sage.calculus.calculus import maxima
m = maxima(eqs)
sols = m.to_poly_solve([a_1,a_2,b_1,b_2])

then, we get

[[a_1 == 0, a_2 == 0, b_1 == c1973, b_2 == c1974],
 [a_1 == c1975, a_2 == 0, b_1 == 0, b_2 == c1976],
 [a_1 == c1977, a_2 == c1977^2, b_1 == c1978, b_2 == 1/2*(2*c1977 + 1)*c1978]]

There are two possibilities here:

  1. to_poly_solve is more sophisticated, so it works with complex parameters.
  2. The parameters don't indicate real or complex.

Could somebody clarify the difference between r and c parameters?

Thank in advance for your answers!

edit retag flag offensive close merge delete