###### How to Solve Word Problems Programmatically

Chapter

14 Chapter 14.  Solving For Variables

 14.1 Balance Principle of Equations 14.2 Reverse Order of Operations 14.3 Combine Like Terms 14.4 Quadratic Formula 14.5 Find Roots of Functions 14.6 Get Variable Out of Denominator 14.7 Using Inverse Functions 14.8 Handling More Than One Variable 14.9 Activities and Explorations

14.1

#### Balance Principle of Equations If E1=E2, then f(E1)=f(E2) Balance Principle Let E1 and E2 be any two mathematical expressions and f( ) be a function.

 E1=E2 f(E) f(E1)=f(E2) Simplified 14=x-3 f(E)=E+3 14+3=(x-3)+3 17=x q3+2=6 f(E)=E-2 (q3+2)-2=6-2 q3=4 x/5=3 f(E)=E*5 (x/5)*5=3*5 x=15 10*y=30 f(E)=E/10 (10*y)/10=30/10 y=3 x^2=16 f(E)=sqrt(E) sqrt(x^2)= sqrt(16) x=4 or x=-4 sqrt(q3)=9 f(E)=E^2 (sqrt(q3))^2=9^2 q3=81 10^x=100 f(E)=log10(E) log10(10^x)= log10(100) x=2 5=exp(x) f(E)=ln(E) ln(5)= ln(exp(x)) ln(5)=x

The balance principle is the "golden rule" of algebra:  Do unto one side as you do unto the other.  In general, we can view this rule as applying the same function to both sides of an equation.  In its simplest form, the functions just apply a particular operation with a given quantity.  In the first example above, we just add 3 to both sides of the equation.  Similarly, for the next three examples we simply subtract, multiply, or divide both sides of the equation with the same quantity.

The next two examples show demonstrate the use of the square function and its opposite the square root function.  These functions represent inverse functions of each other.  Similarly the power of 10 is the inverse function of the log base 10 function and the natural log function f(x)=ln(x) provides an inverse for the (natural) exponential function f(x)=exp(x).

In order to isolate the variable in each of the examples above, we applied the inverse of the operation we want to reverse.  The first equation involved a subtraction so we added, the third one a division so we multiplied, etc.  This works fine if we have only one operation.  But what do we do when there exists more than one operation in the expression.  Let us consider several effective strategies.

14.2

#### Reverse Order of Operations Example I Explanation 4*x+6=14 given (isolate x) 4*x+6-6=14-6 f(E)=E-6  since "+" last operation 4*x=8 simplify 4*x*(1/4)=8*(1/4) f(E)=E*(1/4) x=2 simplify

If we have an equation with a single symbol to isolate, then we can follow a strategy of reversing the order of operations as we untangle it from its surrounding computations.  This example has one occurrence of one variable x.  It appears in the equation with two operations surrounding it, a multiplication "*" and a plus "+".  The multiplication operation would occur before the plus operation.  So to isolate x we reverse this order and use an inverse function of the plus operation to "peel" off the 6, then we use a inverse function for the multiplication operator to "peel" off the 4.

Now that you are warmed up, try this one.  It has three operations and one set of parenthesis.

 Example II Explanation 2+10/(1-x)=7

The operations on the same side of the equation as the x would occur in the following order: the subtraction "-" surrounded by parenthesis, then division "/", and then addition "+".  So in reversing this order we would subtract 2 from both sides.  Proceeding we have:

 Example II (continued) Explanation 2+10/(1-x)=7 given (isolate x) 2+10/(1-x)-2=7-2 f(E)=E-2  since "+" is last operation 10/(1-x)=5 simplify 10/(1-x)*(1-x)=5*(1-x) f(E)=E*(1-x) since "/" is last operation and (1-x) is the inverse of 1/(1-x) 10=5*(1-x) simplify 10/5=5*(1-x)/5 f(E)=E/5 since "*" is last operation 2=1-x simplify 2-1=1-x-1 f(E)=E-1 since "+" is last operation 1=-x simplify 1*(-1)=-x*(-1) f(E)=E*(-1) since "-" is last operation x=-1 simplify

Notice that when the variable x would switch from one side of the equation to the other, we still kept our focus on isolating that variable and continued to peel off operations surrounding it.

14.3

