sage: assume(x>1)
sage: F(x)=integral(sin(t)/t,t,1,x)
sage: F
x |--> 1/2*I*gamma_incomplete(0, -I*x) - 1/2*I*gamma_incomplete(0,
I*x) - 1/2*I*gamma_incomplete(0, -I) + 1/2*I*gamma_incomplete(0, I)
sage: F.derivative()
x |--> 1/2*D[1](gamma_incomplete)(0, -I*x) + 1/2*D[1](gamma_incomplete)
(0, I*x)

So I don't think this is what you mean, exactly.

Do you mean you want something like

sage: G(x)=integral((sin(t))^.5/t,t,1,x); G
x |--> integrate(sin(t)^0.5/t, t, 1, x)
sage: G.derivative()
<snip>
    223             ans = SR(0)
    224         return ans + f.subs(x==b)*b.diff(diff_param) \
--> 225                     - f.subs(x==a)*a.diff(diff_param)
    226
    227     def _print_latex_(self, f, x, a, b):

<snip>
AttributeError: 'sage.rings.integer.Integer' object has no attribute
'diff'

to work?  Incidentally, the error here is a little weird - apparently
we aren't allowing these purely symbolic integrals to have integer
endpoints, only symbolic ones, since this works:

sage: G(x)=integral((sin(t))^.5/t,t,x,x^2); G
x |--> integrate(sin(t)^0.5/t, t, x, x^2)
sage: G.derivative(x)
x |--> 2*sin(x^2)^0.5/x - sin(x)^0.5/x

and so does this

sage: f = function('f',x)
sage: var('t')
t
sage: I = integral(f,x,t,t^2)
sage: I
integrate(f(x), x, t, t^2)
sage: I.derivative(t)
2*t*f(t^2) - f(t)

So maybe we should change that code, or make sure integers always have
derivative zero.  But anyway I think that will turn out to be somewhat
orthogonal to what you are discussing.  Please let us know more
precisely what you would like to have work, and what answer you should
get.

- kcrisman

On Jan 26, 10:43 am, Andrea Gobbi <[email protected]> wrote:
> Hi!
> I have a question...I'm working with integral functions:
>
> var('t,x')
> f(t)=t^2
> F(x)=integral(f,t,0,x)
>
> and obviously:
>
> F(x).derivative() give x^2 as result.
>
> Now the question is: can i have the same result if f doesn't admit a
> primitive? I think that when sage "sees" integral(f,t,0,x), tries to
> compute a primitive G and then assigns to F the difference between
> G(x) and G(0). In this way when i try to calculate the derivative of
> F, the result is f.
> For example:
>
> var('t,x')
> f(t)=t^2
> F(x)=integral(sin(t)/t,t,1,x,assume(x>1))
>
> I look at the reference manual and I  find a section in which we can
> force a funcion to have a rule for the derivation  (pag. 252)  but I
> don't understand how to do this. Sorry for my awful english!
> Thank you!
> Best regards!
> Andrea Gobbi

-- 
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-support
URL: http://www.sagemath.org

Reply via email to