HP Forums
Plotting a function defined by an integral on HP50 - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Plotting a function defined by an integral on HP50 (/thread-3864.html)



Plotting a function defined by an integral on HP50 - cdecastro - 05-16-2015 05:46 PM

I have a couple of questions relating to graphing and differentiating functions defined by an integral.

First, when I define

y1(x)=int(1,x, 2*t, t)
y2(x)=int(1,x^2, 2*t, t)

I can perform evaluations.i.e. y1(2) and y2(2), of both functions but am not able to graph y2(x); the grapher reports a "Bad Argument" to the integration method for y2(x).

Additionally if I define y3(x) = diff(y1(x),x), nothing appears when graphed.

While I can certainly perform the differentiation prior to defining y3, I wondered why the grapher cannot deal with this issue. With regard to integration, things are trickier if the integrand does not have an antiderivative expressible in elementary terms. Is there a built-in numerical integration method I can call explicitly?

Thanks in advance for your assistance.

Chris


RE: Plotting a function defined by an integral on HP50 - dizzy - 05-16-2015 09:53 PM

(05-16-2015 05:46 PM)cdecastro Wrote:  I have a couple of questions relating to graphing and differentiating functions defined by an integral.

First, when I define

y1(x)=int(1,x, 2*t, t)
y2(x)=int(1,x^2, 2*t, t)

I can perform evaluations.i.e. y1(2) and y2(2), of both functions but am not able to graph y2(x); the grapher reports a "Bad Argument" to the integration method for y2(x).

Additionally if I define y3(x) = diff(y1(x),x), nothing appears when graphed.

While I can certainly perform the differentiation prior to defining y3, I wondered why the grapher cannot deal with this issue. With regard to integration, things are trickier if the integrand does not have an antiderivative expressible in elementary terms. Is there a built-in numerical integration method I can call explicitly?

Thanks in advance for your assistance.

Chris

Are you actually using "int"? This function only takes three arguments. Using the integral sign works for me for your y2 function.


RE: Plotting a function defined by an integral on HP50 - cdecastro - 05-16-2015 10:26 PM

I entered all the integrals using the equation writer so the 50g produced the expressions I gave. I'll try entring them with 3 parameters.

Follow up...I tried entering y2(x) = s(1,x^2,2*t,t) into the graphing window (s is the integral sign) using equation writer as previously stated...still get the "bad argument" error when I attempt to plot it. Evaluation works fine.


RE: Plotting a function defined by an integral on HP50 - peacecalc - 05-17-2015 05:31 AM

Hello,
I suppose the integral procedure works in the graphic enviroment only numerical. As the upper boundary is a real or integer expected and not an expression or function. For a workaround, any idea?

Sincerely peacecalc


RE: Plotting a function defined by an integral on HP50 - peacecalc - 05-17-2015 10:55 AM

The workaround is easy:

You define the EDIT: program instead of function (that is a very important difference! see above PP):

\[ B(X) = \int_{1}^{X^2} 2 \cdot T dT \]

and then you add in the PLOT-FUNCTION aera the line:

Y1(X) = B(X)

and let DRAW the function B(X), but beware it takes long.

Sincerely peacecalc

EDIT: PP: program for this problem:

Stored in 'B':
Code:

\<< \-> X
     \<<      @@ these are important for making a subprogram
           'S(1,X^2,2*T,T)' 
     \>>      @@ these are important for making a subprogram
\>>

S means integral sign. It is a tricky code mixing up RPN and ALG mode but it works. And really astonishing: It seems to be function with one variable but that is not true, the output is always the expression itself:

\[\int_{1}^{X^2} 2 \cdot T dT \]


RE: Plotting a function defined by an integral on HP50 - peacecalc - 05-17-2015 02:50 PM

Last explorations:

The defined function Y1(x) = B(X). If you input a numerical or a symbolic value to the stack you and press Y1 you get the answer:

\[ \int_{1}^{X^2} 2 \cdot T dT |_{X=Value} \]

and this expression can be calculated obviously in the graphic enviroment. I tried this also with an non-integrable expression like:

\[ \int_{1}^{X^2} e^{- T^2} dT \]

and it works, too! The mode of the calculator was set on "exact" and wasn't change after drawing the graph.


RE: Plotting a function defined by an integral on HP50 - C.Ret - 05-17-2015 08:47 PM

Isn't it just possible to ask the HP50g to draw y1(x) = x^2-1 and y2(x)=x^4-1 ?


RE: Plotting a function defined by an integral on HP50 - peacecalc - 05-17-2015 09:02 PM

Hello C.Ret,

of course it is, when there exist the antiderivative in a closed form (and you are able to find it (it is allowed to use the Hp 50g in finding it)). My last example in the sixth post shows the interesting case when you are able to write the integral function only in the integral and not in a closed form.

The first examples with easy integrals are only for showing the where the problem for the drawing enviroment is.

In that view your post sounds rhetorical and little bit patronizing.

Sincerely peacecalc


RE: Plotting a function defined by an integral on HP50 - cdecastro - 05-17-2015 10:50 PM

I appreciate the replies. I teach Calculus and spend a great deal of time exploring functions defined by integrals, rather than equivalent closed form expressions (when they exist), in an effort to build a deeper understanding of the process of integration and, more specifically, the Fundamental Theorem of Calculus.
As an expository approach, I explore the process of integration geometrically first before saying ANYTHING about any connection to the process of differentiation (if you tell students that integration is simply a process that in some sense "reverses" the process of differentiation - you totally remove the WOW in discovering this beautiful connection. )

Appreciatively,
Chris