Function reference · Algebra
completeSquare
Rewrites a quadratic in completed-square form.
Use sqcomp(...) in Nerdamer Notation. In JavaScript or TypeScript, completeSquare(...) returns the completed-square expression together with the quadratic coefficient, shift, remainder, and selected variable.
The direct API is available from the root nerdamer export and from nerdamer/algebra.
Examples
These examples use Nerdamer Notation.
Complete the square through Nerdamer Notation.
sqcomp(x^2+6*x+1)Interfaces
The same operation is available through the interfaces below.
Nerdamer Notation
Use this form inside input passed to nerdamer(...).
sqcomp(arg1, [arg2])
Direct JavaScript / TypeScript API
Import the operation directly from its package entry point.
import { completeSquare } from 'nerdamer/algebra';
Notes
- The parser form returns the completed-square expression. The JavaScript / TypeScript completeSquare(...) helper returns a CompleteSquareResult object whose expression field contains that expression.
Aliases
sqcomp
