Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

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[14]:= Solve[
 a - K - 2 (1 + b) q - (Sqrt[K] Sqrt[zhi])/Sqrt[q] == 0, q]

Out[14]....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[3]
      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[3]
     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[35]:= a - K - 2 (1 + b) q - (Sqrt[K] Sqrt[zhi])/Sqrt[
  q] /. {a -> 10, b -> 3, K -> .1, zhi -> 1, q ->
1.2725408113389869` }

Out[35]= -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[12]:= Rt[a_, b_, K_, zhi_] :=
 FindRoot[a - K - 2 (1 + b) q - (Sqrt[K] Sqrt[zhi])/Sqrt[q], {q, 0.1}]

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

Out[13]= {q -> 1.2014371972809619}


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

Thank you in advance,

Phil
University of Rochester


  • Prev by Date: Re: Extracting graphics from notebook
  • Next by Date: Re: Turning Derivative into Function (Newbie Question)
  • Previous by thread: Re: FindInstance for sum of primes
  • Next by thread: Re: Cubic equations again...