On Sun, Jul 23, 2023 at 04:53:12PM +0000, '68th' via FriCAS - computer algebra
system wrote:
> Okay, here's the integrand:
>
> ex1 := (1+tan(gamma/2)^2)/(k^2+l^2*tan(gamma/2)^2)
>
> Let's find the antiderivative:
>
> ex2 := integrate(ex1,gamma)
>
> And this is a simpler variant of the antiderivative:
>
> ex3 := (2*atan(l/k*tan(gamma/2)))/(k*l)
>
> Let's do a simple comparison:
>
> normalize(ex2-ex3)
>
> Oops, the difference is -π/(2kl). However:
>
> D(ex2,gamma)-D(ex3,gamma)
>
> returns zero.
> How can make FriCAS find the simpler antiderivative?
Ideally FriCAS sould automatically find simpler form. ATM we
are getting more complex one, depending on point of view this
is a bug or missing feature. I you want more info, you
can see intermediate results of integration. Namely do:
)trace INTEF )math
and then issue integration command. This produces a bit
more of output, but the important part is:
2 2 2 2 %i gamma 2 2
--+ 2 %i k l (l - k )%e - l - k
> %E log(--------- %E + -----------------------------)
--+ 2 2 2 2
2 1 l - k l - k
%E + ---- = 0
2 2
k l
The sum part means sum over roots of polynomial below the summation
sign. This is quadratic polynomial with two purely imaginary
roots. So we get expression in terms logarithms with complex
arguments. Theory says that this is simplest possible expression
of similar form.
The final result is obtained transforming complex logaritms into
sums of atan and real logarithm. Above real logarithm cancel
and what remains is sum of two identical atans, so has only
one term. When done naively, this transformation results in
effect that you see (some people call it "atan doubling").
Transformation code performs extra computation designed to avoid
this effect. But in this case it does not work.
--
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/ZL2PVvydHuioq4ef%40fricas.math.uni.wroc.pl.