The slope multiplied by the distance would be, using real-valued root (the Wolfram Alpha assumption):
integral_0^(2 π) 1/100 (2 + cos(t)) cos(t)^(1/3) dt = 0.0364298 https://www.wolframalpha.com/input?i=integ_0%5E%282*pi%29+cos%28t%29%5E%281%2F3%29+%282%2Bcos%28t%29%29+%2F100+dt&assumption=%22%5E%22+-%3E+%22Real%22 But I am not sure whether the interval - π/2 to π/2, as you suggest, would give me the slope. The factor cos(t)^(1/3) is indeed positive in this interval, but the integrand itself is not symmetric, for example the range π/2 to π is not a mirror of the range 0 to π/2. Also the smaller interval doesn't improve integrability: (1) -> integrate(cos(t)^(1/3)*(2+cos(t))/100, t = -%pi/2..%pi/2, "noPole") (1) "failed" Maybe there is a function in FriCAS for some numerical integral algorithm? Have to check the FriCAS manual, maybe I find something. Maybe we can validate the Wolfram Alpha result, show some agreement? Waldek Hebisch schrieb am Sonntag, 22. Oktober 2023 um 00:07:38 UTC+2: > 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 > -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/3b3ad872-fb5a-4e6a-92bc-65b77103db2dn%40googlegroups.com.
