       Cubic equations again...

• To: mathgroup at smc.vnet.net
• Subject: [mg115469] Cubic equations again...
• From: pjl52 <LEDERER at SSB.ROCHESTER.EDU>
• Date: Tue, 11 Jan 2011 19:23:30 -0500 (EST)

```Related questions have been asked here before but I do not see how
they apply to the following problem.

I have solved a cubic equation using Solve to get an analytic
solution.  In the case I am dealing with I am interested in a real
root.

I then plug in the actual values of coefficients into the real
solution generated and get an answer that is incorrect.

Here are the details:

In:= Solve[
a - K - 2 (1 + b) q - (Sqrt[K] Sqrt[zhi])/Sqrt[q] == 0, q]

Out....presents three solutions, the first I simplify and then
assign to a function solq:

solq[a_, b_, K_, zhi_]=(a (1 + b) - (1 + b) K + (3 Sqrt
Sqrt[(1 + b)^7 K zhi (-2 (a - K)^3 + 27 (1 + b) K zhi)] + (1 +
b)^3 (-(a - K)^3 + 27 (1 + b) K zhi))^(
1/3))^2/(6 (1 +
b)^2 (3 Sqrt
Sqrt[(1 + b)^7 K zhi (-2 (a - K)^3 + 27 (1 + b) K zhi)] + (1 +
b)^3 (-(a - K)^3 + 27 (1 + b) K zhi))^(1/3))

Evaluating: solq[10, 3, .1, 1]
I get 1.2725408113389869 + 0. I  ( a real number).

Now evaluating

In:= a - K - 2 (1 + b) q - (Sqrt[K] Sqrt[zhi])/Sqrt[
q] /. {a -> 10, b -> 3, K -> .1, zhi -> 1, q ->
1.2725408113389869` }

Out= -0.5606529814237877

So the solution is wrong.

The actual solution is q=1.2014371972809619

which can be confirmed by graphing or numerical solution using
FindRoot

In:= Rt[a_, b_, K_, zhi_] :=
FindRoot[a - K - 2 (1 + b) q - (Sqrt[K] Sqrt[zhi])/Sqrt[q], {q, 0.1}]

In:= Rt[10, 3, .1, 1]

Out= {q -> 1.2014371972809619}

Does Solve not find the root, or is the problem evaluation of the
analytical expression with the selected values?