File:Completing the square.svg

From Department of Mathematics at UTSA
Jump to navigation Jump to search

Original file(SVG file, nominally 170 × 513 pixels, file size: 39 KB)

This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

Summary

Description
English: Geometric derivation of completing the square.
Date
Source Own work
Author Krishnavedala
SVG development
InfoField
 
The SVG code is valid.
 
This vector image was created with LaTeX.
Source code
InfoField

LaTeX code

Source code
\documentclass[10pt,border=1pt,crop,multi=false,tikz,class=scrartcl]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{mathtools}

\usetikzlibrary{arrows,shapes,calc,positioning}

\begin{document}
  \begin{tikzpicture}[>=stealth,semithick,auto,remember picture]
    \node at (0,0) (b1) {Completing the Square};
    \node [rectangle,draw=green!60!black] at (0,-.5) (b2) {$x^2+bx=a$};
    \node [below=1em of b2] (b3) {
    	\begin{tikzpicture}
    		\draw [fill=gray!70] (0,-.5) -- ++(0,1) node [pos=.5,left] {$x$} 
			-- ++(1,0) -- ++(0,-1) -- ++(-1,0) node [pos=.5,below] {$x$};
		\node at (1.25,.25) {$+$};
		\draw [fill=gray!70] (1.5,-.5) -- ++(0,1) -- ++(.5,0) -- ++(0,-1) node [pos=.5,right] {$x$}
			-- ++(-.5,0) node [pos=.5,below] (b31) {$b$};
		\draw [dashed] (1.75,-.5) -- ++(0,1);
		\node at (2.6,0.15) {$=$};
		\node [fill=gray!70,ellipse,minimum width=2em] at (3.25,0.25) {$a$};
    	\end{tikzpicture}
	};
    \node [below=.5em of b3] (b4) {
    	\begin{tikzpicture}
    		\draw [fill=gray!70] (0,-.5) -- ++(0,1) node [pos=.5,left] {$x$} 
			-- ++(1,0) -- ++(0,-1) -- ++(-1,0) node [pos=.5,below] {$x$};
		\node at (1.25,.25) {$+$};
		\draw [fill=gray!70] (1.5,-.5) -- ++(0,1) node [pos=1] (b41) {}
			-- ++(.25,0) -- ++(0,-1) node [pos=.5,right] {$x$}
			-- ++(-.25,0) node [pos=.5,below] (b43) {$\frac{b}{2}$};
		\node at (2.25,.25) {$+$};
		\draw [fill=gray!70] (2.5,-.5) -- ++(0,1) node [pos=1] (b42) {} 
			-- ++(.25,0) -- ++(0,-1) node [pos=.5,right] {$x$}
			-- ++(-.25,0) node [pos=.5,below] (b44) {$\frac{b}{2}$};
		\draw [dashed] (1.75,-.5) -- ++(0,1);
		\node at (3.3,0.15) {$=$};
		\node [fill=gray!70,ellipse,minimum width=2em] at (3.9,0.25) {$a$};
    	\end{tikzpicture}
	};
    \node [below=.5em of b4] (b5) {
    	\begin{tikzpicture}
    		\draw [fill=gray!70] (0,-.5) -- ++(0,1) node [pos=.5,left] {$x$} 
			-- ++(1,0) -- ++(0,-1) -- ++(-1,0) node [pos=.5,below] {$x$};
    		\draw [fill=gray!70] (0,.65) -- ++(0,.25) node [pos=.5,left] {$\frac{b}{2}$} 
			-- ++(1,0) node [pos=.5,above] (b51) {} -- ++(0,-.25) -- ++(-1,0);
    		\draw [fill=gray!70] (1.15,-.5) -- ++(0,1) -- ++(.25,0) 
			-- ++(0,-1) node [pos=.5,above] (b52) {} -- ++(-.25,0) node [pos=.5,below] {$\frac{b}{2}$};
		\node at (1.75,.15) {$=$};
		\node [fill=gray!70,ellipse,minimum width=2em] at (2.4,0.25) {$a$};
    	\end{tikzpicture}
	};
    \node [below=.1em of b5] (b6) {
    	\begin{tikzpicture}
    		\draw [fill=gray!70] (0,-.5) -- ++(0,1) node [pos=.5,left] {$x$} 
			-- ++(1,0) -- ++(0,-1) -- ++(-1,0) node [pos=.5,below] {$x$};
    		\draw [fill=gray!70] (0,.65) -- ++(0,.25) node [pos=.5,left] {$\frac{b}{2}$} 
			-- ++(1,0) node [pos=.5,above] (b61) {} -- ++(0,-.25) -- ++(-1,0);
    		\draw [fill=gray!70] (1.15,-.5) -- ++(0,1) -- ++(.25,0) 
			-- ++(0,-1) node [pos=.5,above] (b62) {} -- ++(-.25,0) node [pos=.5,below] {$\frac{b}{2}$};
		\draw [fill=blue!70] (1.15,.65) -- ++(0,.25) -- ++(.25,0) -- ++(0,-.25) -- ++(-.25,0);
		\node at (1.75,.15) {$=$};
		\node [fill=gray!70,ellipse,minimum width=2em] at (2.4,0.25) {$a$};
		\node at (3,.25) {$+$};
		\draw [fill=blue!70] (3.25,-.125) -- ++(0,.25) -- ++(.25,0) node [pos=.5,above] {$\frac{b}{2}$}
			-- ++(0,-.25) node [pos=.5,right] {$\frac{b}{2}$} -- ++(-.25,0);
    	\end{tikzpicture}
	};
    \node [below=.1em of b6] (b7) {
    	\begin{tikzpicture}
    		\draw [fill=gray!70] (0,-.5) -- ++(0,1.25) node [pos=.5,left] {$x+\frac{b}{2}$} 
			-- ++(1.25,0) -- ++(0,-1.25) -- ++(-1.25,0) node [pos=.5,below] {$x+\frac{b}{2}$};
		\draw [dash pattern=on 2pt off 1pt] (0,.5) -- ++(1.25,0)
			(1,-.5) -- ++(0,1.25);
		\node at (1.75,.15) {$=$};
		\node [fill=gray!70,ellipse,minimum width=2em] at (2.4,0.25) {$a$};
		\node at (3,.25) {$+$};
		\draw [fill=gray!70] (3.25,-.125) -- ++(0,.25) -- ++(.25,0) node [pos=.5,above] {$\frac{b}{2}$}
			-- ++(0,-.25) node [pos=.5,right] {$\frac{b}{2}$} -- ++(-.25,0);
    	\end{tikzpicture}
	};
    \node [below=.1em of b7] (b8) {$\left(x+\frac{b}{2}\right)^2=a+\left(\frac{b}{2}\right)^2$};
    \node [below=.1em of b8,draw=red] (b9) {$x=-\frac{b}{2}+\sqrt{a+\frac{b^2}{4}}$};
    \draw [dashed,gray!70] (-2.2,-2.9) -- ++(4.5,0)
    	(-2.2,-5) -- ++(4.5,0)
    	(-2.2,-7.75) -- ++(4.5,0)
    	(-2.2,-10.4) -- ++(4.5,0);
    \draw [->,shorten >= 2pt, shorten <= 2pt] (b31.north west) parabola (b41.north east);
    \draw [->,shorten >= 2pt, shorten <= 2pt] (b31.north east) parabola (b42.north east);
    \draw [->,shorten >= 1pt, shorten <= 2pt] (b43.north) .. controls +(south west:5mm) and +(north:2mm) .. (b51.south);
    \draw [->,shorten >= -2pt, shorten <= 1pt] (b44.north) .. controls +(south west:7mm) and +(north east:5mm) .. (b52.north east);
  \end{tikzpicture}
\end{document}

Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
You may select the license of your choice.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

30 November 2014

image/svg+xml

a5ef565a57aee7212af6617a4cfd3c3d445b31ae

39,776 byte

513 pixel

170 pixel

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current01:40, 13 December 2014Thumbnail for version as of 01:40, 13 December 2014170 × 513 (39 KB)Krishnavedalafinal result using "plus-or-minus"

The following page uses this file:

Metadata