Yrogirg wrote:
>
> I need to find definite integrals of type
>
> integrate(exp(-a*p^2),p = %minusInfinity..%plusInfinity)
>
> for which FriCAS gives me "failed". Even
>
> integrate(exp(-a^2*p^2),p = %minusInfinity..%plusInfinity)
>
> fails, although integrate(exp(-a^2*p^2),p) works. How can I evaluate
> the first integral (assuming a>0)?
>
I am not sure what you really want. You presumably want some
different integral, because for this one you can simply use
the known value.
For the
integrate(exp(-a^2*p^2),p = %minusInfinity..%plusInfinity)
FriCAS gives "failed" because it currently can not compute
limit of 'erf'. You can work around such problem by
computing
(15) -> i := integrate(exp(-a^2*p^2),p = b..c)
+---+
(erf(a c) - erf(a b))\|%pi
(15) ---------------------------
2a
Type: Union(f1: OrderedCompletion(Expression(Integer)),...)
(16) -> eval(ii, [erf(a*c) = 1, erf(a*b) = 0])
+---+
\|%pi
(16) ------
2a
Type: Expression(Integer)
If FriCAS gives you back unevaluated indefinite integral this
(except for bugs) means that integral can not be done using
elementary functions. Some such integrals can be done using
"well-known" special functions (like erf above). Currently
FriCAS has quite limited capabilities for handling such
integrals. Basically FriCAS first tries to extract elementary
part and then tries to pattern-match the integral to some
known form. But pattern-matching frequetly is unreliable:
small change in integral causes match to fail. Also, small
change in form of integral may cause significant change to
the result. In your case using a instead of a^2 means that
result should contain square root, so needs different pattern
than case of 'a^2'.
If your integrals are related to known special functions it
may be possible to teach FriCAS about it like:
(18) -> intrule := rule integral(exp(-a*p^2),p) == sqrt(%pi)/sqrt(a)
p 2 +---+
++ - %A a \|%pi
(18) | %e d%A == ------
++ +-+
\|a
Type: RewriteRule(Integer,Integer,Expression(Integer))
(19) -> intrule integral(exp(-a*p^2),p)
+---+
\|%pi
(19) ------
+-+
\|a
Type: Expression(Integer)
Remarks:
- This is of little use if you have single integral to do. But you
can define more rules which together handle several integrals.
Also, rules can replace parts of expression.
- It is possible to define rules for indefinite integrals, but only
if limits are finite (limits have to be expressions, but %plusInfinity
is not an expression).
--
Waldek Hebisch
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
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/fricas-devel?hl=en.