#### Combine Like Terms Example III Explanation 2*x^2+4*x-3=x*(1+x)^2-x^3 given (isolate x) 2*x^2+4*x-3=x*(1+2*x+x^2)-x^3 simplify (expand sum squared) 2*x^2+4*x-3=x*1+2*x^2+x^3-x^3 simplify (distributive rule) 2*x^2+4*x-3=x*1+2*x^2+(x^3-x^3) combine x^3 terms 2*x^2+4*x-3=x+2*x^2 simplify 2*x^2+4*x-3-2*x^2=x+2*x^2-2*x^2 f(E)=E-2*x^2 move to left 4*x-3=x simplify 4*x-3-x=x-x f(E)=E-x move to left 3*x-3=0 simplify (only one term) 3*x-3+3=0+3 f(E)=E+3 to reverse operations 3*x=3 simplify 3*x*(1/3)=3*(1/3) f(E)=E*(1/3) to reverse operations x=1 simplify

When there exists more than one occurrence of the variable in the equation, then we need to combine terms.  In a polynomial, each term consists of a constant times the variable raised to a particular power.  The expressions 2*x^2, 4*x, and 3 are terms that appear in the above example.  When solving equations that have polynomial terms in them, we seek to combine all terms of the same power together; so we repeatedly apply the balance principle and simplification rules to achieve this goal.  In the example above, we first simplify by expanding the power of the sum (1+x) in order to achieve individual terms. Then we combine terms and move all terms over to the left side of the equation to create a polynomial expression.

Several of the powered terms in this example canceled out allowing us to solve this problem using strategies discussed previously.  If other powered terms remain, the problem becomes much more difficult to solve.  We can, though, determine a solution set for polynomials containing terms up to the second power.  Such polynomials are called quadratic equations.  As an example consider solving the following equation for x.

 Example IV Explanation (3-2*x)^2=3*x^2-13*x+21 given (isolate x) 9-12*x+4*x^2=3*x^2-13*x+21 simplify (expand sum squared) 9-12*x+4*x^2-21=3*x^2-13*x+21-21 f(E)=E-21  move constant term to left -12*x+4*x^2-12=3*x^2-13*x simplify (combine 9 and -21) -12*x+4*x^2-12+13*x=3*x^2-13*x+13*x f(E)=E+13*x  move x term to left 4*x^2+x-12=3*x^2 simplify (combine x terms) 4*x^2+x-12-3*x^2=3*x^2-3*x^2 f(E)=E-3*x^2  move x^2 term to left x^2+x-12=0 simplify (combine x^2 terms)

This final polynomial has more than one power term so we cannot continue to isolate a single x.  What we can do, though is use the quadratic formula, since this is a quadratic equation (a polynomial of degree 2).

14.4

#### Quadratic Formula a*x^2+b*x+c=0   x = (-b + sqrt(b^2-4*a*c))/2*a   x = (-b - sqrt(b^2-4*a*c))/2*a Quadratic Formula For all a, b, and c such that b^2-4*a*c>0

The quadratic formula can provide 0, 1, or 2 solutions.  No solution occurs if the discriminant b^2-4*a*c is less than 0, because a negative value inside the square root function does not make sense in the real number system.  If the discriminant has a value of 0 then we have 1 solution, namely, -b/2*a.  Otherwise we have the two solutions as indicated above.  Example:

 x^2+x-12=0   x = (-b + sqrt(b^2-4*a*c))/2*a x = (-1 + sqrt(1-4*(-12)))/2*1 x = (-1 +sqrt(49))/2=6/2=3   x = (-b - sqrt(49))/2 =-8/2=-4 Quadratic Formula For all a, b, and c such that b^2-4*a*c>0

In this example, a=1, b=1, and c=-12.  The points x=3 and x=-4 satisfy the original equation.

14.5

#### Find Roots of Functions  f(x)=x^2+x-12=0

crosses x-axis at x=-4 and x=3

The solutions provided in the quadratic formula can have a visual representation as numbers on the x-coordinate where the function crosses over the x-axis.  In this case, the quadratic curve crosses the x-axis at x=-4 and x=3.  We call such points on the x-axis where the function equals 0 the roots of the function.  The following example shows that a cubic function can have 3 roots.  In general, a polynomial function of n-th degree can have up to n roots; therefore, when we solve for the variable x in such a polynomial, we can find up to n values that satisfy the equations. f(x)=x^3-13*x+12=0

crosses x-axis at x=-4, x=1, and x=3

