Completing the square
Author: Bee Math Tutor

a =

b =

c =

A3 = -4
B3 = -8
C3 = 12
inputBox1 = Textfield(A3)
inputBox2 = Textfield(B3)
inputBox3 = Textfield(C3)
B4: B3 / A3
C4: C3 / A3
B5: B4 / 2
B6: (B5 * B5)
D6: C4 - B6
D7: (A3 * D6)
B7: (-B5)
f = Function((A3 * x^(2)) + (B3 * x) + C3, -50, 50)
g = Function(x^(2) + (B4 * x) + C4, -50, 50)
text2: "$ f(x)=" + (LaTeX[f]) + " $"
text3: "$ f(x)=" + (LaTeX[A3]) + "[" + (LaTeX[g]) + "] $"
h = Function(x^(2) + (B4 * x) + B5^(2) - B5^(2) + C4, -50, 50)
p = Function((x + B5)^(2) - B6 + C4, -50, 50)
text6: "$ f(x)=" + (LaTeX[A3]) + "[" + (LaTeX[h]) + "] $"
text7: "$ f(x)=" + (LaTeX[A3]) + "[" + (LaTeX[p]) + "] $"
C6: C4 - B6
q = Function((x + B5)^(2) + C6, -50, 50)
text8: "$ f(x)=" + (LaTeX[A3]) + "[" + (LaTeX[q]) + "] $"
r = Function((A3 * (x + B5)^(2)) + D7, -50, 50)
text9: "$ f(x)=" + (LaTeX[r]) + " $"
text5: "NB. The maximum or minimum value of f(x) is " + D7 + ", and this occur when x = " + B7 + ""
text4: "<---- Factor out the coefficient of x² . [i.e. " + A3 + "]
.
<---- Add and subtract the square of half the coefficient of x. [i.e. (" + B5 + ")]
.
<---- The 1st three terms form a perfect square which factor to (x + " + B5 + ")² .
.
<---- The last two terms are added together to give " + D6 + ".
.
<---- The outside parentheses [squared brackets] are 
        removed by multipying by " + A3 + "."
text1: "......................... Rewrite\; the\; function\; $f(x) = " + (LaTeX[f]) + " \;in\; the\; form\; $f(x) = a(x + h)^2 + k  ......................"