sagemath / sage

Main repository of SageMath. Now open for Issues and Pull Requests.
https://www.sagemath.org
Other
1.21k stars 421 forks source link

unsolved piecewise integrals metaticket #17910

Open rwst opened 9 years ago

rwst commented 9 years ago

Archive of removed doctests testing the abs_integrate Maxima package (removed with #12731).

sage: y = function('y')                                                           
sage: integrate(1/sqrt(abs(y(x))), y(x))  # ok                                       
integrate(diff(y(x), x)/sqrt(abs(y(x))), x)
sage: integrate(sgn(x) - sgn(1-x), x)   # ok                                           
abs(x - 1) + abs(x)
sage: integrate(1 / (1 + abs(x-5)), x, -5, 6)     # ok                                 
log(11) + log(2)
sage: integrate(1/(1 + abs(x)), x)   # ok                                           
log(abs(x*sgn(x) + 1))/sgn(x)
sage: integrate(cos(x + abs(x)), x)      # ok                                       
sin(x*sgn(x) + x)/(sgn(x) + 1)
sage: integrate(sqrt(x + sqrt(x)), x).canonicalize_radical()      # ok              
1/12*(8*x + 2*sqrt(x) - 3)*sqrt(x + sqrt(x)) - 1/8*log(abs(2*sqrt(x + sqrt(x)) - 2*sqrt(x) - 1))
sage: integrate(abs(x^2 - 1), x, -2, 2) # ok                      
4
sage: f = sqrt(x + 1/x^2)
sage: integral(f, x)  # to be checked
2/3*sqrt(x^3 + 1) - 1/3*log(sqrt(x^3 + 1) + 1) + 1/3*log(sqrt(x^3 + 1) - 1)
sage: f1(x) = e^(-abs(x))
sage: f = Piecewise([[(-infinity, infinity), f1]])
sage: f.integral(definite=True)  # ok
2
sage: f.integral()
Piecewise defined function with 1 parts, [[(-Infinity, +Infinity), x |--> -1/2*((sgn(x) - 1)*e^(2*x) - 2*e^x*sgn(x) + sgn(x) + 1)*e^(-x) - 1]]

Also, these have their own tickets:

CC: @kcrisman

Component: calculus

Keywords: integration

Issue created by migration from https://trac.sagemath.org/ticket/17910

rwst commented 9 years ago

Description changed:

--- 
+++ 
@@ -19,5 +19,9 @@
 -            all
 -            sage: g = integrate(f, x); g
 -            2/3*sqrt(x^3 + 1) - 1/3*log(sqrt(x^3 + 1) + 1) + 1/3*log(sqrt(x^3 + 1) - 1)
+```

-```
+Also, these have their own tickets:
+* `integrate(x * sgn(x^2 - 1/4), x, -1, 0)` (#11590)
+* `integral(log(abs(2*sin(u))), u, 0, pi/3)` (#17468)
+* `integrate(abs(cos(x)),x,0,pi)` (#17511)
rwst commented 9 years ago

Description changed:

--- 
+++ 
@@ -19,6 +19,12 @@
 -            all
 -            sage: g = integrate(f, x); g
 -            2/3*sqrt(x^3 + 1) - 1/3*log(sqrt(x^3 + 1) + 1) + 1/3*log(sqrt(x^3 + 1) - 1)
+-            sage: f1(x) = e^(-abs(x))
+-            sage: f = Piecewise([[(-infinity, infinity), f1]])
+-            sage: f.integral(definite=True)
+-            2
+-            sage: f.integral()
+-            Piecewise defined function with 1 parts, [[(-Infinity, +Infinity), x |--> -1/2*((sgn(x) - 1)*e^(2*x) - 2*e^x*sgn(x) + sgn(x) + 1)*e^(-x) - 1]]

Also, these have their own tickets:

jdemeyer commented 9 years ago
comment:4

Never remove doctests, mark them as # known bug.

fchapoton commented 5 years ago

Changed keywords from none to abs_integrate

fchapoton commented 5 years ago
comment:6

EDIT: 6 out of the first seven are working after #27958 (and none without)

fchapoton commented 5 years ago
comment:7

This one hangs in giac:

integrate(sqrt(x + sqrt(x)), x)
fchapoton commented 5 years ago

Description changed:

--- 
+++ 
@@ -9,22 +9,15 @@
 integrate(sqrt(x + sqrt(x)), x).canonicalize_radical()
 integrate(abs(x^2 - 1), x, -2, 2)

--            sage: f = sqrt(x + 1/x^2)
--            sage: maxima = sage.calculus.calculus.maxima
--            sage: maxima('radexpand')
--            true
--            sage: integrate(f, x)
--            integrate(sqrt(x + 1/x^2), x)
--            sage: maxima('radexpand: all')
--            all
--            sage: g = integrate(f, x); g
--            2/3*sqrt(x^3 + 1) - 1/3*log(sqrt(x^3 + 1) + 1) + 1/3*log(sqrt(x^3 + 1) - 1)
--            sage: f1(x) = e^(-abs(x))
--            sage: f = Piecewise([[(-infinity, infinity), f1]])
--            sage: f.integral(definite=True)
--            2
--            sage: f.integral()
--            Piecewise defined function with 1 parts, [[(-Infinity, +Infinity), x |--> -1/2*((sgn(x) - 1)*e^(2*x) - 2*e^x*sgn(x) + sgn(x) + 1)*e^(-x) - 1]]
+sage: f = sqrt(x + 1/x^2)
+2/3*sqrt(x^3 + 1) - 1/3*log(sqrt(x^3 + 1) + 1) + 1/3*log(sqrt(x^3 + 1) - 1)
+
+sage: f1(x) = e^(-abs(x))
+sage: f = Piecewise([[(-infinity, infinity), f1]])
+sage: f.integral(definite=True)
+2
+sage: f.integral()
+Piecewise defined function with 1 parts, [[(-Infinity, +Infinity), x |--> -1/2*((sgn(x) - 1)*e^(2*x) - 2*e^x*sgn(x) + sgn(x) + 1)*e^(-x) - 1]]

Also, these have their own tickets:

fchapoton commented 2 years ago

Description changed:

--- 
+++ 
@@ -1,20 +1,51 @@
 Archive of removed doctests testing the `abs_integrate` Maxima package (removed with #12731).

-integrate(1/sqrt(abs(y(x))), y(x)) -integrate(sgn(x) - sgn(1-x), x) -integrate(1 / (1 + abs(x-5)), x, -5, 6) -integrate(1/(1 + abs(x)), x) -integrate(cos(x + abs(x)), x) -integrate(sqrt(x + sqrt(x)), x).canonicalize_radical() -integrate(abs(x^2 - 1), x, -2, 2) +sage: y = function('y')
+sage: integrate(1/sqrt(abs(y(x))), y(x)) # ok
+integrate(diff(y(x), x)/sqrt(abs(y(x))), x) +```

+ +sage: integrate(sgn(x) - sgn(1-x), x) # ok +abs(x - 1) + abs(x) + + + +sage: integrate(1 / (1 + abs(x-5)), x, -5, 6) # ok +log(11) + log(2) + + + +sage: integrate(1/(1 + abs(x)), x) # ok +log(abs(x*sgn(x) + 1))/sgn(x) + + + +sage: integrate(cos(x + abs(x)), x) # ok +sin(x*sgn(x) + x)/(sgn(x) + 1) + + + +sage: integrate(sqrt(x + sqrt(x)), x).canonicalize_radical() # ok +1/12*(8*x + 2*sqrt(x) - 3)*sqrt(x + sqrt(x)) - 1/8*log(abs(2*sqrt(x + sqrt(x)) - 2*sqrt(x) - 1)) + + + +sage: integrate(abs(x^2 - 1), x, -2, 2) # ok +4 + + + sage: f = sqrt(x + 1/x^2) +sage: integral(f, x) # to be checked 2/3*sqrt(x^3 + 1) - 1/3*log(sqrt(x^3 + 1) + 1) + 1/3*log(sqrt(x^3 + 1) - 1) +

+``` sage: f1(x) = e^(-abs(x)) sage: f = Piecewise([[(-infinity, infinity), f1]]) -sage: f.integral(definite=True) +sage: f.integral(definite=True) # ok 2 sage: f.integral() Piecewise defined function with 1 parts, [[(-Infinity, +Infinity), x |--> -1/2((sgn(x) - 1)e^(2x) - 2e^xsgn(x) + sgn(x) + 1)e^(-x) - 1]]

fchapoton commented 2 years ago

Changed keywords from abs_integrate to integration