Course Test · School: high school
Algebra I: RatMath answers
The same twenty exercises, answered with RatMath Core and the Shelf libraries only. The code below was run when this page was built; its output is shown as printed, and compared with the independent answer.
Agrees 20
Libraries used here: core, symbolic, geo. In this code each library is in scope under its own name (linalg.det, stats.tTest), and Core's names (R, Rational, …) are in scope directly.
- 1.Multi-step equationAgreesSolve .Independent answer, , .RatMath code
symbolic.solve("4(2x - 3) - 5 = 3x + 8", "x")Outputx = 5
- 2.Literal equationAgreesThe area of a trapezoid is . Solve for .Independent answer.RatMath code
symbolic.solve("A = 1/2*h*(b + c)", "b")Outputb = (2*A - c*h)/h provided -h != 0
- 3.Compound inequalityAgreesSolve .Independent answer, so .RatMath code
symbolic.solveInequality("-3 < 2x + 1 <= 7", "x")Output(-2, 3]
A chained inequality is read as the intersection of its two halves (RealSetnow hasintersect,unionandcomplement).Fix: ratmath/symbolic#9,completeSquare,compose,sinusoid, inverse trig values,within,RealSetoperations and chained inequalities,implicitDiff,leibniz, constant factors insum - 4.Absolute value equationAgreesSolve .Independent answer: or .RatMath code
symbolic.solve("abs(2x - 5) = 9", "x")Outputx = -2, 7
- 5.Slope and interceptAgreesWrite in slope–intercept form. What are the slope and the -intercept?Independent answer: slope , intercept .RatMath code
symbolic.solve("3x - 4y = 12", "y")Outputy = 3*x/4 - 3
- 6.Parallel linesAgreesFind the line through parallel to .Independent answer, so .RatMath code
geo.parallelThrough(geo.line([0, 5], [1, 8]), [2, -1])Output3·x - y - 7 = 0
geo writes lines as : is . - 7.System word problemAgreesA theatre sold 120 tickets for \$780. Adult tickets cost \$8 and child tickets \$5. How many of each were sold?Independent answer, : , so 60 adult and 60 child tickets.RatMath code
symbolic.solveSystem(["a + c = 120", "8a + 5c = 780"], ["a", "c"])Outputa = 60, c = 60
- 8.Laws of exponentsAgreesSimplify .Independent answer.RatMath code
symbolic.simplify("(3x^2*y^3)^2 * 2x*y^(-4)")Output18*x^5*y^2
- 9.Multiplying polynomialsAgreesExpand .Independent answer.RatMath code
symbolic.expand("(2x - 3)(x^2 + 4x - 1)")Output2*x^3 + 5*x^2 - 14*x + 3
- 10.Factoring a trinomialAgreesFactor .Independent answer.RatMath code
symbolic.factor("x^2 - 5x - 24")Output(x + 3)*(x - 8)
- 11.Factoring with a leading coefficientAgreesFactor .Independent answer: .RatMath code
symbolic.factor("6x^2 + 7x - 3")Output(2*x + 3)*(3*x - 1)
- 12.Difference of squaresAgreesFactor .Independent answer.RatMath code
symbolic.factor("16x^2 - 49")Output(4*x + 7)*(4*x - 7)
- 13.Solving by factoringAgreesSolve .Independent answer: or .RatMath code
symbolic.solve("x^2 - 6x + 5 = 0", "x")Outputx = 1, 5
- 14.Quadratic formulaAgreesSolve . Give exact answers.Independent answer.RatMath code
symbolic.solve("2x^2 + 3x - 4 = 0", "x")Outputx = -sqrt(41)/4 - 3/4, sqrt(41)/4 - 3/4
- 15.Completing the squareAgreesWrite in vertex form and give the vertex.Independent answer; vertex .RatMath code
const c = symbolic.completeSquare("x^2 - 8x + 11"); [String(c.form), c.vertex.map(String)]Output["(x - 4)^2 - 5", ["4", "-5"]]
completeSquarewrites the vertex form and proves it by expanding back.Fix: ratmath/symbolic#9,completeSquare,compose,sinusoid, inverse trig values,within,RealSetoperations and chained inequalities,implicitDiff,leibniz, constant factors insum - 16.Function notationAgreesIf , find .Independent answer.RatMath code
symbolic.sym("2x^2 - 3x + 1").subs({ x: -2 }).simplify()Output15
- 17.Arithmetic sequenceAgreesFind the 50th term ofIndependent answer.RatMath code
R`7 + (50 - 1)*4`Output203
- 18.Exponential growthAgreesA population of 500 doubles every 3 years. How large is it after 12 years?Independent answerFour doublings: .RatMath code
R`500 * 2^(12/3)`Output8000
- 19.Adding radicalsAgreesSimplify .Independent answer.RatMath code
symbolic.simplify("sqrt(12) + sqrt(27)")Output5*sqrt(3)
- 20.Linear–quadratic systemAgreesWhere do and meet?Independent answer, or : the points and .RatMath code
symbolic.solveSystem(["y = x^2", "y = x + 2"], ["x", "y"])Outputx = -1, y = 1 x = 2, y = 4