English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am supposed to make a C++ program able to solve this by inputing numbers but I am very confused about it.Please help!

2007-07-17 09:07:53 · 2 answers · asked by Bigbob22 2 in Computers & Internet Programming & Design

2 answers

Don't you have an integral calc book?

Anyway, they probably also told you if it was... what's the term, is it "left sum" "right sum" and "middle sum"... can't remember. Anyway, basically it tells you where the "box" is relative to the point sampled.

Here's a quick link to what the heck they're talking about:
http://www.maths.abdn.ac.uk/~igc/tch/ma1002/int/node19.html

Basically, what you need to do is sample the function at even intervals, and add all the rects.
(a rect = width * height)
y = function = height
width = (a-b)/n
where a and b are your low and high bounds of the definate integral. Think about it. It's not too hard.

In terms of programming, well, figure out the starting and stopping point. Figure out each step's size. Throw it in a loop, and add up those y*x_step pieces.
You're done!

-Anonymous

2007-07-17 10:11:59 · answer #1 · answered by anonymous 2 · 0 0

It has been a while since basic non-calculus math that we all took, why don't you teach us how N-rectangle should work? I know this equation is a snap to integrate and hence a cakewalk to find area that way.

it is x^3 + 2.5x^2 + 10x by the way.

2007-07-17 09:23:10 · answer #2 · answered by Andy T 7 · 0 0

fedest.com, questions and answers