First time here? Check out the FAQ!

Ask Your Question
0

Solving equation with sqrt

asked 12 years ago

Jonas gravatar image

updated 12 years ago

calc314 gravatar image

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!

Preview: (hide)

4 Answers

Sort by » oldest newest most voted
0

answered 12 years ago

achrzesz gravatar image

Squaring 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]
Preview: (hide)
link
0

answered 5 years ago

rel gravatar image

You 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)})
Preview: (hide)
link
0

answered 12 years ago

Majid Khonji gravatar image

ridiculous sage!!

I just try to remove the square root manually then solve. It is just a workaround I try.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 1,472 times

Last updated: Nov 05 '12