Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have the following equation:

$$D=\frac{1}{64} \pi A ^3 B \sin \left(C\right)-\frac{1}{2} \pi A B \sin \left(C\right)$$

which I want to solve for $A$. The equation is cubic in $A$ so this should give me 3 answers and, potentially, imaginary parts to the answers. I know, from the physical meaning of the parameters, that all parameters ($A$,$B$,$C$ and $D$) are positive and real.

My question is: how can I use Solve on this equation and make sure that there will be no imaginary parts popping up in the solution?

I have used the suggestion by Chris and tried:

Solve[d == 1/64 π a^3 b Sin[c] - 1/2 π a b Sin[c], a, Reals]

but I still see that there is a $\imath\sqrt{3}$ term in the answer. Why does this still appear?

share|improve this question
    
related? mathematica.stackexchange.com/questions/3369/… –  chris Feb 26 '13 at 20:34
    
Not exactly. I found this post but I would like Solve to work with the assumptions already 'in mind'. Not `change' the answer afterwards –  Michiel Feb 26 '13 at 20:37
2  
Solve[F[x],x,Reals] as suggested in reference.wolfram.com/mathematica/ref/Solve.html ? e.g. 'Solve[x^3 + 2 x^2 + 3 x + 4 == 0, x, Reals] // N' –  chris Feb 26 '13 at 20:38
    
That is actually a good point. I didn't know that Solve had that option. I tried using $Assumptions, but that didn't help. Thanks! –  Michiel Feb 26 '13 at 20:41
    
`Solve[x^3 + 2 x^2 + 3 x + 4 == 0, x, Reals] // ToRadicals // First // First' gives you the formal unique real root –  chris Feb 26 '13 at 20:44
show 8 more comments

1 Answer 1

up vote 1 down vote accepted

You can use the Reals Domain option in Solve as in

 Solve[x^3 + 2 a x^2 + 4 == 0, x, Reals] // ToRadicals // First // First

Mathematica graphics

For the example above, calling d=2D/Pi/B/Sin[C]

 Solve[d == 1/32  A^3  -  A , A, Reals] // ToRadicals // First //First // FullSimplify

Mathematica graphics

share|improve this answer
    
I have done what you mentioned, except for the //First//First part, because that will give me the wrong 1 of the 3 answers. –  Michiel Feb 26 '13 at 20:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.