Plotting a function defined by an integral
12-18-2013, 04:05 PM
Post: #1
 cdecastro Junior Member Posts: 22 Joined: Dec 2013
Plotting a function defined by an integral
Noticed the following issue when plotting a function defined by an integral expression.

in CAS mode, I defined a function
f1:=(d)->int(x^2,x,0,d)

The function correctly evaluates at various points on the CAS home screen
f1(2)=8/3
f1(4)=64/3

Additionally, the following statement correctly places the function of X in the Function App window (plot symbolic screen)
F1:=f1

however, no plot is produced and the calculator indicates that F1 is undefined. Is this a limitation of the Function APP or am I overlooking something?

Appreciatively,
Chris
12-18-2013, 05:29 PM
Post: #2
 Helge Gabert Senior Member Posts: 467 Joined: Dec 2013
RE: Plotting a function defined by an integral
If I put the integral directly into Symb function app:

say, F1(X)=\int_0^X Y^2 dY,

it does plot (you can see some dots being plotted), but without a connecting line, and in Num view, all X values get evaluated correctly.
12-19-2013, 03:18 PM
Post: #3
 cdecastro Junior Member Posts: 22 Joined: Dec 2013
RE: Plotting a function defined by an integral
(12-18-2013 05:29 PM)Helge Gabert Wrote:  If I put the integral directly into Symb function app:

say, F1(X)=\int_0^X Y^2 dY,

it does plot (you can see some dots being plotted), but without a connecting line, and in Num view, all X values get evaluated correctly.

When I enter the expression manually as you suggested, I do see points plotted. However, when I assign the function indirectly via an assignment (as previously described), I see no points (initially). Eventually, the plot does appear. This is because it takes "Forever and a day" (~1.5-2 min) for the calculator to do all the requisite integral evaluations. Needless to say, one can forget about scrolling around in the plot given this lag.
It seems the adaptive plotting routines could use some refinement- as the manually entered plot does not show enough detail (unconnected points) and the one entered programmatically generates too much (perhaps) detail in generating the plot.
12-19-2013, 05:01 PM (This post was last modified: 12-19-2013 05:02 PM by Tim Wessman.)
Post: #4
 Tim Wessman Senior Member Posts: 2,293 Joined: Dec 2013
RE: Plotting a function defined by an integral
F1(X)=f1 will not work. You have no 'X' variable to work with. I am guessing trying F1(X)=approx(f1(X)) will work fine.

Without that approx, you are getting symbolic objects out and it has no number to work with except in places where it evaluates down to a real whole number.

TW

Although I work for HP, the views and opinions I post here are my own.
12-19-2013, 06:19 PM
Post: #5
 cdecastro Junior Member Posts: 22 Joined: Dec 2013
RE: Plotting a function defined by an integral
(12-19-2013 05:01 PM)Tim Wessman Wrote:  F1(X)=f1 will not work. You have no 'X' variable to work with. I am guessing trying F1(X)=approx(f1(X)) will work fine.

Without that approx, you are getting symbolic objects out and it has no number to work with except in places where it evaluates down to a real whole number.

When I assign:
f1:=(d)->int(x^2,x,0,d);
F1:=f1;

the graph will plot; It just takes a long time. Obviously it is much faster if I make the graphing window narrower. I'll give your suggestion a try. Thanks for the reply.
 « Next Oldest | Next Newest »

User(s) browsing this thread: