Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: NIntegrate and Plot

  • To: mathgroup at
  • Subject: [mg30430] Re: [mg30408] NIntegrate and Plot
  • From: BobHanlon at
  • Date: Sat, 18 Aug 2001 04:04:56 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

In a message dated 2001/8/17 3:45:32 AM, y.tesiram at 

>I would like to plot the integral of,
>(Sech[betaN * x^n])^2 ,
>where beatN=121.643 and n=2 say. I have started by making a table of x
>values as
>x1 = Table[(-0.5 + ((i -1)/(np-1)), {i,1,np}];
>x2 = t1^n;
>x3 = (Sech[betaN * x^n])^2;
>I have tried NIntegrate but of course that just returns the total area

f[x_, n_:2, betaN_:121.643] := Sech[betaN*x^n]^2;

Plot[f[x], {x, -0.5, 0.5}, 
    PlotRange -> All, 
    PlotStyle -> RGBColor[0, 0, 1]];

Plot[NIntegrate[f[t], {t, -0.5, x}], 
    {x, -0.5, 0.5}, 
    PlotStyle -> RGBColor[1, 0, 0]];

To combine these plots into one, you would probably want to use separate 
scales for the curves.  See:

Bob Hanlon
Chantilly, VA  USA

  • Prev by Date: third vert axis
  • Next by Date: Re: Rotation3D, MatrixRotation3D ?
  • Previous by thread: Re: NIntegrate and Plot
  • Next by thread: RE: Re: NIntegrate and Plot