ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 31 Mar 2019 04:38:03 -0500Solving equation with sqrthttp://ask.sagemath.org/question/9500/solving-equation-with-sqrt/Hello!
I'm trying to solve the following equation:
sage: var('a b c')
(a, b, c)
sage: a==b-sqrt(b**2-c**2/4)
a == b - sqrt(b^2 - 1/4*c^2)
sage: solve(_, b)
[b == a + sqrt(b^2 - 1/4*c^2)]
In the last line Sage doesn't solve the equation for b completely. Can you give me a hint what I'm doing wrong?
Thank you!
Mon, 05 Nov 2012 00:30:09 -0600http://ask.sagemath.org/question/9500/solving-equation-with-sqrt/Answer by rel for <p>Hello!</p>
<p>I'm trying to solve the following equation:</p>
<pre><code>sage: var('a b c')
(a, b, c)
sage: a==b-sqrt(b**2-c**2/4)
a == b - sqrt(b^2 - 1/4*c^2)
sage: solve(_, b)
[b == a + sqrt(b^2 - 1/4*c^2)]
</code></pre>
<p>In the last line Sage doesn't solve the equation for b completely. Can you give me a hint what I'm doing wrong?
Thank you!</p>
http://ask.sagemath.org/question/9500/solving-equation-with-sqrt/?answer=45958#post-id-45958You could use SymPy's solver instead of Maxima, which is used by default in Sage:
sage: var('a b c')
sage: eq = (a==b-sqrt(b^2-c^2/4))
sage: solve(eq,b, algorithm='sympy')
ConditionSet(b, Eq(a - b + sqrt(4*b**2 - c**2)/2, 0), {(4*a**2 + c**2)/(8*a)})Sun, 31 Mar 2019 04:38:03 -0500http://ask.sagemath.org/question/9500/solving-equation-with-sqrt/?answer=45958#post-id-45958Answer by Majid Khonji for <p>Hello!</p>
<p>I'm trying to solve the following equation:</p>
<pre><code>sage: var('a b c')
(a, b, c)
sage: a==b-sqrt(b**2-c**2/4)
a == b - sqrt(b^2 - 1/4*c^2)
sage: solve(_, b)
[b == a + sqrt(b^2 - 1/4*c^2)]
</code></pre>
<p>In the last line Sage doesn't solve the equation for b completely. Can you give me a hint what I'm doing wrong?
Thank you!</p>
http://ask.sagemath.org/question/9500/solving-equation-with-sqrt/?answer=14450#post-id-14450ridiculous sage!!
I just try to remove the square root manually then solve. It is just a workaround I try.Sat, 12 Jan 2013 03:12:35 -0600http://ask.sagemath.org/question/9500/solving-equation-with-sqrt/?answer=14450#post-id-14450Answer by achrzesz for <p>Hello!</p>
<p>I'm trying to solve the following equation:</p>
<pre><code>sage: var('a b c')
(a, b, c)
sage: a==b-sqrt(b**2-c**2/4)
a == b - sqrt(b^2 - 1/4*c^2)
sage: solve(_, b)
[b == a + sqrt(b^2 - 1/4*c^2)]
</code></pre>
<p>In the last line Sage doesn't solve the equation for b completely. Can you give me a hint what I'm doing wrong?
Thank you!</p>
http://ask.sagemath.org/question/9500/solving-equation-with-sqrt/?answer=14228#post-id-14228Squaring equations may lead to wrong solutions
but if you need the solution given in Wolframalpha
you can do:
var('a b c') ;
eq=a == b - sqrt(b^2 - 1/4*c^2)
solve((eq-b)^2,b)
[b == 1/8*(4*a^2 + c^2)/a]Mon, 05 Nov 2012 02:43:40 -0600http://ask.sagemath.org/question/9500/solving-equation-with-sqrt/?answer=14228#post-id-14228