Course Test · School: high school
Algebra II: 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, algebraic, symbolic, complex, finance. 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.Multiplying complex numbersAgreesIndependent answer.RatMath code
complex.complex(3, 2).mul(complex.complex(4, -5))Output22 - 7i
- 2.Dividing complex numbersAgreesIndependent answer.RatMath code
complex.Complex.parse("(2 + i)/(1 - 3i)")Output-1/10 + 7/10i
- 3.Complex rootsAgreesSolve .Independent answer.RatMath code
algebraic.roots([13, 4, 1], { complex: true }).map((r) => r.value.toString())Output["−2 + 3i", "−2 − 3i"]
- 4.Polynomial divisionAgreesDivide by .Independent answerQuotient , remainder 0.RatMath code
symbolic.simplify("(x^3 - 2x^2 - 5x + 6)/(x - 3)")Outputx^2 + x - 2
- 5.Factor theoremAgreesFactor completely and list its zeros.Independent answer; zeros .RatMath code
[symbolic.factor("x^3 - 2x^2 - 5x + 6"), symbolic.solve("x^3 - 2x^2 - 5x + 6 = 0", "x")]Output[(x + 2)*(x - 1)*(x - 3), x = -2, 1, 3]
- 6.Remainder theoremAgreesFind the remainder when is divided by .Independent answer.RatMath code
symbolic.sym("2x^4 - 3x^2 + x - 7").subs({ x: -2 }).simplify()Output11
- 7.Simplifying rational expressionsAgreesSimplify .Independent answer, for .RatMath code
symbolic.simplify("(x^2 - 9)/(x^2 + 5x + 6)")Output(x - 3)/(x + 2)
- 8.Adding rational expressionsAgreesIndependent answer.RatMath code
symbolic.together("2/(x - 1) + 3/(x + 1)")Output(5*x - 1)/(x^2 - 1)
- 9.Rational equationAgreesSolve .Independent answer, , or ; neither makes a denominator zero.RatMath code
symbolic.solve("1/x + 1/(x - 2) = 4/3", "x")Outputx = 1/2, 3
- 10.Radical equationAgreesSolve .Independent answerSquaring: , or . Checking: gives , extraneous. Only .RatMath code
symbolic.solve("sqrt(2x + 3) = x", "x")Outputx = 3 rejected x = -1: the two sides differ there by about 2
- 11.Exponential equationAgreesSolve .Independent answer, .RatMath code
symbolic.solve("3^(2x - 1) = 27", "x")Outputx = 2
- 12.Evaluating logarithmsAgreesIndependent answer.RatMath code
symbolic.simplify("log(32)/log(2) + log(1/9)/log(3)")Output3
- 13.Logarithmic equationAgreesSolve .Independent answer, , or ; is not in the domain. .RatMath code
symbolic.solve("log(x)/log(3) + log(x - 8)/log(3) = 2", "x")Outputx = 9 rejected x = -1: a side of the equation is undefined there
- 14.System in three unknownsAgreesSolve , , .Independent answerAdding the first and third: ; the second and third: . So , , .RatMath code
symbolic.solveSystem(["x + y + z = 6", "2x - y + z = 3", "x + 2y - z = 2"], ["x", "y", "z"])Outputx = 1, y = 2, z = 3
- 15.Compound interestAgrees\$2000 is invested at 6% a year compounded monthly. What is it worth after 5 years, to the cent?Independent answer.RatMath code
finance.compound(2000, "0.06", 5, { periodsPerYear: 12 })Output2697.700305098632138692018344…
- 16.Inverse functionAgreesFind the inverse of .Independent answer, so .RatMath code
symbolic.solve("y = (2x + 3)/(x - 1)", "x")Outputx = (y + 3)/(y - 2) provided y - 2 != 0
- 17.CompositionAgreesFor and , find and .Independent answer, . .RatMath code
const f = "x^2 + 1", g = "2x - 3"; [symbolic.compose(f, g).value.subs({ x: 2 }).simplify(), symbolic.compose(g, f).value]Output[2, 2*x^2 - 1]
composesubstitutes one function into the other and also reports where the composite is defined.Fix: ratmath/symbolic#9,completeSquare,compose,sinusoid, inverse trig values,within,RealSetoperations and chained inequalities,implicitDiff,leibniz, constant factors insum - 18.Arithmetic seriesAgreesFind the sum of the first 30 terms of .Independent answer; .RatMath code
symbolic.sum("4k + 1", "k", 1, 30).valueOutput1890
- 19.Infinite geometric seriesAgreesFind .Independent answer: .RatMath code
symbolic.sum("12*(1/3)^k", "k", 0, "inf").valueOutput18
- 20.Binomial theoremAgreesFind the coefficient of in .Independent answer.RatMath code
symbolic.expand("(2x - 1)^5")Output32*x^5 - 80*x^4 + 80*x^3 - 40*x^2 + 10*x - 1