1 | initial version |
The command limit
is used to take limits of functions, not to set limits on definite integrals. You're probably looking for the command
f.integral(t,0,t)
Once the limit
command is removed and this is put in, Maxima (the package used to evaluate integrals in SageMath) will ask you some questions about variable values. You can set those using the assume
command.
You can also evaluate the integral by getting the indefinite integral and subtracting the value at zero using the subs
command. Here's the code for both ways of doing this, including assumptions needed to get an answer back from Maxima:
var('c,H,k,d,x,t')
assume(H>0, d>0, t>0, e^(c*k*t/d)-1>0)
f=(c * H * (sech(k / d * (x - c * t))^2))/(d + H * (sech(k / d*(x - c * t))^2))
show( f.integral(t,0,t) )
int = f.integral(t)
show( int - int.subs(t=0) )
The show
command just makes the output look better: here's a live example of the two results. They look different, but if you assign numerical values to variables and plot them you'll find they're the same. The second is a bit more simplified and may be more useful.