I've decided to learn Maple My school provides modules to work on in the actual Maple class here, so I found some copies online and am learning it... And am now stuck.
Here's what I have
This outputs to something like this
Okay, that's all fine and dandy. But what I want to do in addition to this is add a plot of the summations for i intervals for the function f. This, normally, can be achieved by using this: rightbox(f,x=0..1,i) over the interval x=0 to x=1 for the function f with i intervals. This will output something that looks like this:
This specific picture graphs the line 3x^2 as well as the Riemann Sum from 0 to 1 using four sub-intervals and the right endpoints of the graph.
Now my question is.. How would I integrate this rightbox command into my Integral procedure? I've tried just about every combination I can think of, and the help files that came with Maple aren't any help. I'm hoping someone here might know what to do. Thanks for any assistance
To further clarify, I want it to output the integral of the expression, the Riemann Sum for i sub intervals, and the error associated with the number of sub-intervals and the actual integral over the interval [0,1] as well as the graph generated by the rightbox command.
Here's what I have
Code:
[COLOR="red"]>Integral:=proc(f,i)
local JExact,S,R,E;
JExact:=int(f,x=0..1);
S:=rightsum(f,x=0..1,i);
R:=evalf(%);
E:=evalf(abs(JExact-R));
RETURN(
[Integral]=JExact,
[Right_Sum]=S,
[Right_Sum_Eval]=R,
[Error]=E
);
end;[/COLOR]
[COLOR="#4169e1"]Integral := proc (f, i) local JExact, S, R, E, pl; JExact := int(f, x = 0 .. 1); S := rightsum(f, x = 0 .. 1, i); R := evalf(%); E := evalf(abs(JExact-R)); rightbox(f, x = 0 .. 1, i); RETURN([Integral] = JExact, [Right_Sum] = S, [Right_Sum_Eval] = R, [Error] = E) end proc[/COLOR]
This outputs to something like this
Code:
>[COLOR="red"]Integral(3*x^2,4);[/COLOR]
[COLOR="#4169e1"][Integral] = 1, [Right_Sum] = (1/4)*(Sum((3/16)*j^2, j = 1 .. 4)), [Right_Sum_Eval] = 1.406250000, [Error] = .406250000[/COLOR]
Okay, that's all fine and dandy. But what I want to do in addition to this is add a plot of the summations for i intervals for the function f. This, normally, can be achieved by using this: rightbox(f,x=0..1,i) over the interval x=0 to x=1 for the function f with i intervals. This will output something that looks like this:
This specific picture graphs the line 3x^2 as well as the Riemann Sum from 0 to 1 using four sub-intervals and the right endpoints of the graph.
Now my question is.. How would I integrate this rightbox command into my Integral procedure? I've tried just about every combination I can think of, and the help files that came with Maple aren't any help. I'm hoping someone here might know what to do. Thanks for any assistance
To further clarify, I want it to output the integral of the expression, the Riemann Sum for i sub intervals, and the error associated with the number of sub-intervals and the actual integral over the interval [0,1] as well as the graph generated by the rightbox command.