Ralf Hemmecke wrote:
>
> On 11/30/2014 04:47 PM, Waldek Hebisch wrote:
> > Without forcing real expressions we get:
> >
> > (4) -> a:=integrate(f,x)
> >
> > (4)
> > +----------+
> > +----------+ +---+ | +---+ +-+
> > | +---+ (2\|- 1 + 2)sin(x)\|\|- 1 - 1 - 2\|2 cos(x)
> > \|\|- 1 - 1 log(----------------------------------------------)
> > cos(x) + 1
> > +
> > +------------+
> > +------------+ +---+ | +---+ +-+
> > | +---+ (2\|- 1 - 2)sin(x)\|- \|- 1 - 1 - 2\|2 cos(x)
> > - \|- \|- 1 - 1
> > log(------------------------------------------------)
> > cos(x) + 1
> > +
> > +------------+
> > +------------+ +---+ | +---+ +-+
> > | +---+ (- 2\|- 1 + 2)sin(x)\|- \|- 1 - 1 - 2\|2 cos(x)
> > \|- \|- 1 - 1
> > log(--------------------------------------------------)
> > cos(x) + 1
> > +
> > +----------+
> > +----------+ +---+ | +---+ +-+
> > | +---+ (- 2\|- 1 - 2)sin(x)\|\|- 1 - 1 - 2\|2 cos(x)
> > - \|\|- 1 - 1 log(------------------------------------------------)
> > cos(x) + 1
> > /
> > +-+
> > 4\|2
> > Type:
> > Union(Expression(Integer),...)
> >
> >
> > The problem is that limit code can not handle complex expressions,
> > so definite integrals would fail.
>
> Well, I guess, some people would prefer such an expression. Would there
> be a way to have an option to "integrate" to allow complex coefficients.
> complexIntegrate also returns e^(%I*x) which might be a bit too much.
The result above was obtained with the following one line
change:
--- ../ax-build140/src/algebra/FSINT.spad 2014-11-28 11:08:13.000000000
-0500
+++ FSINT.spad 2014-11-30 11:06:10.000000000 -0500
@@ -129,7 +129,7 @@
f := eval(f, ltan, [k::F for k in ltemp])
f := eval(f, TANTEMP, 2, halfangle)
f := eval(f, ltemp, [Khalf k for k in ltemp])
- f := try_real(f)
+ -- f := try_real(f)
f := removeSinSq f
removeConstantTerm(f, x)
We would need some way to pass information to 'postSubst' function.
Simple way would be to have a global variable and some way to set
it. Alternatively we could pass extra argumenent to 'integrate'.
Or do like 'guess' did: have a special structure to record options
and pass it around when needed. 'guess' way is most elegant, but
requires most work. Global variables are easy to add, but cause
trouble in long way.
In the long term I would like to get rid of 'real' here. My
plan is to generate 'rootOf' construct instead. But this first
requires good support for 'rootOf', in particular in 'normalize'
and in power series expanders.
--
Waldek Hebisch
[email protected]
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.