This repository has been archived by the owner on May 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 863
/
factoring_polynomials_with_two_variables.html
101 lines (92 loc) · 5.87 KB
/
factoring_polynomials_with_two_variables.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html data-require="math math-format math-model simplify factoring-expressions subhints">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Factoring polynomials with two variables</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div>
<div class="vars">
<div data-ensure="A !== B && A !== -B">
<var id="A">randRangeNonZero( -10, 10 )</var>
<var id="B">randRangeNonZero( -10, 10 )</var>
</div>
<var id="SQUARE">1</var>
<var id="CONSTANT">SQUARE*A*B</var>
<var id="SIMPLECONSTANT">A*B</var>
<var id="LINEAR">SQUARE*(-A-B)</var>
<var id="SIMPLELINEAR">-A-B</var>
<var id="GROUP1">[
parse("(x + ay)(x + by)&=&xx &+& xby + ayx &+& ayby"),
parse("&=& x^2 &+& #{(a+b)}xy &+& #{ab}y^2", [GREEN, BLUE]),
simplify(parse("&=& x^2 &+& #{" + SIMPLELINEAR + "}xy &+& #{" + SIMPLECONSTANT + "}y^2", [GREEN, BLUE]), simplifyOptions.checkInput),
]
</var>
<var id="QUESTION">simplify(parse(SQUARE + "x^{2}+" + LINEAR + "xy+" + CONSTANT + "y^{2}"), simplifyOptions.basic)</var>
<var id="SOLUTION">simplify(parse("(x + #{" + (-A) + "}y)(x + #{" + (-B) + "}y)", [PINK, PINK]), simplifyOptions.checkInput)</var>
<var id="SOLUTION2">simplify(parse("(-x + #{" + (A) + "}y)(-x + #{" + (B) + "}y)", [PINK, PINK]), simplifyOptions.checkInput)</var>
</div>
<p class="problem">Factor the following expression:</p>
<p class="question"><code><var>format(QUESTION)</var></code></p>
<div class="solution" data-type="custom">
<div class="instruction">
<input name="response" type="text">
</div>
<div class="guess">$( "div.instruction input" ).val()</div>
<div class="validator-function">
return (isEqual(simplify(parse(guess), simplifyOptions.checkInput), simplify(SOLUTION, simplifyOptions.checkInput)) ||
isEqual(simplify(parse(guess), simplifyOptions.checkInput), simplify(SOLUTION2, simplifyOptions.checkInput)))
</div>
<div class="show-guess">
</div>
<div class="show-guess-solutionarea">
$( "div.instruction input" ).val( guess );
</div>
<div class="example">a factored expression, like <b>(x+2y)(x+3y)</b></div>
</div>
<div class="hints">
<div>
<p>When we factor a polynomial of this form, we are basically reversing this process of multiplying linear expressions together:</p>
<p><code>\qquad <var>formatGroup(GROUP1, [0, 1])</var></code></p>
</div>
<div>
<p><code>\qquad <var>formatGroup(GROUP1, [2])</var></code></p>
<p>
The coefficient on the <code>xy</code> term is <code class="hint_green"><var>SIMPLELINEAR</var></code>
and the coefficient on the <code>y^2</code> term is <code class="hint_blue"><var>SIMPLECONSTANT</var></code>, so to reverse the steps above, we need to find two numbers
that <span class="hint_green">add up to <code><var>SIMPLELINEAR</var></code></span> and <span class="hint_blue">multiply to
<code><var>SIMPLECONSTANT</var></code></span>.
</p>
</div>
<div>
<p>You can start by trying to guess which factors of <code class="hint_blue"><var>SIMPLECONSTANT</var></code> add up to
<span class="hint_green"><code><var>SIMPLELINEAR</var></code></span>. In other words, you need to find the values for <code class="hint_pink">a</code> and
<code class="hint_pink">b</code> that meet the following conditions:</p>
<p><code>\qquad <var>parseFormat("#a+#b=#{"+ SIMPLELINEAR + "}", [PINK, PINK, GREEN])</var></code></p>
<p><code>\qquad <var>parseFormat("#a \\times #b = #{" + SIMPLECONSTANT + "}", [PINK, PINK, BLUE])</var></code></p>
<p>If you're stuck, try listing out every single factor of <code class="hint_blue"><var>SIMPLECONSTANT</var></code> and its opposite as
<code class="hint_pink">a</code> in these equations, and see if it gives a value for <code class="hint_pink">b</code>
that validates both conditions. For example, since <var>Math.abs(A)</var> is a factor of <code class="hint_blue"><var>SIMPLECONSTANT</var></code>,
try substituting <var>Math.abs(A)</var> for <code class="hint_pink">a</code> as well as <var>-Math.abs(A)</var>.</p>
</div>
<div>
<p>The two numbers <code class="hint_pink"><var>-A</var></code> and <code class="hint_pink"><var>-B</var></code> satisfy both conditions:</p>
<p><code>
\qquad <var>parseFormat("#{" + (-A) + "}+#{" + (-B) + "}=#{" + SIMPLELINEAR + "}", [PINK, PINK, GREEN])</var>
</code></p>
<p><code>
\qquad <var>parseFormat("#{" + (-A) + "}\\times #{" + (-B) + "}=#{" + SIMPLECONSTANT + "}", [PINK, PINK, BLUE])</var>
</code></p>
</div>
<div>
<p><b>So we can factor the polynomial as: <code><var>format(SOLUTION)</var></code></b></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>