2.5.5 Complex numbers
When factoring polynomials (see Section 9.1.10), by default
Xcas won’t introduce complex numbers if they aren’t already
being used. For example,
simply returns
but if an expression already involves complex numbers then
Xcas uses them:
|
| ⎛
⎜
⎝ | x−i | √ | | ⎞
⎟
⎠ | ⎛
⎜
⎝ | i x− | √ | | ⎞
⎟
⎠ |
| | | | | | | | | | |
|
Xcas can also find complex roots when complex
numbers are not present; for example, the command
cfactor
(see Section 9.1.10) or cFactor
command factors over the complex numbers. For example:
|
| ⎛
⎜
⎝ | x+i | √ | | ⎞
⎟
⎠ | ⎛
⎜
⎝ | x−i | √ | | ⎞
⎟
⎠ |
| | | | | | | | | | |
|
If you want Xcas to use complex numbers by default, you can
turn on complex mode. In complex mode, the command line
returns
|
| ⎛
⎜
⎝ | x+i | √ | | ⎞
⎟
⎠ | ⎛
⎜
⎝ | x−i | √ | | ⎞
⎟
⎠ |
| | | | | | | | | | |
|
You can turn on complex mode from the CAS configuration screen (see
Section 2.5.7). This mode is determined by the value of the
variable complex_mode;
if this is 1 then complex
mode is on, if this is 0 then complex mode is off. This
option will be stored in the configuration file (see
Section 2.5.10), and so can also be set there.