ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 26 Oct 2018 07:08:37 -0500Indefinite integral is incorrecthttp://ask.sagemath.org/question/44077/indefinite-integral-is-incorrect/`indefinite_integral(sqrt(1+cos(x)**2), x).full_simplify()` gives `1/6*sin(x)^3`, which is incorrect.
proy87Fri, 26 Oct 2018 07:08:37 -0500http://ask.sagemath.org/question/44077/Two ways of integrating x↦xⁿsin(x) give contradictory results. Bug?http://ask.sagemath.org/question/36185/two-ways-of-integrating-x-xnsinx-give-contradictory-results-bug/**First way:**
var('x,n')
integral(x^n*sin(x),x)
gives just
integrate(x^n*sin(x), x)
not very informative, let us try to add an assumption to get nicer results.
**Second way:**
assume(n,'integer')
integral(x^n*sin(x),x)
gives
1/4*(((-1)^n - 1)*gamma(n + 1, I*x) - ((-1)^n - 1)*gamma(n + 1, -I*x))*(-1)^(-1/2*n)
Uhm, looks better, but... wait, isn't `(-1)^n-1` equal to `0` for even values of `n` ? That would make the whole thing equal to `0` for even `n`.
I = integral(x^n*sin(x),x)
for k in range(10):
print I.subs(n==2*k)
prints only `0`s. Weird, non-zero functions should not have zero integrals.
**Third way :**
Let us try to do the integration with particular values of `n`.
for n in range(5):
print integral(x^n*sin(x),x)
prints
-cos(x)
-x*cos(x) + sin(x)
-(x^2 - 2)*cos(x) + 2*x*sin(x)
-(x^3 - 6*x)*cos(x) + 3*(x^2 - 2)*sin(x)
Looks better, but is clearly different from the previous answer.
**Question:**
I am working on the cloud, with SageMath 7.4 kernel. Is this a bug or did I misunderstood the meaning of the `'integer'`assumption ?
If this is a bug, how should I report it, is posting this question here enough ?
P.S. I did read the [wiki page about reporting bugs](http://doc.sagemath.org/html/en/developer/trac.html#reporting-bugs), but, gosh, is it really necessary to have a google account in order to report a bug ? Both sage-devel and sage-support are on Google Groups. lbWed, 04 Jan 2017 14:44:16 -0600http://ask.sagemath.org/question/36185/Wrong error messagehttp://ask.sagemath.org/question/28851/wrong-error-message/The best things in Sage are 'mathematica_free'. No, no, I never would say this!
(exp(2*x)/cosh(exp(x))).integral(x,algorithm='mathematica_free')
I*(log(I*e^(-e^x) + 1) - log(-I*e^(-e^x) + 1))*e^x + I*polylog(2, I*e^(-e^x)) - I*polylog(2, -I*e^(-e^x))
BUT:
(exp(3*x)/cosh(exp(x))).integral(x,algorithm='mathematica_free')
AttributeError: 'NoneType' object has no attribute 'groups'
I think Sage wanted to say: "Mathematica could not find a formula for your integral."
Peter LuschnyMon, 17 Aug 2015 05:16:08 -0500http://ask.sagemath.org/question/28851/Plotting an integral with a variable as a limithttp://ask.sagemath.org/question/8820/plotting-an-integral-with-a-variable-as-a-limit/I want to plot a function with a variable as a limit, e.g. look at \int_0^x f(y) d y, but this seems to throw an error when Sage can't analytically integrate the function.
x,y=var('x y')
f(y)=integrate(x^x,x,1,y)
plot(f,2,10)
Returns
Traceback (click to the left of this block for traceback)
...
ValueError: free variable: x
Can anybody help with this, please? Many thanks.tom12519Wed, 28 Mar 2012 10:52:02 -0500http://ask.sagemath.org/question/8820/integral from sin at plus minus infinity seems to be badhttp://ask.sagemath.org/question/24412/integral-from-sin-at-plus-minus-infinity-seems-to-be-bad/This doesn't seem right to me
integrate(sin(x), x, -oo, +oo)
0
And this looks bad at all
integrate(sin(x), x, -oo, +2*oo)
0
Why this happening?koteMon, 06 Oct 2014 17:01:53 -0500http://ask.sagemath.org/question/24412/integral() failing with "segmentation fault"http://ask.sagemath.org/question/10966/integral-failing-with-segmentation-fault/Hi sage community
My question again arises from exercises in technical chemistry done in sage. I wanted to calculate an definite integral (number of transfer units).
var('x')
ys=0.06+2*(x-0.0275)
xs=ys/1.516
#my function
i=1/(xs/(1+xs)-x/(1+x))
#print i
#show(plot(i,x,0,0.03))
#I, the indefinite integral of i
I=integral(i,x)
#print I
#show(plot(I,x,0,0.03))
#three methods too calculate the integral
print n(I(x=0.0275)-I(x=0))
print numerical_integral(i,0,0.0275)
print integral(i,x,0,0.275)
The first two methods work fine. The last method gives me the infinite of the following messages.
;;;
;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt
;;;
This is a bug, isn't it? However, i have no idea how integrate() works.
Greetings, marvmarvMon, 27 Jan 2014 03:37:16 -0600http://ask.sagemath.org/question/10966/