ROOT-FINDING

creator:  Peter Knipp
repo:  github.com/pknipp/calculus

back to math APIs page
back to calculus page
differentiation
integration
max-finding
1st order differential equations
2nd order differential equations

In the url bar after 'https://basic-calculus.herokuapp.com/root-finding type the following:

/<point at which to start search for a root>/<function of x>

Note that this will not necessarily find the root which is closest to the input point. The function may be any algebraically legal combination of the variable letter(s), numbers, parentheses, and/or binary operations +, -, *, ** (encouraged) or ^ (discouraged), PI and/or the most common unary functions: abs, acos, acosh, acot, acoth, acsc, acsch, asec, asech, asin, asinh, atan, atanh, cbrt, ceil, cos, cot, csc, exp, exp2, exp_m1, floor, fract, ln, ln_1p, log10, log2, sec, signum, sin, sqrt, tan, and trunc. (See docs for more information.) To represent division you must use either div, d, DIV or D because the usual division symbol (/) has special meaning in a url. Implied multiplication is allowed. Spaces are allowed but discouraged.
The construction rules for the values of any variable in the url are the same as those for the function except - of course - it cannot include the letter which represents the variable.
example:To find a root of the function 2x - 3/(x4 + 5) while starting the search at x = 1, type /1/2x-3d(x**4+5) after the current url address. The result for this should be 0.2995...
algorithms: alternating steps of inverse quadratic interpolation and simple bisection
json: Type '/api' in the url bar immediately before 'root-finding' if you would like the result in json rather than in html. A successful response will contain five properties. 'xi' is the location where the search starts, 'x' is the root that is eventually found, 'bracket_steps' is the number of steps required to find numbers on either side of (ie, to 'bracket') the root, and 'root_steps' is the subsequent number of steps required for the algorithm to find this root to within the absolute accuracy specified in the last property: 'epsilon'. An unsuccessful response will have one property: 'message' (a string reporting the error).