Completing the Square

Completing the Square can be seen as relating a quadratic to its "perfect square parent".

Complete the Square

+

+

set b =

set c =

@farrarscott
www.scottfarrar.com

t = 2 (slider from 0 to 2, step 0.01)
t_1 = Min(t, 1)
g = Function({9.622135331408963, 23.587163892952123, 4.14497316841929, 4.14497316841929, 4.14497316841929, 4.14497316841929, 4.14497316841929, 4.151349893789858, 4.157726619160425, 4.164103344530993, 4.1704800699015605, 4.176856795272128, 4.176856795272128, 4.176856795272128, 4.176856795272128, 4.176856795272128, 4.187484670889741, 4.198112546507354, 4.208740422124967, 4.208740422124967, 4.208740422124967, 4.208740422124967, 4.208740422124967, 4.208740422124967, 4.229996173360192, 4.251251924595418, 4.272507675830643, 4.2831355514482565, 4.293763427065869, 4.304391302683482, 4.320333116109901, 4.336274929536319, 4.352216742962739, 4.368158556389158, 4.368158556389158, 4.368158556389158, 4.368158556389158, 4.368158556389158, 4.368158556389158, 4.378786432006771, 4.389414307624383, 4.400042183241996, 4.421297934477221, 4.442553685712447, 4.463809436947672, 4.474437312565285, 4.485065188182898, 4.495693063800511, 4.495693063800511, 4.495693063800511, 4.495693063800511, 4.495693063800511, 4.516948815035736, 4.538204566270962, 4.559460317506187, 4.570088193123801, 4.580716068741413, 4.591343944359026, 4.612599695594251, 4.633855446829476, 4.655111198064702, 4.655111198064702, 4.655111198064702, 4.655111198064702, 4.655111198064702, 4.655111198064702, 4.665739073682315, 4.676366949299928, 4.686994824917541, 4.686994824917541, 4.686994824917541, 4.686994824917541, 4.686994824917541, 4.708250576152767, 4.729506327387992, 4.750762078623217, 4.76138995424083, 4.772017829858442, 4.782645705476055, 4.782645705476055, 4.782645705476055, 4.782645705476055, 4.782645705476055, 4.782645705476055, 4.80390145671128, 4.825157207946506, 4.846412959181731, 4.942063839740246, 4.942063839740246, 4.942063839740246, 4.942063839740246, 4.942063839740246, 4.942063839740246, 4.952691715357859, 4.963319590975472, 4.973947466593085, 4.995203217828311, 5.016458969063536, 5.037714720298761, 5.048342595916374, 5.0589704715339865, 5.069598347151599, 5.090854098386825, 5.11210984962205, 5.133365600857276, 5.165249227710114, 5.197132854562953, 5.2290164814157905, 5.239644357033403, 5.2502722326510165, 5.260900108268629, 5.282155859503855, 5.30341161073908, 5.3246673619743055, 5.335295237591918, 5.345923113209531, 5.356550988827144, 5.377806740062369, 5.399062491297595, 5.4203182425328205, 5.5159691230913355, 5.526596998708949, 5.537224874326561, 5.547852749944173, 5.569108501179399, 5.5903642524146235, 5.61162000364985, 5.622247879267462, 5.632875754885075, 5.643503630502688, 5.691329070781945, 5.739154511061203, 5.760410262296428, 5.781666013531654, 5.80292176476688, 5.834805391619717, 5.866689018472556, 5.898572645325394, 5.930456272178232, 5.962339899031071, 5.994223525883909, 6.089874406442424, 6.100502282060037, 6.11113015767765, 6.121758033295262, 6.169583473574519, 6.2174089138537765, 6.249292540706615, 6.281176167559454, 6.3130597944122915, 6.4087106749708065, 6.440594301823644, 6.472477928676483, 6.504361555529321, 6.552186995808578, 6.600012436087836, 6.621268187323061, 6.642523938558287, 6.663779689793512, 6.759430570352027, 6.807256010631285, 6.855081450910542, 6.886965077763381, 6.918848704616219, 6.950732331469057, 7.07826683888041, 7.126092279159668, 7.173917719438925, 7.269568599997439, 7.317394040276696, 7.365219480555954, 7.38647523179118, 7.407730983026404, 7.42898673426163, 7.652172122231498, 7.684055749084337, 7.715939375937175, 7.747823002790013, 7.827532069922109, 7.907241137054204, 8.00289201761272, 8.050717457891977, 8.098542898171234, 8.226077405582586, 8.273902845861844, 8.321728286141102, 8.417379166699616, 8.465204606978872, 8.51303004725813, 8.672448181522322, 8.736215435227999, 8.799982688933676, 8.89563356949219, 8.943459009771448, 8.991284450050705, 9.08693533060922, 9.134760770888477, 9.182586211167735, 9.278237091726249, 9.326062532005507, 9.373887972284765, 9.756491494518823, 9.80431693479808, 9.852142375077339, 10.01156050934153, 10.059385949620786, 10.107211389900044, 10.170978643605721, 10.234745897311397, 10.298513151017074, 10.521698538986941, 10.569523979266199, 10.617349419545457, 10.872418434368162, 10.920243874647419, 10.968069314926677, 11.191254702896545, 11.223138329749384, 11.25502195660222, 11.28690558345506, 11.414440090866412, 11.541974598277765, 11.63762547883628, 11.685450919115539, 11.733276359394795, 11.956461747364663, 11.988345374217502, 12.020229001070339, 12.052112627923178, 12.099938068202434, 12.147763508481692, 12.243414389040208, 12.291239829319466, 12.339065269598722, 12.434716150157236, 12.455971901392461, 12.477227652627688, 12.498483403862913, 12.546308844142171, 12.594134284421427, 12.604762160039039, 12.615390035656652, 12.626017911274266, 12.721668791832782, 12.742924543068007, 12.764180294303232, 12.785436045538457, 12.833261485817715, 12.881086926096973, 12.891714801714585, 12.902342677332198, 12.91297055294981, 13.008621433508326, 13.02987718474355, 13.051132935978776, 13.072388687214001, 13.083016562831615, 13.093644438449227, 13.10427231406684, 13.152097754346098, 13.199923194625354, 13.22117894586058, 13.242434697095804, 13.263690448331031, 13.274318323948643, 13.284946199566257, 13.29557407518387, 13.327457702036709, 13.359341328889547, 13.391224955742384, 13.41248070697761, 13.433736458212834, 13.454992209448061, 13.486875836300898, 13.518759463153737, 13.550643090006576, 13.561270965624189, 13.571898841241802, 13.582526716859414, 13.614410343712251, 13.64629397056509, 13.678177597417928, 13.699433348653153, 13.72068909988838, 13.741944851123606, 13.83759573168212, 13.848223607299731, 13.858851482917345, 13.869479358534958, 13.890735109770183, 13.911990861005409, 13.933246612240636, 13.965130239093474, 13.997013865946313, 14.02889749279915, 14.039525368416761, 14.050153244034377, 14.060781119651988, 14.082036870887213, 14.103292622122439, 14.124548373357664, 14.135176248975277, 14.14580412459289, 14.156432000210502, 14.17768775144573, 14.198943502680955, 14.22019925391618, 14.230827129533793, 14.241455005151403, 14.252082880769017, 14.273338632004242, 14.294594383239469, 14.315850134474694, 14.326478010092307, 14.337105885709919, 14.347733761327532, 14.368989512562758, 14.390245263797985, 14.411501015033208, 14.42212889065082, 14.432756766268433, 14.443384641886047, 14.443384641886047, 14.443384641886047, 14.443384641886047, 14.443384641886047, 14.443384641886047, 14.475268268738885, 14.507151895591724, 14.539035522444562, 14.539035522444562, 14.539035522444562, 14.539035522444562, 14.539035522444562, 14.560291273679788, 14.581547024915013, 14.602802776150238, 14.602802776150238, 14.602802776150236, 14.602802776150236, 14.602802776150238, 14.602802776150238, 14.613430651767851, 14.624058527385463, 14.634686403003077, 14.655942154238303, 14.677197905473529, 14.698453656708754, 14.698453656708754, 14.698453656708754, 14.698453656708754, 14.698453656708754, 14.709081532326366, 14.719709407943979, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.73033728356159, 14.751593034796818, 14.772848786032043, 14.794104537267268, 14.794104537267268, 14.794104537267268, 14.794104537267268, 14.794104537267268, 14.794104537267268, 14.794104537267268, 14.794104537267268, 14.794104537267268, 14.794104537267268, 14.804732412884881, 14.815360288502495, 14.825988164120107, 14.825988164120107, 14.825988164120107, 14.825988164120107, 14.825988164120107, 14.825988164120108, 14.825988164120108, 14.825988164120108, 14.825988164120108, 14.825988164120107, 14.84724391535533, 14.868499666590557, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782, 14.889755417825782})
D = Point(g)
E = Point(g)
animX: x(E) - x(D)
V = (5, -3)
animY: y(E) - y(D)
B: (x(V), 0)
u = Vector(V, B)
G: (x(D) + (t_1 * animX), g(x(D) + (t_1 * animX)))
C: V + (u * (y(G) - y(D)) / animY)
h: abs(x(C))
f = Polynomial((x - x(C))^(2) + y(C))
h_1 = Polynomial((x - x(V))^(2) + y(V))
k: y(V)
t_2 = Max(t - 1, 0)
F: (x(V), (t_2 * k))
v = Vector(C, F)
a: y(F)
text4: "" + (LaTeX[a]) + ""
text3: "+" + (LaTeX[a]) + ""
text5: "y=" + (LaTeX[h_1]) + ""
p = Polynomial(h_1(x) - h_1(0))
c: x = x(V)
text1: "" + (LaTeX[f]) + ""
text7: "(x+" + (LaTeX[h]) + ")^2"
V_1 = (10.410069751795575, 6.4072234806104165)
B_1: (x(V_1), 0)
k_1: y(V_1)
t_3 = Max(t - 1, 0)
F_1: (x(V_1), (t_3 * k_1))
a_1: y(F_1)
text3_1: "" + (LaTeX[a]) + ""
text8: "y=(x-" + (LaTeX[h]) + ")^2"
ga: 1
gb = -10
gc = 22
InputBox1 = Textfield(gb)
InputBox2 = Textfield(gc)