HP Forums
Plotting an integral - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Plotting an integral (/thread-13798.html)



Plotting an integral - lrdheat - 10-12-2019 07:00 PM

How do I graph: integral of sin((pi * X^2)/2) from 0 to X on the Prime? It is straight forward on the CASIO fx-CG50...


RE: Plotting an integral - TheLastMillennial - 10-12-2019 07:16 PM

Instead of taking it with respect to X, replace the variable in the equation with a different one such as U.
So you'll input: the integral of sin((pi * U^2)/2) from 0 to X with respect to U.


RE: Plotting an integral - Wes Loewer - 10-12-2019 07:27 PM

(10-12-2019 07:00 PM)lrdheat Wrote:  How do I graph: integral of sin((pi * X^2)/2) from 0 to X on the Prime? It is straight forward on the CASIO fx-CG50...

You are using X for two different things in the same expression. Since you are using X in the limit, you need to use a different variable of integration. Such as

integral of sin((pi * T^2)/2) dT from 0 to X
ie,
∫(SIN((π*T^2/2)),T,0,X)

Even if your calculator allows it, using the same variable for two different meanings like this is considered improper in math. When a student writes something like this, I might not take off points, but I'd write something snarky like "I think you misspelled 't' :-)"


RE: Plotting an integral - lrdheat - 10-12-2019 07:55 PM

Wow! And so much quicker than the CASIO. Also, for extremums, Prime was quick where CASIO was very slow, and would be impossibly slow to choose the extremums that I might be interested in finding.

I had to use dT instead of using dX with a domain of 0 to T. I am still a little confused as to why, mathematically, it is incorrect to have everything in terms of X...


RE: Plotting an integral - Wes Loewer - 10-13-2019 03:00 AM

(10-12-2019 07:55 PM)lrdheat Wrote:  I am still a little confused as to why, mathematically, it is incorrect to have everything in terms of X...

[teacher hat on]
If you were to define a function
f(x)=integral from 0 to x of sin(x) dx
then you are using the first x as the limit and the other x's as the variable of integration. To calculate f(3), you substitute 3 in for x and get
f(3) = integral from 0 to 3 of sin(3) d3
which of course is meaningless.

If you instead wrote
f(x)=integral from 0 to x of sin(t) dt
Then f(3)=integral from 0 to 3 of sin(t) dt
The x has the fixed value of 3 while t varies from 0 to 3.

In the function app, if you enter
F1(X)=∫(SIN((π*T^2/2)),T,0,X)
F2(X)=∫(SIN((π*X^2/2)),X,0,X)
and then from Home enter F1(3) you get the correct result of ∫(SIN((π*T^2/2)),T,0,3), but with F2(3) you'll get an error message because it's trying evaluate ∫(SIN((π*3^2/2)),3,0,3)
[teacher hat off]


RE: Plotting an integral - lrdheat - 10-13-2019 04:06 AM

Excellent clarification. Thank you!


RE: Plotting an integral - Wes Loewer - 10-13-2019 10:47 AM

(10-12-2019 07:55 PM)lrdheat Wrote:  Wow! And so much quicker than the CASIO.

Just curious, how long does it take your Casio fx-CG50 to graph this integral, say from -3<x<3 and -1<y<1 ?

This is the type of calculation where the G2 really shines.
Prime G1: ~15 sec
Prime G2: ~4 sec


RE: Plotting an integral - Wes Loewer - 10-13-2019 11:14 AM

Okay, one more thing ...

To graph this function even faster, use the Geometry app and enter

GA:= plotode(sin(π*x^2/2),[x,y],[0,0]);

When you hit Plot, the graph should appear almost instantaneously. It's not quite as accurate as it is using approximations, but it sure is fast.


RE: Plotting an integral - ijabbott - 10-13-2019 12:56 PM

(10-13-2019 10:47 AM)Wes Loewer Wrote:  
(10-12-2019 07:55 PM)lrdheat Wrote:  Wow! And so much quicker than the CASIO.

Just curious, how long does it take your Casio fx-CG50 to graph this integral, say from -3<x<3 and -1<y<1 ?

This is the type of calculation where the G2 really shines.
Prime G1: ~15 sec
Prime G2: ~4 sec

I timed it as ~19 sec on my fx-CG50.


RE: Plotting an integral - Wes Loewer - 10-13-2019 02:05 PM

(10-13-2019 12:56 PM)ijabbott Wrote:  I timed it as ~19 sec on my fx-CG50.

That's faster than I expected. The ti nspire cx takes over a minute.


RE: Plotting an integral - lrdheat - 10-13-2019 05:18 PM

The CASIO plots the function fairly quickly, but using the trace or graph analysis options would require quite a bit of time/patience...


RE: Plotting an integral - Tim Wessman - 11-19-2019 03:13 AM

Note that we corrected this now to support, even if syntactically a bit wrong.