Ask Your Question

# Radical Sign in answer?

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 close merge delete

## 1 answer

Sort by ยป oldest newest most voted

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.

more

## Comments

Worked like a charm, thank you for the help.

( 2013-03-19 10:45:30 -0600 )edit

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

( 2013-03-20 04:49:10 -0600 )edit

## Your Answer

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

Add Answer

## Stats

Asked: 2013-03-19 06:02:41 -0600

Seen: 87 times

Last updated: Mar 19 '13