Re: Integration with non-numeric parameters
- To: mathgroup at smc.vnet.net
- Subject: [mg79767] Re: Integration with non-numeric parameters
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sat, 4 Aug 2007 05:47:33 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <f8v1cb$ded$1@smc.vnet.net>
ingramfinance at gmail.com wrote: (*snip*) > But when I try > > q=Exp[-(x1-t)^2/2*sigma^2*t] > > Integrate[q, {t, .5,1}] > > Now Mathematica does not solve this integral, it just repeats the > command > > > > I am trying to get an expression in terms of x1. Why do I get a > statement like this instead of an answer? (*snip*) It is conventional (by design) that Mathematica returns an expression unevaluated when Mathematica does not know how to evaluate this expression. This can happen for user-defined functions as well as built-in functions (though in special circumstances). For instance, having started a new Mathematica session, if we try to evaluate f[2], Mathematica just returns f[2] since it has not the slightest idea of what the function f can possibly do. In[1]:= f[2] Out[1]= f[2] Now, we give a definition (a meaning) to the symbol f. In[2]:= f[x_] = 2 x Out[2]= 2 x From now on, evaluating f will return a value. In[3]:= f[2] Out[3]= 4 Of course, *Integrate* is a built-in function that has already a meaning. Still, if Mathematica does not know how to find a definite or indefinite integral, it returns the original expression as answer. For instance, Mathematica knows how to integrate E^(-x^2) (in terms of error function) and E^(-x^3) (in terms of gamma function) but not E^(-x^3 - x^2) (the expression is returned unevaluated). In[1]:= Integrate[Exp[-x^2], x] Out[1]= 1/2 Sqrt[\[Pi]] Erf[x] In[2]:= Integrate[Exp[-x^3], x] Out[2]= -((x Gamma[1/3, x^3])/(3 (x^3)^(1/3))) In[3]:= Integrate[Exp[-x^3 - x^2], x] Out[3]= Integrate[E^(-x^2 - x^3), x] Regards, Jean-Marc