On 07.08.21 11:52, Neven Sajko wrote:
> Hello,
>
> I have a certain Taylor series (uts) that I'd like to integrate over a
> certain variable (sym).
>
> Uts is of type UnivariateTaylorSeries(Expression(Integer),eps,0).
>
> Sym is just 'sigma::Symbol.
>
> I checked that the problem is not in the types of either uts or sym,
> because a call with equivalent types proceeds fine.
>
> The same problem appears if I do
> map(c +-> integrate(c, sym), uts)
> instead of
> integrate(uts, sym)>
> The actual error that Fricas reports is this:
> >> Error detected within library code:
> Invalid argument
I do not know what you are doing, but the following session seems to
show that integrate even works without using the map construction. The
FriCAS interpreter seems to be pretty smart here.
If you post a problem, then accompany it with a .input file that
demonstrates the problem.
BTW, as you see below I usually make the types explicit. I do not trust
the interpreter's guesses.
Ralf
========================================================================
(1) -> )set stream calc 4
(1) -> eps := "eps"::Symbol;
Type:
Symbol
(2) -> sigma := "sigma"::Symbol;
Type:
Symbol
(3) -> Z ==> Integer
Type:
Void
(4) -> E ==> Expression Z
Type:
Void
(5) -> T ==> UnivariateTaylorSeries(E,eps,0)
Type:
Void
(6) -> e := eps::T
(6) eps
Type:
UnivariateTaylorSeries(Expression(Integer),eps,0)
(7) -> s := sigma::E
(7) sigma
Type:
Expression(Integer)
(8) -> t := series([sin(s)^n/factorial(n) for n in 0..])$T
(8)
2 3 4
sin(sigma) 2 sin(sigma) 3
sin(sigma) 4
1 + sin(sigma)eps + ----------- eps + ----------- eps +
----------- eps
2 6 24
+
5
O(eps )
Type:
UnivariateTaylorSeries(Expression(Integer),eps,0)
(9) -> integrate(t,sigma)
(9)
- cos(sigma)sin(sigma) + sigma 2
sigma - cos(sigma)eps + ------------------------------ eps
4
+
3
cos(sigma) - 3 cos(sigma) 3
-------------------------- eps
18
+
3
(2 cos(sigma) - 5 cos(sigma))sin(sigma) + 3 sigma 4 5
-------------------------------------------------- eps + O(eps )
192
Type:
UnivariateTaylorSeries(Expression(Integer),eps,0)