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. 1.Multiplying complex numbersAgrees
    (3+2i)(4−5i)(3 + 2i)(4 - 5i)
    Independent answer
    12−15i+8i−10i2=22−7i12 - 15i + 8i - 10i^2 = 22 - 7i.
    RatMath code
    complex.complex(3, 2).mul(complex.complex(4, -5))
    Output
    22 - 7i
  2. 2.Dividing complex numbersAgrees
    2+i1−3i\dfrac{2 + i}{1 - 3i}
    Independent answer
    (2+i)(1+3i)10=−1+7i10\dfrac{(2 + i)(1 + 3i)}{10} = \dfrac{-1 + 7i}{10}.
    RatMath code
    complex.Complex.parse("(2 + i)/(1 - 3i)")
    Output
    -1/10 + 7/10i
  3. 3.Complex rootsAgrees
    Solve x2+4x+13=0x^2 + 4x + 13 = 0.
    Independent answer
    x=−4±16−522=−2±3ix = \dfrac{-4 \pm \sqrt{16 - 52}}{2} = -2 \pm 3i.
    RatMath code
    algebraic.roots([13, 4, 1], { complex: true }).map((r) => r.value.toString())
    Output
    ["−2 + 3i", "−2 − 3i"]
  4. 4.Polynomial divisionAgrees
    Divide x3−2x2−5x+6x^3 - 2x^2 - 5x + 6 by x−3x - 3.
    Independent answer
    Quotient x2+x−2x^2 + x - 2, remainder 0.
    RatMath code
    symbolic.simplify("(x^3 - 2x^2 - 5x + 6)/(x - 3)")
    Output
    x^2 + x - 2
  5. 5.Factor theoremAgrees
    Factor x3−2x2−5x+6x^3 - 2x^2 - 5x + 6 completely and list its zeros.
    Independent answer
    (x−1)(x+2)(x−3)(x - 1)(x + 2)(x - 3); zeros −2,1,3-2, 1, 3.
    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. 6.Remainder theoremAgrees
    Find the remainder when 2x4−3x2+x−72x^4 - 3x^2 + x - 7 is divided by x+2x + 2.
    Independent answer
    f(−2)=32−12−2−7=11f(-2) = 32 - 12 - 2 - 7 = 11.
    RatMath code
    symbolic.sym("2x^4 - 3x^2 + x - 7").subs({ x: -2 }).simplify()
    Output
    11
  7. 7.Simplifying rational expressionsAgrees
    Simplify x2−9x2+5x+6\dfrac{x^2 - 9}{x^2 + 5x + 6}.
    Independent answer
    (x−3)(x+3)(x+2)(x+3)=x−3x+2\dfrac{(x - 3)(x + 3)}{(x + 2)(x + 3)} = \dfrac{x - 3}{x + 2}, for x≠−3x \ne -3.
    RatMath code
    symbolic.simplify("(x^2 - 9)/(x^2 + 5x + 6)")
    Output
    (x - 3)/(x + 2)
  8. 8.Adding rational expressionsAgrees
    2x−1+3x+1\dfrac{2}{x - 1} + \dfrac{3}{x + 1}
    Independent answer
    2(x+1)+3(x−1)x2−1=5x−1x2−1\dfrac{2(x + 1) + 3(x - 1)}{x^2 - 1} = \dfrac{5x - 1}{x^2 - 1}.
    RatMath code
    symbolic.together("2/(x - 1) + 3/(x + 1)")
    Output
    (5*x - 1)/(x^2 - 1)
  9. 9.Rational equationAgrees
    Solve 1x+1x−2=43\dfrac1x + \dfrac{1}{x - 2} = \dfrac43.
    Independent answer
    3(x−2)+3x=4x(x−2)3(x - 2) + 3x = 4x(x - 2), 2x2−7x+3=02x^2 - 7x + 3 = 0, x=3x = 3 or x=12x = \tfrac12; neither makes a denominator zero.
    RatMath code
    symbolic.solve("1/x + 1/(x - 2) = 4/3", "x")
    Output
    x = 1/2,  3
  10. 10.Radical equationAgrees
    Solve 2x+3=x\sqrt{2x + 3} = x.
    Independent answer
    Squaring: x2−2x−3=0x^2 - 2x - 3 = 0, x=3x = 3 or −1-1. Checking: x=−1x = -1 gives 1=−11 = -1, extraneous. Only x=3x = 3.
    RatMath code
    symbolic.solve("sqrt(2x + 3) = x", "x")
    Output
    x = 3
      rejected x = -1: the two sides differ there by about 2
  11. 11.Exponential equationAgrees
    Solve 32x−1=273^{2x - 1} = 27.
    Independent answer
    2x−1=32x - 1 = 3, x=2x = 2.
    RatMath code
    symbolic.solve("3^(2x - 1) = 27", "x")
    Output
    x = 2
  12. 12.Evaluating logarithmsAgrees
    log⁡232+log⁡319\log_2 32 + \log_3 \tfrac19
    Independent answer
    5+(−2)=35 + (-2) = 3.
    RatMath code
    symbolic.simplify("log(32)/log(2) + log(1/9)/log(3)")
    Output
    3
  13. 13.Logarithmic equationAgrees
    Solve log⁡3x+log⁡3(x−8)=2\log_3 x + \log_3(x - 8) = 2.
    Independent answer
    x(x−8)=9x(x - 8) = 9, x2−8x−9=0x^2 - 8x - 9 = 0, x=9x = 9 or −1-1; −1-1 is not in the domain. x=9x = 9.
    RatMath code
    symbolic.solve("log(x)/log(3) + log(x - 8)/log(3) = 2", "x")
    Output
    x = 9
      rejected x = -1: a side of the equation is undefined there
  14. 14.System in three unknownsAgrees
    Solve x+y+z=6x + y + z = 6, 2x−y+z=32x - y + z = 3, x+2y−z=2x + 2y - z = 2.
    Independent answer
    Adding the first and third: 2x+3y=82x + 3y = 8; the second and third: 3x+y=53x + y = 5. So x=1x = 1, y=2y = 2, z=3z = 3.
    RatMath code
    symbolic.solveSystem(["x + y + z = 6", "2x - y + z = 3", "x + 2y - z = 2"], ["x", "y", "z"])
    Output
    x = 1,  y = 2,  z = 3
  15. 15.Compound interestAgrees
    \$2000 is invested at 6% a year compounded monthly. What is it worth after 5 years, to the cent?
    Independent answer
    2000(1.005)60=$2697.702000(1.005)^{60} = \$2697.70.
    RatMath code
    finance.compound(2000, "0.06", 5, { periodsPerYear: 12 })
    Output
    2697.700305098632138692018344…
  16. 16.Inverse functionAgrees
    Find the inverse of f(x)=2x+3x−1f(x) = \dfrac{2x + 3}{x - 1}.
    Independent answer
    y(x−1)=2x+3⇒x=y+3y−2y(x - 1) = 2x + 3 \Rightarrow x = \dfrac{y + 3}{y - 2}, so f−1(x)=x+3x−2f^{-1}(x) = \dfrac{x + 3}{x - 2}.
    RatMath code
    symbolic.solve("y = (2x + 3)/(x - 1)", "x")
    Output
    x = (y + 3)/(y - 2)
      provided y - 2 != 0
  17. 17.CompositionAgrees
    For f(x)=x2+1f(x) = x^2 + 1 and g(x)=2x−3g(x) = 2x - 3, find f(g(2))f(g(2)) and g(f(x))g(f(x)).
    Independent answer
    g(2)=1g(2) = 1, f(1)=2f(1) = 2. g(f(x))=2(x2+1)−3=2x2−1g(f(x)) = 2(x^2 + 1) - 3 = 2x^2 - 1.
    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]
    compose substitutes one function into the other and also reports where the composite is defined.
    Fix: ratmath/symbolic#9, completeSquare, compose, sinusoid, inverse trig values, within, RealSet operations and chained inequalities, implicitDiff, leibniz, constant factors in sum
  18. 18.Arithmetic seriesAgrees
    Find the sum of the first 30 terms of 5+9+13+⋯5 + 9 + 13 + \cdots.
    Independent answer
    a30=5+29⋅4=121a_{30} = 5 + 29 \cdot 4 = 121; S=30⋅(5+121)/2=1890S = 30 \cdot (5 + 121)/2 = 1890.
    RatMath code
    symbolic.sum("4k + 1", "k", 1, 30).value
    Output
    1890
  19. 19.Infinite geometric seriesAgrees
    Find 12+4+43+⋯12 + 4 + \tfrac43 + \cdots.
    Independent answer
    r=13r = \tfrac13: 121−1/3=18\dfrac{12}{1 - 1/3} = 18.
    RatMath code
    symbolic.sum("12*(1/3)^k", "k", 0, "inf").value
    Output
    18
  20. 20.Binomial theoremAgrees
    Find the coefficient of x3x^3 in (2x−1)5(2x - 1)^5.
    Independent answer
    (53)23(−1)2=10⋅8=80\binom53 2^3 (-1)^2 = 10 \cdot 8 = 80.
    RatMath code
    symbolic.expand("(2x - 1)^5")
    Output
    32*x^5 - 80*x^4 + 80*x^3 - 40*x^2 + 10*x - 1