#4721: [with patch; needs work] Indefinite integration for piecewise functions
-------------------------+--------------------------------------------------
 Reporter:  pbutler      |        Owner:  burcin    
     Type:  enhancement  |       Status:  new       
 Priority:  minor        |    Milestone:  sage-3.4.1
Component:  calculus     |   Resolution:            
 Keywords:               |  
-------------------------+--------------------------------------------------
Changes (by wdj):

  * summary:  [with patch; partial positive review] Indefinite integration
              for piecewise functions => [with patch; needs
              work] Indefinite integration for piecewise
              functions

Comment:

 Sorry, I didn't see this earlier or I would've reviewed it.

 This does not seem to work as advertised. There was a long thread in sage-
 devel which I though settled some design issues. One of them was that the
 FTC should be true for this indefinite integral. For example, the indef
 int F of the function f defined on (-4,3)

 {{{

  sage: f1(y) = -1
  sage: f2(y) = y + 3
  sage: f3(y) = -y - 1
  sage: f4(y) = y^2 - 1
  sage: f5(y) = 3
  sage: f =
 Piecewise([[(-4,-3),f1],[(-3,-2),f2],[(-2,0),f3],[(0,2),f4],[(2,3),f5]])
  sage: F = f.integral(y)

 }}}

 should have the property that F(3)-F(-4) is the area under the curve.
 This *is* true, as the following shows:

 {{{
 sage: f.integral(y,(-4,3))
 19/6
 sage: F(3)-F(-4)
 19/6
 }}}

 This is not tested. In my option, this needs to be added to the docstring.

 *However*, what the docstring says is "If definite=True is given, returns
 the definite integral."
 I don't know what the output

 {{{
 sage: f.integral(definite=True)
 2*(y^2 - 1) + y + 2*(-y - 1) + 5
 }}}

 means. I would expect it to be 19/6. Don't you assume the function is 0
 outside
 (-4,3)? In any case, the definite integral seems incorrect, and is not
 consistenet
 with the old behaviour, as you said it would be in the thread referred to
 above.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4721#comment:8>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to