Ask Your Question

Interactive question in notebooks

asked 2012-01-21 03:25:29 -0500

Green diod gravatar image

updated 2012-01-21 09:46:27 -0500

When trying to find some solution to the double integral problem and poking around with Sage (4.7.2), I stumbled upon this behavior:

integrate(x+y^k, y)

output (resembles maxima interaction):

Traceback (click to the left of this block for traceback)
Is  k+1  zero or nonzero?

How can I answer to this (with nonzero)?

Update: I accept solution below as there seems no way as for now to interactively answer those maxima questions.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2012-01-21 06:12:53 -0500 gravatar image

Hi, you can use the assume command

integrate(x+y^k, y)

which calculates to

x*y + y^(k + 1)/(k + 1)
edit flag offensive delete link more


Ok, thanks, that solves this particular question. But in general, how can one answer to interactive questions?

Green diod gravatar imageGreen diod ( 2012-01-21 08:42:34 -0500 )edit

I do not understand what you mean with interactive questions. It is an error code from sage which gives you information where the error is and what to correct so the code can compile completely. gravatar ( 2012-01-21 09:00:48 -0500 )edit

I would have preferred to have the possibility to answer nonzero to the above question i.e. interactively as I would in Maxima. But maybe it's not possible and the only solution is to add extra-assumptions and evaluate again as in your proposed solution.

Green diod gravatar imageGreen diod ( 2012-01-21 09:30:25 -0500 )edit

You are correct.

kcrisman gravatar imagekcrisman ( 2012-01-21 09:49:52 -0500 )edit

answered 2012-01-21 10:47:35 -0500

achrzesz gravatar image

You can avoid the question:

sage: x,y,u,v,p,k=var('x,y,u,v,p,k')

sage: integrate(x+y^k, y,algorithm='sympy')

x*y + y^(k + 1)/(k + 1)

edit flag offensive delete link more


Could you tell me where this algorithm option is documented? I'm going to try that for my [original problem](

Green diod gravatar imageGreen diod ( 2012-01-21 11:34:17 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-01-21 03:25:29 -0500

Seen: 387 times

Last updated: Jan 21 '12