Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.