# Generating 'easy-to-solve' polynomial equations to test function in computer science

I have a file i need to write a unit test for that includes a number of polynomial functions, and i need to provide test data to the function to calculate and compare them with an exact answer(preferably a whole number that i could easily compute myself with some math). I have to test:

• Multiplication
• Scaling
• Subtraction
• Synthetic Division
• Cubic Roots
• Quartic Roots

most of these will be easy to come up with 'simple' equations to test, but i'm a little stuck once i reach synthetic division and multiplication of polynomials. Could anyone give me a couple "nice" equations that equate to some whole numbers i can use in my tests, even better a method for creating such equations to test?

-
You want to generate polynomials with known solutions ? – Amr Dec 18 '12 at 4:17
exactly, i need solved polynomials to test that the function produced the right value. – Need4Sleep Dec 18 '12 at 4:25

For example: $(x+1)(x+2)(x-2)=x^3+x^2-2x-2$. The roots of $x^3+x^2-2x-2$ are $-1,-2,2$.