# Math question

This is a discussion on Math question within the A Brief History of Cprogramming.com forums, part of the Community Boards category; No, I am not looking for a code solution, I am looking for where to go to get a "tutorial" ...

1. ## Math question

No, I am not looking for a code solution, I am looking for where to go to get a "tutorial" on how to solve the attached equation.

Thanks.

2. what has this got to do with C++ programming?

3. I am attempting to implement it in C++, but have not touched this level of math in at least a decade. I don't even know what to call this type of formula. I don't want to get a C++ solution. I am looking for a bord that might discuss this type of math or how discussion/tutorial on implementing such math in C++

4. well, I'd start by reading up on polynomial equations

5. Moved to General Discussions.

6. How? Matlab or mathematica

7. One common way to find the roots of an arbitrary polynominal is to construct a matrix with the desired roots as eigenvalues (search for "companion matrix"). Then use an iterative way ("power iteration" is simple, "QR algorithm" is somewhat more advanced, but popular) to find the eigenvalues.

You can also try to find a root using Newton's method and then divide the polynominal by (x-root) to reduce it to degree 4. There will always be at least one real root.

8. Originally Posted by leonm54
No, I am not looking for a code solution, I am looking for where to go to get a "tutorial" on how to solve the attached equation.

Thanks.
Viola!
Code:
float solve_poly (float a0, float a1, float a2, float a3, float a4, float a5, float x) {
return a0 + a1 * x + a2 * x * x + a3 * x * x * x + a4 * x * x * x * x + a5 * x * x * x * x * x;
}
Honestly... 'solve' is a very vague word.

9. Originally Posted by QuestionC
Honestly... 'solve' is a very vague word.
Is it?´He said "how to solve the attached equation". I think it is pretty clear what he meant.