Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a statement to assume x != 0 for simplifying rational expressions

fix #42324

Test plan: load each exercise locally and make sure it displays properly

Auditors: peter, cbhl
  • Loading branch information...
commit 44691243d32b442f0c384c060acedec827db3053 1 parent 36051ed
@beneater beneater authored
View
5 exercises/simplifying_rational_expressions_1.html
@@ -81,11 +81,12 @@
<var id="SOLUTION">getSolution(COEFFICIENT1, COEFFICIENT2, DEGREE1, DEGREE2, X)</var>
</div>
- <p class="problem">Simplify the expression.</p>
- <p class="question">
+ <p class="question">Simplify the following expression:</p>
+ <p>
<code><var>Y</var> = \dfrac{<var>NUMERATORCOEFFICIENT</var><var>POWER1</var>}
{<var>DENOMINATORCOEFFICIENT</var><var>POWER2</var>}</code>
</p>
+ <p>You can assume <code><var>X</var> \neq 0</code>.</p>
<div class="solution" data-type="set">
<div class="set-sol" data-type="multiple">
View
9 exercises/simplifying_rational_expressions_2.html
@@ -75,7 +75,7 @@
<div data-ensure="COEFFICIENT1 !== 0 || COEFFICIENT2 !== 0">
<var id="COEFFICIENT2">randRangeWeighted(-10, 10, 0, 0.15)</var>
</div>
-
+
<var id="CONSTANT2">(function() {
if (getGCD(COEFFICIENT1, CONSTANT1) !== 1 && getGCD(COEFFICIENT2, CONSTANT1) !== 1) {
// Ensure there are no common factors
@@ -104,8 +104,9 @@
<var id="NEGATIVEDENOMINATOR">getExpressionRegex(-COEFFICIENT2, X, -CONSTANT2)</var>
</div>
- <p class="problem">Simplify the following expression:</p>
- <p class="question"><code><var>Y</var> = \dfrac{<var>NUMERATOR</var>}{<var>DENOMINATOR</var>}</code></p>
+ <p class="question">Simplify the following expression:</p>
+ <p><code><var>Y</var> = \dfrac{<var>NUMERATOR</var>}{<var>DENOMINATOR</var>}</code></p>
+ <p>You can assume <code><var>X</var> \neq 0</code>.</p>
<div class="solution" data-type="set">
<div class="set-sol" data-type="multiple">
@@ -183,4 +184,4 @@
</div>
</div>
</body>
-</html>
+</html>
View
7 exercises/simplifying_rational_expressions_3.html
@@ -75,8 +75,9 @@
</div>
</div>
- <p class="problem">Simplify the following expression:</p>
- <p class="question"><code><var>Y</var> = \dfrac{<var>NUMERATOR</var>}{<var>DENOMINATOR</var>}</code></p>
+ <p class="question">Simplify the following expression:</p>
+ <p><code><var>Y</var> = \dfrac{<var>NUMERATOR</var>}{<var>DENOMINATOR</var>}</code></p>
+ <p>You can assume <code><var>X</var> \neq 0</code>.</p>
<div class="solution" data-type="set">
<div class="set-sol" data-type="multiple">
@@ -142,4 +143,4 @@
</div>
</div>
</body>
-</html>
+</html>

3 comments on commit 4469124

@petercollingridge
Collaborator

Thanks for that. For some of the exercises you divide by (x - 3) so there are some other exceptions, but if you say what they are that will make the answer more obvious.

@beneater
Owner

Oh hrm.. I didn't think of that. If you wanna take a stab at a better fix, feel free.

@petercollingridge
Collaborator

I guess the ideal solution would be to ask them to include the domain of the new expression, which would be possible, but would require a bit of work.

Please sign in to comment.
Something went wrong with that request. Please try again.