MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to enter an integral in a formula and have mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109001] Re: How to enter an integral in a formula and have mathematica
  • From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
  • Date: Sat, 10 Apr 2010 06:51:39 -0400 (EDT)

Hi, Jim,
I am not quite sure that I've got your question right, but in case I did, execute this:

(* Here it is assumed that your (stuff)=1 and your g(s,x)=exp(-x*s^2). This can be changed   *)

f1[x_] := 1 + \!\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(1\)]\(Exp[\(-x\)*
\*SuperscriptBox[\(s\), \(2\)]] \[DifferentialD]s\)\);

or this

f2[x_] := 1 + NIntegrate[Exp[-x*s^2], {s, 0, 1}];

You can then check 

f1[1]
f2[1]


1 + 1/2 Sqrt[\[Pi]] Erf[1]

1.74682

or make graphs out of these functions. For instance, evaluate this:
Plot[f2[x], {x, 0, 3}]

Hope this helps. Alexei


I have a certain integral, part of a larger expression, that can be
expressed in terms of incomplete gamma functions by Mathematica.  But
in carrying out the definite integral and forcing it to be written in
terms of gamma functions, this introduces branch points and other
unnecessary complications.  I want the integral left alone and
evaluated numerically, but I still want to express the general formula
for this large expression with the unevaluated integral in place.

For example, I'd like

f[x_] = (stuff) + int_{0}^{1} (g[s,x]) ds

where the definite integral is expressed in the usual Mathematica
notation.

What I do *not* want Mathematica to do at this stage is to do the
integral analytically and write it in terms of special functions.
Instead, I just want to later make a list of values for  f[x]  and
have the integral done numerically.

How can I program this?

Thanks,
Jim

-- 
Alexei Boulbitch, Dr., habil.
Senior Scientist

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 Contern
Luxembourg

Phone: +352 2454 2566
Fax:   +352 2454 3566

Website: www.iee.lu

This e-mail may contain trade secrets or privileged, undisclosed or otherwise confidential information. If you are not the intended recipient and have received this e-mail in error, you are hereby notified that any review, copying or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal from your system. Thank you for your co-operation.




  • Prev by Date: Re: Mathematica Programming
  • Next by Date: Re: if using Mathematica to solve an algebraic problem
  • Previous by thread: Re: Simultaneous Nonlinear Data Fits
  • Next by thread: Re: Surprising behaviour with nested pure functions and