project






If y=f(x) where x changes from Xo to Xk with step dx. Use while or do while loop
y=arctg(x) + [x][/3] + 4, where X0=1, Xk=2, dx=0.1



Good luck with it.
Please I need help. I need clue to this task. Can anyone help me because I am new to C++
I'm going to guess what your question is based on the scant information above. Is your question:

"Please explain to me how to calculate the integral (with respect to x) of the equation y=arctg(x) + [x][/3] + 4 over the interval x=1 to x=2, by means of a programmatical solution using steps of 0.1 for dx"?
Last edited on
@ Moschops you are right. I am to run the task on C++.
Well, it's pretty easy to do, just look at the tutorial page I gave and make sure you understand: data types, control structures and variables. That is really all you need to do this. You may also want to know that the arctangent function is defined in <cmath>.
There are many mathematical methods you can use to do this. An easy one to start with is commonly known as the "rectangle method". I think the Wiki page includes a complete C programme that almost does the whole thing for you.
Here is what I have done so far. Please I need help bccos I am confused:

#include <cstdlib>
#include <iostream>
#include <math.h>


using namespace std;

int main(int argc, char *argv[])
{

float x = xo=1;
float delta x = 0.1;
while (x<=xk)
{
y=actg(x)+xxxx+4
x=x+delta x;

}

cout << y << endl;


system("PAUSE");
return EXIT_SUCCESS;
}
Read the documentation and discover what the name of the function is in the cmath library (do not use math.h, this is C++) that carries out the arctan function. It's not called actg.

This task requires a knowledge of programming, C++ and math. However, it can be done by reading the wiki page I gave you earlier and making a smart guess about what to change in the provided example C program.
Last edited on
Topic archived. No new replies allowed.