Find the limit of (x^2 - 4)/(x - 2) as x approaches 2.
Show the steps
- Limit at a point\lim_{x\to a} f(x)with
a = 2, f = (x^2 - 4)/(x - 2)→limit = 4
Limits, derivatives, integrals, series, Taylor polynomials, multivariable and vector calculus, special functions and numerical differentiation and integration.
Calculus (calculus-ai999x) is an offline Python package for calculus. It covers limits, derivatives, integrals, series, Taylor polynomials, multivariable and vector calculus, special functions and numerical differentiation and integration.
It has 71 capabilities — 71 computational procedures — in 14 topics, the largest being Derivatives, Integrals, Special functions, Vector calculus, Multivariable calculus and Series. Ask a question in words with ask(), or call a capability by name with typed inputs with solve(). Every answer carries its value and unit, the steps that produced it and the formula in LaTeX.
When a question is not determined — a value is missing, an input is out of range, or the request is outside the package — it says so and names what it needs, instead of guessing. It runs on an ordinary CPU without a network connection (Python >=3.10), and the same question always gets the same answer.
pip install calculus-ai999x hf download AI999X/calculus-ai999x --local-dir calculus-ai999x
Each question below was put to calculus-ai999x and the answer shown is the one it returned, with the steps it took.
Find the limit of (x^2 - 4)/(x - 2) as x approaches 2.
a = 2, f = (x^2 - 4)/(x - 2)limit = 4Find the absolute maximum and minimum of x^3 - 3x on [0, 2].
a = 0, b = 2, f = x^3 - 3xabsolute_max = 2, absolute_min = -2, critical_points = [1]Find the Taylor polynomial of degree 3 of exp(x) about x = 0 and evaluate it at x = 0.5.
a = 0, f = exp(x), n = 3, x1 = 0.5coefficients = [1, 1, 0.5, 0.1666666667], value = 1.645833333, function_value = 1.648721271, error = 0.002887937367Find the line integral of F = (-y, x) along x = cos(t), y = sin(t) from t = 0 to t = 2pi.
P = -y, Q = x, t0 = 0, t1 = 6.283185307, xt = cos(t), yt = sin(t)line_integral = 6.283185307m.solve("definite_integral", f="x^2*exp(-x)", a=0, b=2) f = x^2*exp(-x), a = 0, b = 2integral = 0.6466471676Find the Fourier coefficients of order 2 of f(x) = x on [-pi, pi].
L = 3.141592654, f = x, k = 2a0 = 0, a_k = 0, b_k = -1Find the double integral of x*y over [0, 2] x [0, 3].
a = 0, b = 2, c = 0, d = 3, f = x*yintegral = 9Find the directional derivative of x^2*y at (1, 2) in the direction (3, 4).
f = x^2*y, p = [1, 2], u = [3, 4]directional_derivative = 3.2Every snippet was run as shown; the output under it is what it printed.
import calculus_ai999x as m
a = m.ask("Find the limit of (x^2 - 4)/(x - 2) as x approaches 2.")
print(a.outcome)
print(a.values)
for step in a.steps:
print(step["name"])SOLVED
{'limit': 4.0}
Limit at a point
import calculus_ai999x as m
a = m.solve("definite_integral", f="x^2*exp(-x)", a=0, b=2)
print(a.outcome)
print(a.values)SOLVED
{'integral': 0.6466471676338731}
import calculus_ai999x as m
# an input is missing: the answer says what it needs instead of guessing
a = m.solve("definite_integral")
print(a.outcome)
print(a.message)NEEDS_INPUT
definite_integral needs f, a, b (the integrand f(x); lower limit; upper limit). Example: solve('definite_integral', f='x^2', a=0, b=3).
calculus-ai999x "Find the limit of (x^2 - 4)/(x - 2) as x approaches 2."
limit = 4 1. Limit at a point: exact symbolic limit (series expansion / Gruntz algorithm) from both sides; refused if the one-sided limits differ or are infinite with a = 2, f = (x^2 - 4)/(x - 2) -> limit = 4 Assumptions: the left and right limits exist, are finite and agree …
Every value in these figures was computed by the package, each point a run of solve(); in a notebook, plot() and plot_relation() draw a capability's curves the same way.
12 of its 71 formulas; every one is in the capability browser below.
Search by name, formula, input or topic. Each capability opens to show what it takes, what it returns, when it applies, and a question it answered.
extrema_on_intervalThe absolute maximum and minimum values of a polynomial on [a, b] by the closed-interval method, with the critical points inside (a, b).
f the polynomial f(x) texta left endb right endabsolute_max the largest value of f on [a, b]absolute_min the smallest valuecritical_points critical points in (a, b), ascendingaverage_rate_of_changeThe average rate of change (f(b) - f(a))/(b - a) of f over [a, b]: the slope of the secant line.
f the function f(x) texta start of the intervalb end of the intervalaverage_rate (f(b) - f(a))/(b - a)fa f(a)fb f(b)critical_points_classifyAll critical points of a polynomial f(x) and which are local maxima or minima (first-derivative test).
f the polynomial f(x) textcritical_points real solutions of f'(x) = 0, ascendinglocal_maxima critical points that are local maximalocal_minima critical points that are local minimacurvatureThe curvature kappa = |f''| / (1 + f'^2)^(3/2) of y = f(x) at x = a, and the radius of curvature 1/kappa.
f the function f(x) texta the point x = acurvature kappa at x = aradius_of_curvature 1/kappa (absent where kappa = 0)derivative_at_pointThe derivative f'(a) of a function f(x) at x = a (the slope of its graph there).
f the function f(x) texta the point x = aderivative f'(a)derivative_expression f'(x) as an expressionnth_derivative_at_pointThe n-th derivative f^(n)(a) of f(x) at x = a.
f the function f(x) textn the order of the derivative integera the point x = anth_derivative f^(n)(a)nth_derivative_expression f^(n)(x)implicit_derivativeThe slope dy/dx of a curve given implicitly by F(x, y) = c, at a point on the curve.
F the curve as an equation in x and y textp the point (x, y) on the curve vectordy_dx dy/dx at the pointinflection_pointsThe points where a polynomial changes concavity (f'' changes sign).
f the polynomial f(x) textinflection_points x-values of the inflection points, ascendinglinear_approximationEstimate f(x1) by the tangent line at x = a: L(x1) = f(a) + f'(a)(x1 - a); with the actual value and error.
f the function f(x) texta the base point ax1 the point to estimateapproximation L(x1)actual f(x1)error f(x1) - L(x1)slope f'(a)mean_value_theoremThe secant slope of a polynomial on [a, b] and every c in (a, b) where f'(c) equals it.
f the polynomial f(x) texta left endb right endsecant_slope (f(b) - f(a))/(b - a)c_values all c in (a, b) with f'(c) = the slopenormal_lineThe normal line (perpendicular to the tangent) to y = f(x) at x = a: slope -1/f'(a).
f the function f(x) texta the point x = aslope slope -1/f'(a)intercept y-intercepty0 f(a)second_derivative_at_pointThe second derivative f''(a) of f(x) at x = a (concavity: positive means concave up).
f the function f(x) texta the point x = asecond_derivative f''(a)second_derivative_expression f''(x)tangent_lineThe tangent line y = m*x + b to y = f(x) at x = a: slope m = f'(a), intercept b = f(a) - a*f'(a).
f the function f(x) texta the point of tangency x = aslope slope m = f'(a)intercept y-intercept by0 f(a)equation the line as y = m*x + bvelocity_accelerationVelocity v = s'(t) and acceleration a = s''(t) at time t0 from a position function s(t).
s the position s(t) textt0 the time t0velocity v(t0) = s'(t0)acceleration a(t0) = s''(t0)speed |v(t0)|position s(t0)fourier_coefficientsThe Fourier coefficients a_0, a_k and b_k of f on [-L, L] (series a_0/2 + sum a_k cos(k pi x/L) + b_k sin(k pi x/L)).
f the function f(x) textL the half-period L (> 0)k the order k integera0 a_0 = (1/L) integral of fa_k a_kb_k b_karc_lengthThe length of the curve y = f(x) from x = a to x = b.
f the curve f(x) texta left endb right endarc_length the length of the curvearea_between_curvesThe area between the graphs of two polynomials y = f(x) and y = g(x) over [a, b], counting every piece as positive (the curves may cross).
f the first curve f(x) (a polynomial) textg the second curve g(x) (a polynomial) texta left endb right endarea the area between the curvesnet_integral integral of f - g (signed)crossings x where the curves cross inside (a, b)area_enclosed_curvesThe area of the region enclosed by two polynomial curves y = f(x) and y = g(x), between their first and last intersection.
f the first curve f(x) (a polynomial) textg the second curve g(x) (a polynomial) textarea the enclosed areax_left first intersectionx_right last intersectionintersections all intersection x-valuesaverage_valueThe average value (1/(b - a)) * integral of f from a to b of a function on [a, b].
f the function f(x) texta start of the intervalb end of the intervalaverage_value the average value of f on [a, b]integral the integral of f over [a, b]centroid_regionThe area and centroid (x_bar, y_bar) of the region between y = f(x) >= 0 (a polynomial) and the x-axis for a <= x <= b.
f the curve f(x) (a polynomial) texta left endb right endarea area of the regionx_bar x-coordinate of the centroidy_bar y-coordinate of the centroiddefinite_integralThe definite integral of f(x) from x = a to x = b (net signed area).
f the integrand f(x) texta lower limitb upper limitintegral the value of the integralftc_derivatived/dx of the integral of f(t) from a to g(x), evaluated at x = x0 (first fundamental theorem with the chain rule).
f the integrand f(t) texta the constant lower limitg the upper limit g(x) textx0 the point x = x0derivative d/dx of the integral at x0improper_integralThe improper integral of f(x) from x = a to infinity, when it converges.
f the integrand f(x) texta lower limitintegral the value of the improper integralleft_riemann_sumThe left-endpoint Riemann sum of f on [a, b] with n equal subintervals.
f the function f(x) texta left endb right endn number of equal subintervals integerapproximation the left Riemann sumright_riemann_sumThe right-endpoint Riemann sum of f on [a, b] with n equal subintervals.
f the function f(x) texta left endb right endn number of equal subintervals integerapproximation the right Riemann sumsurface_area_revolutionThe area of the surface formed by rotating y = f(x), a <= x <= b, about the x-axis.
f the curve f(x) texta left endb right endsurface_area the area of the surface of revolutiondisk_volumeThe volume of the solid formed by rotating y = f(x), a <= x <= b, about the x-axis.
f the curve f(x) texta left endb right endvolume the volume of the solidshell_volumeThe volume swept when the region under y = f(x) >= 0 (a polynomial), a <= x <= b with a >= 0, is rotated about the y-axis.
f the curve f(x) (a polynomial) texta left end (>= 0)b right endvolume the volume of the solidwasher_volumeThe volume swept when the region between an outer curve y = f(x) and an inner curve y = g(x) (polynomials, f >= g >= 0) on [a, b] is rotated about the x-axis.
f outer radius f(x) (a polynomial) textg inner radius g(x) (a polynomial) texta left endb right endvolume the volume of the solidlimit_at_pointThe two-sided limit of f(x) as x approaches a (including removable 0/0 forms such as sin(x)/x).
f the function f(x) texta the point x = alimit the limit of f(x) as x -> alimit_at_infinityThe limit of f(x) as x grows without bound (horizontal asymptote, end behaviour).
f the function f(x) textlimit the limit of f(x) as x -> infinitydouble_integral_rectangleThe double integral of f(x, y) over the rectangle [a, b] x [c, d].
f the integrand f(x, y) texta x fromb x toc y fromd y tointegral the value of the double integraldouble_integral_regionThe double integral of f(x, y) over the region a <= x <= b, g1(x) <= y <= g2(x).
f the integrand f(x, y) texta x fromb x tog1 the lower curve y = g1(x) textg2 the upper curve y = g2(x) textintegral the value of the double integralsurface_area_graphThe area of the surface z = f(x, y) over the rectangle [a, b] x [c, d].
f the surface z = f(x, y) texta x fromb x toc y fromd y tosurface_area the surface areatriple_integral_boxThe triple integral of f(x, y, z) over the box [x0, x1] x [y0, y1] x [z0, z1].
f the integrand f(x, y, z) textx0 x fromx1 x toy0 y fromy1 y toz0 z fromz1 z tointegral the value of the triple integraldirectional_derivativeThe rate of change of f at a point in the direction of a vector u (u is normalised to unit length).
f the function f(x, y) or f(x, y, z) textp the point vectoru the direction vector vectordirectional_derivative D_u f at the pointgradientThe gradient vector of f(x, y) or f(x, y, z) at a point and its length (the greatest rate of increase).
f the function f(x, y) or f(x, y, z) textp the point (x, y) or (x, y, z) vectorgradient the gradient vectormagnitude its lengthjacobian_determinantThe Jacobian determinant d(x, y)/d(u, v) of a transformation x = x(u, v), y = y(u, v) at a point.
xu x as a function of u and v textyv y as a function of u and v textp the point (u, v) vectorjacobian the Jacobian determinant at the pointpartial_derivativeThe partial derivative of f(x, y) or f(x, y, z) with respect to one variable, at a point.
f the function f(x, y) or f(x, y, z) textvar the variable choicep the point (x, y) or (x, y, z) vectorpartial the partial derivative at the pointhessian_classificationClassifies a critical point of f(x, y) as a local minimum, local maximum or saddle point from the Hessian.
f the function f(x, y) textp the critical point (x, y) vectorfxx f_xxfxy f_xyfyy f_yyD D = f_xx f_yy - f_xy^2classification local minimum, local maximum or saddle pointtangent_planeThe tangent plane z = f_x x + f_y y + c to the surface z = f(x, y) at (x0, y0).
f the surface z = f(x, y) textp the point (x0, y0) vectorz0 f(x0, y0)fx f_x(x0, y0)fy f_y(x0, y0)c the constant term cnumerical_derivativeA forward, backward or central difference approximation of f'(a) with step h, with the exact derivative and the error.
f the function f(x) texta the point x = ah the step size h > 0method forward, backward or central difference choiceapproximation the difference quotientexact the exact f'(a)error approximation - exactgauss_legendreThe n-point Gauss-Legendre approximation of the integral of f on [a, b] (exact for polynomials of degree <= 2n - 1), with the exact value and the error.
f the function f(x) texta left endb right endn number of nodes integerapproximation n-point Gauss-Legendre valueexact the integralerror approximation - exactmidpoint_ruleThe composite midpoint approximation of the integral of f on [a, b] with n subintervals, with the exact value and the error.
f the function f(x) texta left endb right endn number of equal subintervals integerapproximation midpoint approximation M_nexact the integralerror M_n - exactsimpson_ruleThe composite Simpson approximation of the integral of f on [a, b] with an even number n of subintervals, with the exact value and the error.
f the function f(x) texta left endb right endn number of equal subintervals integerapproximation Simpson approximation S_nexact the integralerror S_n - exacttrapezoid_ruleThe composite trapezoidal approximation of the integral of f on [a, b] with n subintervals, with the exact value and the error (approximation - exact).
f the function f(x) texta left endb right endn number of equal subintervals integerapproximation trapezoidal approximation T_nexact the integralerror T_n - exactnewton_methodn iterations of Newton's method x_{k+1} = x_k - f(x_k)/f'(x_k) for a root of f, from x_0.
f the function f(x) textx0 the starting value x_0n number of iterations integerx_n the n-th iteratef_x_n f(x_n)iterates x_1 .. x_nparametric_arc_lengthThe length of the curve x = x(t), y = y(t) for t0 <= t <= t1.
xt x(t) textyt y(t) textt0 start parametert1 end parameterarc_length the length of the curveparametric_slopedy/dx and d^2y/dx^2 of the curve x = x(t), y = y(t) at a parameter value t0.
xt x(t) textyt y(t) textt0 the parameter valuedy_dx dy/dx at t0d2y_dx2 d^2y/dx^2 at t0polar_areaThe area swept by the polar curve r = r(theta) between theta = alpha and theta = beta.
r the polar curve r(theta) textal alpha, the start angle (radians)be beta, the end angle (radians)area the areageometric_partial_sumThe sum of the first n terms a + a r + ... + a r^(n-1).
a the first termr the common ration the number of terms integersum the sum of the first n termsratio_testThe limit L of |a_(n+1)/a_n| and the ratio test's verdict for the series sum a_n (converges if L < 1, diverges if L > 1).
a the general term a_n, in n textratio_limit L = lim |a_(n+1)/a_n|verdict converges or divergesarithmetic_series_sumThe sum of the first n terms of an arithmetic sequence, and its last term.
a1 the first termd the common differencen the number of terms integersum the sum of the first n termslast_term the n-th termgeometric_series_sumThe sum a + a r + a r^2 + ... of a convergent geometric series.
a the first termr the common ratiosum the sum of the seriesseries_sumThe exact sum of a convergent series sum_{n=k}^infinity a_n (telescoping, geometric-type, zeta values, alternating harmonic, ...).
a the general term a_n, in n textk the starting index integersum the sum of the seriestaylor_polynomialThe degree-n Taylor polynomial of f about x = a (Maclaurin when a = 0): its coefficients, its value at x1, f(x1) and the truncation error.
f the function f(x) texta the centre x = an the degree integerx1 the evaluation pointcoefficients c_0 .. c_n with c_k = f^(k)(a)/k!value P_n(x1)function_value f(x1)error f(x1) - P_n(x1)bessel_jThe Bessel function J_n(x) of whole-number order n.
n the order n integerx the argument xJ J_n(x)beta_functionThe beta function B(a, b) for positive a and b.
a the first argument (> 0)b the second argument (> 0)beta B(a, b)chebyshev_polynomialThe value of the Chebyshev polynomial of the first kind T_n(x) (T_n(cos t) = cos(n t)).
n the degree n integerx the argument xT T_n(x)error_functionThe error function erf(x) and the complementary error function erfc(x) = 1 - erf(x).
x the argument xerf erf(x)erfc erfc(x)gamma_functionThe value of the gamma function (Gamma(n) = (n-1)! for whole n).
x the argument xgamma Gamma(x)legendre_polynomialThe value of the Legendre polynomial P_n(x).
n the degree n integerx the argument xP P_n(x)regularized_gammaThe regularized lower and upper incomplete gamma functions P(a, x) and Q(a, x) = 1 - P(a, x).
a the shape a (> 0)x the upper limit x (>= 0)P P(a, x) = gamma(a, x)/Gamma(a)Q Q(a, x) = Gamma(a, x)/Gamma(a)riemann_zetaThe Riemann zeta function zeta(s) = sum 1/n^s for s > 1 (the p-series sum).
s the argument s (> 1)zeta zeta(s)curlThe curl of a vector field F = (P, Q, R) at a point.
P the x-component P(x, y, z) textQ the y-component Q(x, y, z) textR the z-component R(x, y, z) textp the point (x, y, z) vectorcurl curl F at the pointdivergenceThe divergence P_x + Q_y + R_z of a vector field F = (P, Q, R) at a point.
P the x-component P(x, y, z) textQ the y-component Q(x, y, z) textR the z-component R(x, y, z) textp the point (x, y, z) vectordivergence div F at the pointgreens_theoremBoth sides of Green's theorem for F = (P, Q) on the rectangle [a, b] x [c, d]: the counter-clockwise circulation around the boundary and the double integral of Q_x - P_y.
P the x-component P(x, y) textQ the y-component Q(x, y) texta x fromb x toc y fromd y tocirculation the boundary line integral (counter-clockwise)double_integral the integral of Q_x - P_ylaplacianThe Laplacian f_xx + f_yy (+ f_zz) of a function at a point.
f the function f(x, y) or f(x, y, z) textp the point vectorlaplacian the Laplacian at the pointline_integral_vectorThe line integral (work) of F = (P, Q) along the path x = x(t), y = y(t) from t0 to t1.
P the x-component P(x, y) textQ the y-component Q(x, y) textxt the path x(t) textyt the path y(t) textt0 start parametert1 end parameterline_integral the integral of F . dr along the pathline_integral_scalarThe integral of f(x, y) ds along the path x = x(t), y = y(t), t0 <= t <= t1 (mass of a wire, average along a curve).
f the function f(x, y) textxt the path x(t) textyt the path y(t) textt0 start parametert1 end parameterline_integral the integral of f ds along the pathdivergence_theorem_boxThe outward flux of F = (P, Q, R) through the surface of the box [x0, x1] x [y0, y1] x [z0, z1].
P the x-component textQ the y-component textR the z-component textx0 x fromx1 x toy0 y fromy1 y toz0 z fromz1 z toflux the outward flux| Version | Released |
|---|---|
| 1.0.0 | 2026-10-25 |
15 files, 43.5 MB in total. The largest:
| File | Size |
|---|---|
| model.safetensors | 18.9 MB |
| dist/calculus_ai999x-1.0.0-py3-none-any.whl | 16.6 MB |
| onnx/search/encoder.int8.onnx | 4.9 MB |
| docs/calculus_ai999x_capabilities.pdf | 2.3 MB |
| onnx/search/index.json | 403.3 KB |
| onnx/search/tokenizer.json | 176.4 KB |
| docs/calculus_ai999x_capabilities.html | 175 KB |
| docs/calculus_ai999x_capabilities.md | 122.7 KB |
| README.md | 16.7 KB |
| LICENSE | 11.4 KB |
| evaluation/release_gate.md | 2.3 KB |
| evaluation/KNOWLEDGE_CARD.md | 1.4 KB |
Calculus answers questions in calculus: limits, derivatives, integrals, series, Taylor polynomials, multivariable and vector calculus, special functions and numerical differentiation and integration. Each answer gives the value with its unit, the steps and the formula in LaTeX.
With pip: pip install calculus-ai999x. The same files are on Hugging Face (hf download AI999X/calculus-ai999x --local-dir calculus-ai999x) and GitHub.
Yes. It is a Python package that runs on an ordinary CPU without a network connection (Python >=3.10); no GPU and no API key are needed.
71 capabilities in 14 topics, including Derivatives, Integrals, Special functions, Vector calculus, Multivariable calculus.
Field: Mathematics & Statistics. Tasks: Question Answering, Token Classification, Text Classification, Sentence Similarity, Feature Extraction.
Asked "Find the limit of (x^2 - 4)/(x - 2) as x approaches 2.", it answers: limit = 4.
It says so and names what is missing or out of range, instead of guessing a number.