Skip to content

LazyMath mm_misc Library

General function analysis and circular trigonometric properties routines.

For full asymptotic time/space proofs and benchmarks across the mm_* library, see the Algorithm & Complexity Report.

mm_misc\graphinfo(fun, var, xlow, xup)

  • fun: Function expression \(f(x)\)
  • var: Independent variable
  • xlow: Domain lower bound
  • xup: Domain upper bound

Exam question example:

2021 VCAA Exam 2 Section B Question 1a 3 marks

Provide a complete graphical analysis of $f(x) = x^3 - x^2 - x + 3$ on the restricted domain $[-1, 2]$.

CAS Output:

1.1 *Doc1
mm_misc\graphinfo$\left(x^3 - x^2 - x + 3, x, -1, 2\right)$

$$\text{Endpoints: } [-1, 2], \ [2, 5] \quad\Big|\quad \text{STPs: } [1, 2, \text{"min"}], \ \left[-\frac{1}{3}, \frac{86}{27}, \text{"max"}\right] \quad\Big|\quad \text{POI: } \left[\frac{1}{3}, \frac{70}{27}\right]$$
Done

mm_misc\triginfo(fun, var, low, up)

  • fun: Trigonometric function expression \(f(x)\)
  • var: Independent variable
  • low: Domain lower bound
  • up: Domain upper bound

Complexity Refactoring: Bounded Grid Evaluation \(\mathcal{O}(\infty) \text{ / Memory Crash} \to \mathcal{O}(1)\)

  • Time Complexity: \(\mathcal{O}(\infty)\) piecewise branch explosion \(\to\) \(\mathcal{O}(1)\) bounded 24-subdivision grid evaluation.
  • Space Complexity: \(\mathcal{O}(N_{\text{branches}}) \to \mathcal{O}(1)\).
  • Optimization: Detects inner composite period via half-period symmetry test \(|f(x_0 + T/2) - f(x_0)| < 10^{-7}\) and filters out spurious dsolve piecewise branches, extracting stationary points in 203.3 ms.

Exam question example:

2022 VCAA Exam 2 Section B Question 4a 3 marks

Find the amplitude, period, midline, axis intercepts, and stationary points for $f(x) = \sin(x) + 1$ over $[0, 2\pi]$.

CAS Output:

1.1 *Doc1
mm_misc\triginfo$\left(\sin(x)+1, x, 0, 2\pi\right)$

$$\text{Amp} = 1, \quad \text{Mid} = 1, \quad \text{Per} = 2\pi, \quad \text{STPs}: \left[\frac{\pi}{2}, 2\right], \ \left[\frac{3\pi}{2}, 0\right]$$
Done