Thanks Waldek, that is quite useful. In fact my goal is actually to get from the definite integral (a convolution):
integrate( (((2*y+(-2*x+-1))*abs((2*y+(-2*x+1))/2)+(-2*y+(2*x+-1))*abs((2*y+(-2*x+-1))/2))*abs(y))/(8*y^2+-16*x*y+(8*x^2+-2)), y=%minusInfinity..%plusInfinity ) to ((2*x+1)*abs((2*x+1)/2)+(-2*x+1)*abs((2*x+-1)/2))/8 See: http://axiom-wiki.newsynthesis.org/SandBoxSignum#eq23 Maple has no trouble with this. On 18 July 2014 12:39, Waldek Hebisch <[email protected]> wrote: > Bill Page wrote: >> >> I would like to tell FriCAS that >> >> integrate(abs(x),x) = x*abs(x) >> >> How can I do t that? Where to start? I can see where the derivative of >> abs is declared in combfunc using the basic operator functionality. >> Wouldn't it be nice if it was possible to do something similar for >> integrals? > > You can add any integral you wish to the pattern matching > integrator, that is 'intpm.spad'. Currently patterns are > specified by code, but in principle we could allow > user defined patterns. However, this is of limited use. > Namely, unlike differentiation, there is no simple > way to integrate a product given integrals of factors. Yes, I see. > So, in practice, when you add a pattern you add ability > to do a specific integral, but for similar looking integral > you need new pattern. > > Concerning 'abs', FriCAS can do some integrals containing 'abs' > like: > > (1) -> D(exp(abs(x)), x) > > abs(x) > abs(x)%e > (1) -------------- > x > Type: Expression(Integer) > (2) -> integrate(%, x) > > abs(x) > (2) %e > Type: Union(Expression(Integer),...) > > but will fail on any nontivial example (and many trivial ones). > We could easily add ability to do large class of indefinite > integrals containing 'abs' using method from papers: > > D. J. Jeffrey, G. Labahn, M. v. Mohrenschildt, A. D. Rich, > Integration of the signum, piecewise and related Functions > http://citeseer.ist.psu.edu/jeffrey97integration.html I had some trouble with citeseer but found this http://dl.acm.org/citation.cfm?id=258726.258830 > D. J. Jeffrey, A. D. Rich, Recursive integration of > piecewise-continuous functions, > http://citeseer.ist.psu.edu/jeffrey97recursive.html > and this http://dl.acm.org/citation.cfm?doid=281508.281649 Thank you! > However, I am affraid that this would lead to several > wrong definite integrals. To handle definite integrals > correctly we would probably need stronger continuity test > and extra code to choose antidervative which avoids > branch cuts. > In the case of abs branch cuts are not a problem, right? signum(x) in Maple and in the papers above is not quite abs(x)/x, specifically there is a choice of values at x=0. But I was thinking that for many functions containing abs it might be possible to do quite a lot without explicitly introducing a signum(x)~=abs(x)/x or resorting to piecewise functions or distributions as such. Perhaps I am wrong? -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.
