Integral of a equation

Write a function to calculate the following integral ∫8z + 4z3 − 6z2 dz. Pass the coefficient as parameters to the function. The function must not return any thing and just print the output.
solve the integral is hard (in code)
calculate this integral is easy.

to calculate it, you just need to work the problem by hand and then code up whatever the equation is. Assuming those are supposed to be exponents, it looks like

y = 4*Z*Z + Z*Z*Z*Z - 2*z*z*z + 0 (0 for C?)


is this what you meant or is the question supposed to be "solve this"?
Last edited on
You could possibly store the coefficients in a std::vector<int>. The first element would have an exponent of size-1, second would be size-2, third would be size-3, etc...
For example,
1
2
3
4
5
6
7
8
9
{ 4, 6, 8, 0 }
size = 4
4x3
+
6x2
+
8x1
+
0x0

Then you can just do as you would on paper.
agreed, except I would have the index of the vector be the power of x, personally.
Topic archived. No new replies allowed.