On Sat, Oct 21, 2023 at 02:08:32PM -0700, Mild Shock wrote:
> I think cubic root can be extended to negative real numbers,
Some people define odd roots of real numbers to be negative.
This is reasonable if you deal with equation solving as
ambiguity is already there. However, this is problematic
for symbolic computation. Namely in symbolic computation
we deal with expressions and normal expressions give you
_complex_ functions that are analytic except for at most
countable set of singular points. Computing integrals
is based on differential fields, that is we want to divide
by functions. Division is fine for analytic functions
as set of zeros is at most countable and zeros are isolated.
But field implies that equation
s^3 = x
has exaxtly 3 solutions. One is usual principal root
solution, and two other are obtained from principal
root multiply by third degree roots of 1. To avoid
misunderstanding: above x means expression defininig
identity function on complex plane.
Once you introduce your real root of degree 3, we no
longer have a field, but ring with zero divisors.
In general this causes unsolvable problems (see
Richardson), but there is a lot of simple examples
that can be easily handled by splitting into parts,
each part analytic (living in its own filed).
In FriCAS currently any splittings needed to handle
such things must be introduced by user. So instead
of
integrate(sin(x)*(cos(x))^(1/3), x =0..2*%pi)
you need
integrate(sin(x)*(cos(x))^(1/3), x = -%pi/2..%pi/2, "noPole")
and
integrate(sin(x)*(cos(x))^(1/3), x =%pi/2..(3/2)*%pi, "noPole")
Also, you may need to mangle one or both to get desired
branch. Note "noPole" is really a statement that no singularities
prevent correct computation of integral. If you use
it in cases when there are singulatities you may get wrong
result.
> Wolfram Alpha asks me whether I want principal root or
> real-valued root. Maybe FriCAS has also such a feature somewhere?
No.
> Maybe should read the FriCAS manual.
>
> Quick gloss over the FriCAS manual gives me, showing
> the difference between principal and real-valued root:
>
> (2) -> complexSolve(x^3 = -1/8, 0.0001)
>
> (2)
> [x = 0.25 - 0.4330127025_0231027603 %i,
> x = 0.25 + 0.4330127025_0231027603_1494140625 %i, x = - 0.5]
>
> (3) -> solve(x^3 = -1/8, 0.0001)
>
> (3) [x = - 0.5]
>
> But how tell integral what root to use?
In general that is extremaly messy. If roots are independent,
then in a sense it does not metter, result is valid for
each choice of roots. But once you get to things like
sqrt(x*y) - sqrt(x)*sqrt(y)
situation gets more tricky. Also "obvious" properies fail:
"compute integral and then plug in numbers for parameters" is not
equivalent to "plug in numbers for parameters and then compute
integral". As indicated, in FriCAS those troubles are left
to user. User may split integral into parts and resolve
dependencies between roots.
--
Waldek Hebisch