reduce( randRange( -20, 20 ), rand( 3 ) > 0 ? 1 : randRange( 2, 20 ) ) fractionReduce( NUM, DEN ) fractionReduce( DEN, NUM ) randRangeNonZero( -20, 20 ) randFromArray([ "<", ">", "≤", "≥" ]) (function() { if ( NUM > 0 ) { return COMP; } switch ( COMP ) { case "<": return ">"; case ">": return "<"; case "≤": return "≥"; case "≥": return "≤"; } })() fraction( RIGHT_INT * DEN, NUM ) fractionReduce( RIGHT_INT * DEN, NUM ) RIGHT_INT * DEN / NUM

Solve for x:

COEFx COMP RIGHT_INT

x COMP_SOLUTION SOLUTION_REAL

When multiplying or dividing both sides of an inequality by a negative number you have to flip the inequality. Therefore COMP becomes COMP_SOLUTION.

Multiply both sides by ONE_OVER_COEF.

ONE_OVER_COEF \cdot (COEFx) COMP_SOLUTION ONE_OVER_COEF \cdot (RIGHT_INT)

Simplify.

x COMP_SOLUTION SOLUTION_NOT_REDUCED

Reduce.

x COMP_SOLUTION SOLUTION

We can see that all values of x COMP_SOLUTION SOLUTION satisfy the original inequality.

init({ range: [ [-1, 11], [-1, 1] ], }); var start = floor(SOLUTION_REAL - 4.5); var end = ceil(SOLUTION_REAL + 4.5); numberLine( start, end ); var offset; var fill; var startOffset = 0.12; switch ( COMP_SOLUTION ) { case ">": fill = _BACKGROUND; offset = 5; break; case "≥": fill = BLUE; offset = 5; break; case "<": fill = _BACKGROUND; offset = -5; startOffset *= -1; break; case "≤": fill = BLUE; offset = -5; startOffset *= -1; break; } var x = SOLUTION_REAL - start; style({ stroke: BLUE, fill: BLUE, strokeWidth: 3.5, arrows: "->" }); path([ [ x + startOffset, 0 ], [ x + offset, 0 ]]); style({ stroke: BLUE, strokeWidth: 3.0, fill: fill }); circle([ x, 0 ], 0.12 );