Hi Burcin, thanks for replying! > I agree that it's confusing, but it's not a bug. > > The command > > sage: Bs = NSR(B) > > converts the polynomial B = x^3 + x in QQ[x] to a symbolic expression, > with one numeric coefficient, namely B. >
Excuse me, but I don't understand the reason for this. When does this come handful, if you can't directly translate that polynomial into a symbolic expression? > sage: Bs.coeff(x) > 0 > sage: Bs.is_constant() > True > sage: Bs.pyobject() > x^3 + x > sage: Bs.pyobject().parent() > Multivariate Polynomial Ring in x, z over Rational Field > > Since Bs is a constant w.r.t. the symbolic x, the derivative of Bs > w.r.t. the symbolic variable x is 0. > > In order to convert the polynomial to a symbolic expression, I suggest > substituting the symbolic variables in the polynomial. > > sage: B.subs(x=x) > x^3 + x > sage: t = B.subs(x=x) Is really this the correct way? Are you satisfied with this? Even if its user friendliness could be questionable, I find it rather inelegant... what do you think? I would consider switching the normal behavior, if possible. > sage: t.coeff(x) > 1 > sage: t.coeff(x^3) > 1 > sage: t.derivative(x) > 3*x^2 + 1 > > <snip> > > > A good integration algorithm probably has a couple of phases -- first > > you try some heuristics, and pattern-match against a database of known > > integrals; if those fail, then you bring out the big guns and apply > > the decision procedure. If you're interested in working on > > integration, maybe you'd rather work on the first phase? That > > probably requires more computer science and less math than the second > > phase. > > Indeed, this was what I tried to say in those comments about > integration that got Maurizio started on this track. > > There are descriptions of heuristics we can use in the maxima manual [1] > and the book by Geddes, Czapor and Labahn [2]. > > [1]http://maxima.sourceforge.net/docs/manual/en/maxima_20.html#Item_003a... > > [2]http://books.google.at/books?id=9fOUwkkRxT4C&pg=PR2&hl=en#PPA473,M1 > > It would be great if someone went through these links, and made them > more explicit/precise. As I said before, implementing these should be > within reach with the pattern matching/rewriting capabilities of pynac. > > Here is an example, pointed out to me by Clemens Raab, which maxima can > do and MMA can't: > > sage: g=log(1-x)/(polylog(2,x)^2+log(1-x)*polylog(3,x)) > sage: f = g.derivative(x) > sage: integral(f,x) > log(1 - x)/(log(1 - x)*polylog(3, x) + polylog(2, x)^2) > > Cheers, > Burcin I don't know what about those algorithms, but it seems to me that SymPy already implements some good heuristics, which can solve integrals that Mathematica can't. So can we take this as a starting point? I see that it is certainly possible to implement everything from the beginning, but a bootstrapped start seems better to me in the short term, because this could provide the user the functionalities needed. This could be useful to speed up the switch to the new symbolic system (I think you wouldn't do that without a good integration engine), and once there, you got a great exposure to bug fixing by users. Thanks Maurizio --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---