ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 19 Nov 2021 21:20:38 +0100User defined functionhttps://ask.sagemath.org/question/59838/user-defined-function/I'm working with beta distribution and its integral. A straightforward integral of beta distribution would return the hypergeometric form of the incomplete beta function. This makes my results very messy and difficult to work with. I have been able to define a function class IncBeta as
def D_t(self, t, z, w, **kwds):
return t^(z-1)*(1-t)^(w-1)#/beta(z, w)
IncBeta=function('IncBeta', nargs=3, derivative_func=D_t, latex_name='I_x')
Is there a way that I can define an inverse function class of the above and tell Sage the integral of that inverse function leads to IncBeta?Fri, 19 Nov 2021 17:39:20 +0100https://ask.sagemath.org/question/59838/user-defined-function/Comment by Emmanuel Charpentier for <p>I'm working with beta distribution and its integral. A straightforward integral of beta distribution would return the hypergeometric form of the incomplete beta function. This makes my results very messy and difficult to work with. I have been able to define a function class IncBeta as</p>
<pre><code>def D_t(self, t, z, w, **kwds):
return t^(z-1)*(1-t)^(w-1)#/beta(z, w)
IncBeta=function('IncBeta', nargs=3, derivative_func=D_t, latex_name='I_x')
</code></pre>
<p>Is there a way that I can define an inverse function class of the above and tell Sage the integral of that inverse function leads to IncBeta?</p>
https://ask.sagemath.org/question/59838/user-defined-function/?comment=59842#post-id-59842What you seek is a way to define some `integrate_func` ; as far as I know, there is no easy way to do that.
It should be noted that, even if `Maxima` "knows" that :
(%i21) diff(beta_incomplete(a, b, z), z);
(%o21) (1-z)^(b-1)*z^(a-1)
it won't use it to compute :
(%i22) integrate(x^(a-1)*(1-x)^(b-1), x);
(%o22) 'integrate((1-x)^(b-1)*x^(a-1),x)
Your problem is not limited to Sage...Fri, 19 Nov 2021 21:20:38 +0100https://ask.sagemath.org/question/59838/user-defined-function/?comment=59842#post-id-59842