Computer software that solves such problems use techniques that find roots of the general equation f(x)=0 efficiently.

14.6

#### Get Variable Out of Denominator Example IV Explanation (x^2-11*x+18)/(2-x)=4 given (isolate x) (x^2-11*x+18)/(2-x)*(2-x)=4*(2-x) f(E)=E*(2-x)  get x out of denominator x^2-11*x+18=8-4*x simplify x^2-11*x+18+4*x=8-4*x+4*x f(E)=E+4*x  move x term over to left x^2-7*x+18=8 simplify (combined -11*x and 4*x) x^2-7*x+18-8=8-8 f(E)=E-8  move constant over to left x^2-7*x+10=0 simplify x=-(-7)+sqrt(49-4*1*10))/2*1=5 quadratic formula x=7-sqrt(9))/2=2 quadratic formula (simplified)

Sometimes the original equation has expressions involving the variable that we want to isolate in the denominator.  In such a case, multiply by such expressions to move them up into the numerator.  In this example, we multiply by (1-2*x) to remedy this situation.  Then we can proceed as before, combine terms and find roots.

14.7

#### Using Inverse Functions Example IV Explanation 3*ln(x)=8*q2-ln(x) given (isolate x) 3*ln(x)+ln(x)=8*q2-ln(x)+ln(x) f(E)=E-ln(x)  since "+" last operation 4*ln(x)=8*q2 simplify 4*ln(x)*(1/4)=8*q2*(1/4) f(E)=E*(1/4) ln(x)=2*q2 simplify exp(ln(x))=exp(2*q2) f(E)=exp(E) x=exp(2*q2) simplify

In addition to polynomials, similar strategies hold for functions in general.  The goal still encourages us to isolate the x value.  In this case we combine like terms that involve ln(x) and then apply the inverse function f(x)=exp(x) to find a solution.

14.8

#### Handling More Than One Variable Example II Explanation 4*q1+8*q2=24 given (isolate q2) 4*q1+8*q2-4*q1=24-4*q1 f(E)=E-4*q1 since "+" last operation 8*q2=16 simplify 8*q2*(1/8)=24*(1/8) f(E)=E*(1/8) q2=3 simplify

This example has two different variables (q1 and q2) but only one occurrence of the variable q2 that we desire to isolate.  So we can use an strategy similar to the Example I above.  Now that you are warmed up, let us try a challenging one that involves 5 operations.

 Example III Explanation x+3/(1-2*y^2)=4 given (isolate y) x+3/(1-2*y^2)-x=4-x f(E)=E-x since "+" is last operation 3/(1-2*y^2)=4-x simplify 3/(1-2*y^2)*(1-2*y^2)=     (4-x)*(1-2*y^2) f(E)=E*(1-2*y^2) since "/" is now last operation 3=(4-x)*(1-2*y^2) simplify 3/(4-x)=(4-x)*(1-2*y^2)/(4-x) f(E)=E/(4-x) since first "*" is now last operation 3/(4-x)=1-2*y^2 simplify 3/(4-x)-1=1-2*y^2-1 f(E)=E-1 since the last operation adds a 1 to the negative of 2*y^2. 3/(4-x)-1=-2*y^2 simplify (3/(4-x)-1)*(1/-2)=-2*y^2*(1/-2) f(E)=E*(1/-2) since the last operation multiplies a -2 times the y^2 term. 3/(-8+2x)+1/2=y^2 simplify sqrt(3/(-8+2x)+1/2)=sqrt(y^2) f(E)=sqrt(E) sqrt(3/(-8+2x)+1/2)=y or -sqrt(3/(-8+2x)+1/2)=y simplify

Do not panic!  Just start reversing operations that surround the variable at any given stage of the isolation process.

Even though we might end up with a complicated expression (or in this case two expressions), we have isolated the variable y and have determined solutions to the original equation.  As an exercise in simplification, go ahead a substitute either one of the values of y back into the original equation and simplify.

14.9

#### Activities and Explorations Activities:

 Sample equations to solve http://www.sosmath.com/algebra/solve/solve0/solve0.html   Create a quadratic equation, graph it and find roots

Explorations:

 Derive of Quadratic formula http://www.sosmath.com/algebra/quadraticeq/quadraformula/quadraformula.html

Exercises:

 Do Related Problems In Your Textbook

Copyright © 2004  Dr. Ranel E. Erickson