<?xml version="1.0" encoding="UTF-8"?>

<record version="11" id="4237">
 <title>completing the square</title>
 <name>CompletingTheSquare</name>
 <created>2003-05-02 07:14:40</created>
 <modified>2008-12-15 13:29:29</modified>
 <type>Algorithm</type>
 <creator id="2727" name="mathcam"/>
 <author id="2727" name="mathcam"/>
 <author id="1858" name="matte"/>
 <classification>
	<category scheme="msc" code="00A20"/>
 </classification>
 <related>
	<object name="SquareOfSum"/>
 </related>
 <preamble>% this is the default PlanetMath preamble.  as your knowledge
% of TeX increases, you will probably want to edit this, but
% it should be fine as is for beginners.

% almost certainly you want these
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\newcommand{\sR}[0]{\mathbb{R}}


% used for TeXing text within eps files
%\usepackage{psfrag}
% need this for including graphics (\includegraphics)
%\usepackage{graphicx}
% for neatly defining theorems and propositions
%\usepackage{amsthm}
% making logically defined graphics
%\usepackage{xypic}

% there are many more packages, add them here as you need them

% define commands here</preamble>
 <content> Let us consider the expression $x^2+xy$, where
 $x$ and $y$ are real (or complex) numbers.
 Using the formula
 $$(x+y)^2 = x^2+2xy +y^2$$
 we can write
 \begin{eqnarray*}
 x^2+xy &amp;=&amp; x^2+xy+ 0\\
 &amp;=&amp; x^2+xy+ \frac{y^2}{4}-\frac{y^2}{4}\\
 &amp;=&amp; \left(x+\frac{y}{2}\right)^2-\frac{y^2}{4}.
 \end{eqnarray*}
 This manipulation is called \emph{completing the square} \cite{adams} in
 $x^2+xy$, or completing the square $x^2$.
 
Replacing $y$ by $-y$, we also have
 $$x^2-xy = \left(x-\frac{y}{2}\right)^2-\frac{y^2}{4}.$$

Here are some applications of this method:
\begin{itemize}
\item 
 \PMlinkname{Derivation of the solution formula to the quadratic equation}{DerivationOfQuadraticFormula}.
\item Putting the general equation of a circle, ellipse, or hyperbola into standard form, e.g. the circle 
\begin{align*}
x^2+y^2+2x+4y=5\Rightarrow (x+1)^2 + (y+2)^2= 10,
\end{align*}
from which it is frequently easier to read off important information (the center, radius, etc.)
\item Completing the square can also be used to find the extremal value
of a quadratic polynomial \cite{thompson} without calculus. 
Let us illustrate this for the polynomial $p(x)=4x^2+8x+9$. 
Completing the square yields
\begin{eqnarray*}
p(x)   &amp;=&amp; (2x+2)^2-4 +9 \\
 &amp;=&amp; (2x+2)^2+5 \\
 &amp;\ge &amp; 5,
\end{eqnarray*}
since $(2x+2)^2\ge 0$. Here, equality holds if and 
only if $x=-1$.
Thus $p(x)\ge 5$ for all $x\in \sR$, and $p(x)=5$ if and only if
$x=-1$. 
It follows that $p(x)$ has a global minimum at $x=-1$, where $p(-1)=5$.
\item Completing the square can also be used as an integration technique
to integrate, for example the function $\displaystyle \frac{1}{4x^2+8x+9}$ \cite{adams}.
\end{itemize}


\begin{thebibliography}{9}
\bibitem {adams} R. Adams, \emph{Calculus, a complete course}, 
	Addison-Wesley Publishers Ltd, 3rd ed. 
\bibitem {thompson} 
        \emph{Matematiklexikon} (in Swedish), 
 J. Thompson, T. Martinsson, Wahlstr\"om \&amp; Widstrand, 1991.        
\end{thebibliography}

(Anyone has an English reference?)</content>
</record>
