Last week's challenge dealt with multiprecision computations. It needed

some amount of real programming work, so it didn't get

as many replies as previous, easier ones.

This week's challenge is therefore shorter & sweeter as it needs just

a little empirical search, plus simple formula-fitting and evaluation

programming and a pinch of theoretical work thrown in for good measure.

**Foreword**

Imagine that you are a Maths teacher and you are preparing tomorrow's

class, which will introduce your students to ** Cardano's formula** for

solving the reduced cubic equation:

x^3 + p*x + q = 0

Given ** p** and

**, Cardano's formula gives this value for x:**

*q*

x = CURT(-q/2+SQRT((q/2)^2+(p/3)^3)) + CURT(-q/2-SQRT((q/2)^2+(p/3)^3))

where SQRT means "square root" and CURT means "cube root". Though

the formula isn't really particularly complex, you are understandably

worried that your students will find it somewhat complicated and

weird-looking, so you decide that giving a simple numerical example will

make it seem all the more familiar.

With this noble idea in mind, you then try this example, to be developed

in the class:

x^3 + 2*x - 7 = 0

This corresponds to p = 2 and q = -7, and Cardano's formula gives:

x = CURT(7/2 + SQRT(49/4+8/27)) + CURT(7/2 - SQRT(49/4+8/27))

= CURT(7/2 + SQRT(1355/108)) + CURT(7/2 - SQRT(1355/108))

= CURT(7/2 + 3.54207513984) + CURT(7/2 - 3.54207513984)

= CURT(7.04207513984) + CURT(-0.04207513984)

= 1.9167562361864 - 0.3478098331340

= 1.5689464030524

which is indeed a root of the equation. Let's check it:

x^3+2*x-7 = 1.5689464030524^3 + 2*1.5689464030524 - 7

= 3.862107193895 + 3.137892806105 - 7

= 0

Now, you fear understandably that such festival of floating point,

many-decimal numbers will not really make the point any simpler, and

will probably bore your intended audience, faced with using their

calculators extensively in order to find the answer and check it as well. So, you are kept

wondering:

"What I really need is to find a simpler example, some suitable values

for p and q which will make all intermediate and final results small

integer or rational numbers, so that no calculator shall be necessary

to perform the computations and the whole process will seem much simpler,

allowing my students to focus on the formula, not on the computational

drudgery"

So that's what S&SMC#5 is all about:

**The Challenge**

*Use your favorite HP calculator to try and find values of p and q*

which will make**all**intermediate and final results in the evaluation

of Cardano's formula either exact integers or rational fractions, so

that no irrational number ever appears and all computations can be

carried out either mentally or simply by hand.

- Once you have found a sufficiently large number of solutions (p,q), use

your HP calculator to find suitable formulas that will generate them all

(polynomial fitting, perhaps ?) or deduce such formulas theoretically.

Ideally, the formulas would take as input the desired value for the

final root, and would produce p and q such that the resulting cubic

equation would have that root and would be extremely simple to solve, as requested.

**Recommended HP calculator**

- For finding solutions (p,q) any programmable model will do, from

the HP-10C or HP-25C onwards. The faster, the merrier, but the

programming itself is pretty trivial. - For fitting the solutions to a polynomial, I guess any model from an

HP-11C onwards will be adequate.

**Estimated difficulty and allotted time**

Pretty easy. Really "short and sweet" this time. Also, you have **two weeks** to try your hand with this challenge. At the

end of that period, I'll post the usual ** Final Remarks**,

including solutions and snippets of code if necessary.

If the number of postings in this thread warrants it,

I will then post the next challenge, S&SMC#6.

By the way, I can't resist: if any of you finally developed some

multiprecision routines, you can test that the root of the above

equation, to 77 decimals places, is:

x = 1.56894640305238226735233475168775140550168711365188103792946945170655431302272