Ask Your Question
0

Radical Sign in answer?

asked 2013-03-19 12:02:41 +0100

anonymous user

Anonymous

updated 2013-03-19 12:59:59 +0100

How do I get an output like the following to look more like we would write it by hand?

Sage: t = var('t')

Sage: S = solve(-16t^2 + 48t + 5, t)

Sage: S

[t == -1/4sqrt(41) + 3/2, t == 1/4sqrt(41) + 3/2]

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-03-19 13:32:01 +0100

Rolandb gravatar image

Use variables to solve the equation symbolically:

var('a','b','c','t')

S = solve([at^2 + bt + c], t)

print S

[t == -1/2(b + sqrt(-4ac + b^2))/a,t == -1/2(b - sqrt(-4ac + b^2))/a]

Then define g:

g(a,b,c,t)=S[0].rhs()

show(g)

$\newcommand{\Bold}[1]{\mathbf{#1}}\left( a, b, c, t \right) \ {\mapsto} \ -\frac{b + \sqrt{-4 \ a c + b^{2}}}{2 \ a}$

That is how I would write it by hand.

Proof of concept:

g(-16,48,5)

1/4*sqrt(41) + 3/2

I hope it helps.

edit flag offensive delete link more

Comments

Worked like a charm, thank you for the help.

hsmit506 gravatar imagehsmit506 ( 2013-03-19 16:45:30 +0100 )edit

If you liked the answer, feel free to upvote it and accept the answer!

kcrisman gravatar imagekcrisman ( 2013-03-20 10:49:10 +0100 )edit

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: 2013-03-19 12:02:41 +0100

Seen: 381 times

Last updated: Mar 19 '13