Skip to content
Calculus

calculus-ai999x

Limits, derivatives, integrals, series, Taylor polynomials, multivariable and vector calculus, special functions and numerical differentiation and integration.

71capabilities
14topics
71formulas typeset
8worked examples below
1.0.0version
About this model

What Calculus does

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.

Install

pip install calculus-ai999x
hf download AI999X/calculus-ai999x --local-dir calculus-ai999x

What it covers

Try it

Worked examples

Each question below was put to calculus-ai999x and the answer shown is the one it returned, with the steps it took.

Limitsm.ask(…)

Find the limit of (x^2 - 4)/(x - 2) as x approaches 2.

limit = 4
Show the steps
  1. Limit at a point
    \lim_{x\to a} f(x)
    with a = 2, f = (x^2 - 4)/(x - 2)
    → limit = 4
Capability: Limit at a point
Derivativesm.ask(…)

Find the absolute maximum and minimum of x^3 - 3x on [0, 2].

absolute_max = 2
absolute_min = -2
critical_points = [1]
Show the steps
  1. Absolute extrema on a closed interval
    \max_{[a,b]} f = \max\{f(a), f(b), f(c) : f'(c) = 0\}
    with a = 0, b = 2, f = x^3 - 3x
    → absolute_max = 2, absolute_min = -2, critical_points = [1]
Seriesm.ask(…)

Find the Taylor polynomial of degree 3 of exp(x) about x = 0 and evaluate it at x = 0.5.

coefficients = [1, 1, 0.5, 0.1666666667]
value = 1.645833333
function_value = 1.648721271
error = 0.002887937367
Show the steps
  1. Taylor polynomial
    P_n(x) = \sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k
    with a = 0, f = exp(x), n = 3, x1 = 0.5
    → coefficients = [1, 1, 0.5, 0.1666666667], value = 1.645833333, function_value = 1.648721271, error = 0.002887937367
Capability: Taylor polynomial
Vector calculusm.ask(…)

Find the line integral of F = (-y, x) along x = cos(t), y = sin(t) from t = 0 to t = 2pi.

line_integral = 6.283185307
Show the steps
  1. Line integral of a vector field
    \int_C \mathbf F\cdot d\mathbf r = \int_{t_0}^{t_1} \left(P\,x'(t) + Q\,y'(t)\right)dt
    with P = -y, Q = x, t0 = 0, t1 = 6.283185307, xt = cos(t), yt = sin(t)
    → line_integral = 6.283185307
Integralsm.solve(…)
m.solve("definite_integral", f="x^2*exp(-x)", a=0, b=2)
integral = 0.6466471676
Show the steps
  1. Definite integral
    \int_a^b f(x)\,dx
    with f = x^2*exp(-x), a = 0, b = 2
    → integral = 0.6466471676
Capability: Definite integral
Fourier seriesm.ask(…)

Find the Fourier coefficients of order 2 of f(x) = x on [-pi, pi].

a0 = 0
a_k = 0
b_k = -1
Show the steps
  1. Fourier coefficients
    a_k = \frac{1}{L}\int_{-L}^{L} f(x)\cos\frac{k\pi x}{L}dx,\quad b_k = \frac{1}{L}\int_{-L}^{L} f(x)\sin\frac{k\pi x}{L}dx
    with L = 3.141592654, f = x, k = 2
    → a0 = 0, a_k = 0, b_k = -1
Multiple integralsm.ask(…)

Find the double integral of x*y over [0, 2] x [0, 3].

integral = 9
Show the steps
  1. Double integral over a rectangle
    \int_a^b\!\int_c^d f(x,y)\,dy\,dx
    with a = 0, b = 2, c = 0, d = 3, f = x*y
    → integral = 9
Multivariable calculusm.ask(…)

Find the directional derivative of x^2*y at (1, 2) in the direction (3, 4).

directional_derivative = 3.2
Show the steps
  1. Directional derivative
    D_{\mathbf u} f = \nabla f\cdot\frac{\mathbf u}{|\mathbf u|}
    with f = x^2*y, p = [1, 2], u = [3, 4]
    → directional_derivative = 3.2
Use it

From Python or the command line

Every 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"])
Output
SOLVED
{'limit': 4.0}
Limit at a point
Figures

Computed, not drawn by hand

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.

Taylor polynomials closing in on sin x

P_n(x) = \sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k
Taylor polynomials closing in on sin xTaylor polynomials of sin x about 0 of degree 1, 3, 5 and 7 against sin x itself, each evaluated by the package at 121 points; marked: x = 2.5, degree-7 value = 0.588534 (sin 2.5 = 0.598472, error 0.00993823).-505-2-10120.588534sin xdegree 1degree 3degree 5degree 7xy
Taylor polynomials of sin x about 0 of degree 1, 3, 5 and 7 against sin x itself, each evaluated by the package at 121 points; marked: x = 2.5, degree-7 value = 0.588534 (sin 2.5 = 0.598472, error 0.00993823).

Left Riemann sum under y = x²

L_n = h\sum_{k=0}^{n-1} f(a + k h),\quad h = \frac{b-a}{n}
Left Riemann sum under y = x²The area under y = x² on [0, 2] and the left Riemann sum with 8 rectangles (heights f(xᵢ) and the curve evaluated by the package): left sum 2.1875, right sum 3.1875, exact integral 2.66667.00.511.5201234left rectangles, sum 2.1875y = x², area 2.66667xy
The area under y = x² on [0, 2] and the left Riemann sum with 8 rectangles (heights f(xᵢ) and the curve evaluated by the package): left sum 2.1875, right sum 3.1875, exact integral 2.66667.

Newton's method converging to √2

x_{k+1} = x_k - \frac{f(x_k)}{f'(x_k)}
Newton's method converging to √2Newton's method on x² − 2 from x₀ = 3: each tangent (through the curve point computed by the package) meets the axis at the next iterate — 1.83333, 1.46212, 1.415, 1.41421; marked: x₄ = 1.41421, f(x₄) = 6.1568e-07.1230510x₄ = 1.41421y = x² − 2tangent stepsiteratesxy
Newton's method on x² − 2 from x₀ = 3: each tangent (through the curve point computed by the package) meets the axis at the next iterate — 1.83333, 1.46212, 1.415, 1.41421; marked: x₄ = 1.41421, f(x₄) = 6.1568e-07.

Partial sums of a geometric series converging

S_n = a\,\frac{1 - r^n}{1 - r}
Partial sums of a geometric series convergingPartial sums of the geometric series 1 + ½ + ¼ + …, each computed by the package: S₁ = 1, S₄ = 1.875, S₁₂ = 1.99951; the gap to the sum of the series, 2, halves with every term.2.557.51012.500.511.52sum of the series = 211.51.751.875Sₙ = 1 + ½ + … + (½)ⁿ⁻¹n — number of termspartial sum Sₙ
Partial sums of the geometric series 1 + ½ + ¼ + …, each computed by the package: S₁ = 1, S₄ = 1.875, S₁₂ = 1.99951; the gap to the sum of the series, 2, halves with every term.

A solid of revolution and its disks

V = \pi\int_a^b f(x)^2\,dx
A solid of revolution and its disksThe solid made by turning y = √x (0 ≤ x ≤ 4) about the x-axis, with circular cross-sections drawn at x = 1, 2, 3, 4 (profile and radii computed by the package); the package's volume by disks, the integral of π(√x)² from 0 to 4, is 25.1327.024-2-1012solid swept by y = √x, volume 25.1327disks at x = 1, 2, 3, 4y = √xx (axis of revolution)y
The solid made by turning y = √x (0 ≤ x ≤ 4) about the x-axis, with circular cross-sections drawn at x = 1, 2, 3, 4 (profile and radii computed by the package); the package's volume by disks, the integral of π(√x)² from 0 to 4, is 25.1327.
Formulas

The mathematics inside

12 of its 71 formulas; every one is in the capability browser below.

Limit at a point
\lim_{x\to a} f(x)
Absolute extrema on a closed interval
\max_{[a,b]} f = \max\{f(a), f(b), f(c) : f'(c) = 0\}
Taylor polynomial
P_n(x) = \sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k
Line integral of a vector field
\int_C \mathbf F\cdot d\mathbf r = \int_{t_0}^{t_1} \left(P\,x'(t) + Q\,y'(t)\right)dt
Definite integral
\int_a^b f(x)\,dx
Fourier coefficients
a_k = \frac{1}{L}\int_{-L}^{L} f(x)\cos\frac{k\pi x}{L}dx,\quad b_k = \frac{1}{L}\int_{-L}^{L} f(x)\sin\frac{k\pi x}{L}dx
Double integral over a rectangle
\int_a^b\!\int_c^d f(x,y)\,dy\,dx
Directional derivative
D_{\mathbf u} f = \nabla f\cdot\frac{\mathbf u}{|\mathbf u|}
Average rate of change
\frac{\Delta f}{\Delta x} = \frac{f(b)-f(a)}{b-a}
Arc length of a graph
L = \int_a^b \sqrt{1 + f'(x)^2}\,dx
Limit at infinity
\lim_{x\to\infty} f(x)
Double integral over a region
\int_a^b\!\int_{g_1(x)}^{g_2(x)} f(x,y)\,dy\,dx
Capabilities

Every capability, with an example

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.

71 capabilities

Derivatives 14

Absolute extrema on a closed intervalextrema_on_interval

The absolute maximum and minimum values of a polynomial on [a, b] by the closed-interval method, with the critical points inside (a, b).

\max_{[a,b]} f = \max\{f(a), f(b), f(c) : f'(c) = 0\}

Inputs

  • f the polynomial f(x) text
  • a left end
  • b right end

Returns

  • absolute_max the largest value of f on [a, b]
  • absolute_min the smallest value
  • critical_points critical points in (a, b), ascending

Applies when

  • a < b
  • f is a polynomial with rational coefficients

Example

m.ask("Find the absolute maximum and minimum of x^3 - 3x on [0, 2].")
→ absolute_max = 2, absolute_min = -2, critical_points = [1.0]
Average rate of changeaverage_rate_of_change

The average rate of change (f(b) - f(a))/(b - a) of f over [a, b]: the slope of the secant line.

\frac{\Delta f}{\Delta x} = \frac{f(b)-f(a)}{b-a}

Inputs

  • f the function f(x) text
  • a start of the interval
  • b end of the interval

Returns

  • average_rate (f(b) - f(a))/(b - a)
  • fa f(a)
  • fb f(b)

Applies when

  • a != b
  • f defined at a and b

Example

m.ask("Find the average rate of change of f(x) = x^2 from x = 1 to x = 3.")
→ average_rate = 4, fa = 1, fb = 9
Critical points and their classificationcritical_points_classify

All critical points of a polynomial f(x) and which are local maxima or minima (first-derivative test).

f'(c) = 0,\ f' \text{ changes } + \to - \Rightarrow \text{local max}

Inputs

  • f the polynomial f(x) text

Returns

  • critical_points real solutions of f'(x) = 0, ascending
  • local_maxima critical points that are local maxima
  • local_minima critical points that are local minima

Applies when

  • f is a polynomial of degree >= 2 with rational coefficients

Example

m.ask("Find and classify the critical points of x^3 - 3x.")
→ critical_points = [-1.0, 1.0], local_maxima = [-1.0], local_minima = [1.0]
Curvature of a graphcurvature

The curvature kappa = |f''| / (1 + f'^2)^(3/2) of y = f(x) at x = a, and the radius of curvature 1/kappa.

\kappa = \frac{|f''(a)|}{\left(1 + f'(a)^2\right)^{3/2}}

Inputs

  • f the function f(x) text
  • a the point x = a

Returns

  • curvature kappa at x = a
  • radius_of_curvature 1/kappa (absent where kappa = 0)

Applies when

  • f twice differentiable at a

Example

m.ask("Find the curvature of y = x^2 at x = 0.")
→ curvature = 2, radius_of_curvature = 0.5
Derivative at a pointderivative_at_point

The derivative f'(a) of a function f(x) at x = a (the slope of its graph there).

f'(a) = \lim_{h\to 0}\frac{f(a+h)-f(a)}{h}

Inputs

  • f the function f(x) text
  • a the point x = a

Returns

  • derivative f'(a)
  • derivative_expression f'(x) as an expression

Applies when

  • f is defined and differentiable at x = a

Example

m.ask("Find the derivative of f(x) = x^3 - 2x at x = 2.")
→ derivative = 10, derivative_expression = 3*x^2 - 2
Higher derivative at a pointnth_derivative_at_point

The n-th derivative f^(n)(a) of f(x) at x = a.

f^{(n)}(a) = \frac{d^n f}{dx^n}\Big|_{x=a}

Inputs

  • f the function f(x) text
  • n the order of the derivative integer
  • a the point x = a

Returns

  • nth_derivative f^(n)(a)
  • nth_derivative_expression f^(n)(x)

Applies when

  • 1 <= n <= 12
  • f is n times differentiable at x = a

Example

m.ask("Find the 4th derivative of sin(2x) at x = 1.")
→ nth_derivative = 14.5488, nth_derivative_expression = 16*sin(2*x)
Implicit differentiationimplicit_derivative

The slope dy/dx of a curve given implicitly by F(x, y) = c, at a point on the curve.

\frac{dy}{dx} = -\frac{F_x}{F_y}

Inputs

  • F the curve as an equation in x and y text
  • p the point (x, y) on the curve vector

Returns

  • dy_dx dy/dx at the point

Applies when

  • the point lies on the curve
  • F_y != 0 there (no vertical tangent)

Example

m.ask("Find dy/dx for x^2 + y^2 = 25 at the point (3, 4).")
→ dy_dx = -0.75
Inflection pointsinflection_points

The points where a polynomial changes concavity (f'' changes sign).

f''(c) = 0 \text{ and } f'' \text{ changes sign at } c

Inputs

  • f the polynomial f(x) text

Returns

  • inflection_points x-values of the inflection points, ascending

Applies when

  • f is a polynomial of degree >= 2 with rational coefficients

Example

m.ask("Find the inflection points of x^3 - 3x^2.")
→ inflection_points = [1.0]
Linear approximationlinear_approximation

Estimate f(x1) by the tangent line at x = a: L(x1) = f(a) + f'(a)(x1 - a); with the actual value and error.

L(x) = f(a) + f'(a)\,(x-a)

Inputs

  • f the function f(x) text
  • a the base point a
  • x1 the point to estimate

Returns

  • approximation L(x1)
  • actual f(x1)
  • error f(x1) - L(x1)
  • slope f'(a)

Applies when

  • f differentiable at a

Example

m.ask("Use the linear approximation of f(x) = sqrt(x) at x = 4 to estimate f(4.1).")
→ approximation = 2.025, actual = 2.02485, error = -0.000154327, slope = 0.25
Mean value theoremmean_value_theorem

The secant slope of a polynomial on [a, b] and every c in (a, b) where f'(c) equals it.

f'(c) = \frac{f(b) - f(a)}{b - a}

Inputs

  • f the polynomial f(x) text
  • a left end
  • b right end

Returns

  • secant_slope (f(b) - f(a))/(b - a)
  • c_values all c in (a, b) with f'(c) = the slope

Applies when

  • a < b
  • f a non-linear polynomial with rational coefficients

Example

m.ask("Find the value of c guaranteed by the mean value theorem for x^3 on [0, 3].")
→ secant_slope = 9, c_values = [1.7320508075688772]
Normal linenormal_line

The normal line (perpendicular to the tangent) to y = f(x) at x = a: slope -1/f'(a).

y = f(a) - \frac{1}{f'(a)}\,(x - a)

Inputs

  • f the function f(x) text
  • a the point x = a

Returns

  • slope slope -1/f'(a)
  • intercept y-intercept
  • y0 f(a)

Applies when

  • f'(a) != 0 (otherwise the normal is vertical)

Example

m.ask("Find the normal line to y = x^2 at x = 1.")
→ slope = -0.5, intercept = 1.5, y0 = 1
Second derivative at a pointsecond_derivative_at_point

The second derivative f''(a) of f(x) at x = a (concavity: positive means concave up).

f''(a) = \frac{d^2 f}{dx^2}\Big|_{x=a}

Inputs

  • f the function f(x) text
  • a the point x = a

Returns

  • second_derivative f''(a)
  • second_derivative_expression f''(x)

Applies when

  • f is twice differentiable at x = a

Example

m.ask("Find the second derivative of x^4 - 3x^2 at x = 1.")
→ second_derivative = 6, second_derivative_expression = 6*(2*x^2 - 1)
Tangent linetangent_line

The tangent line y = m*x + b to y = f(x) at x = a: slope m = f'(a), intercept b = f(a) - a*f'(a).

y = f(a) + f'(a)\,(x - a)

Inputs

  • f the function f(x) text
  • a the point of tangency x = a

Returns

  • slope slope m = f'(a)
  • intercept y-intercept b
  • y0 f(a)
  • equation the line as y = m*x + b

Applies when

  • f is differentiable at x = a

Example

m.ask("Find the equation of the tangent line to y = x^2 + 1 at x = 2.")
→ slope = 4, intercept = -3, y0 = 5, equation = y = 4*x - 3
Velocity and acceleration from positionvelocity_acceleration

Velocity v = s'(t) and acceleration a = s''(t) at time t0 from a position function s(t).

v = \frac{ds}{dt},\quad a = \frac{d^2 s}{dt^2}

Inputs

  • s the position s(t) text
  • t0 the time t0

Returns

  • velocity v(t0) = s'(t0)
  • acceleration a(t0) = s''(t0)
  • speed |v(t0)|
  • position s(t0)

Applies when

  • s twice differentiable at t0

Example

m.ask("A particle has position s(t) = t^3 - 6t^2 + 9t. Find its velocity and acceleration at t = 2.")
→ velocity = -3, acceleration = 0, speed = 3, position = 2

Fourier series 1

Fourier coefficientsfourier_coefficients

The 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)).

a_k = \frac{1}{L}\int_{-L}^{L} f(x)\cos\frac{k\pi x}{L}dx,\quad b_k = \frac{1}{L}\int_{-L}^{L} f(x)\sin\frac{k\pi x}{L}dx

Inputs

  • f the function f(x) text
  • L the half-period L (> 0)
  • k the order k integer

Returns

  • a0 a_0 = (1/L) integral of f
  • a_k a_k
  • b_k b_k

Applies when

  • L > 0
  • f continuous on [-L, L]
  • 1 <= k <= 50

Example

m.ask("Find the Fourier coefficients of order 2 of f(x) = x on [-pi, pi].")
→ a0 = 0, a_k = 0, b_k = -1

Integrals 14

Arc length of a grapharc_length

The length of the curve y = f(x) from x = a to x = b.

L = \int_a^b \sqrt{1 + f'(x)^2}\,dx

Inputs

  • f the curve f(x) text
  • a left end
  • b right end

Returns

  • arc_length the length of the curve

Applies when

  • a < b
  • f' continuous on [a, b]

Example

m.ask("Find the arc length of y = x^2 from x = 0 to x = 1.")
→ arc_length = 1.47894
Area between two curvesarea_between_curves

The 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).

A = \int_a^b \left|f(x) - g(x)\right|\,dx

Inputs

  • f the first curve f(x) (a polynomial) text
  • g the second curve g(x) (a polynomial) text
  • a left end
  • b right end

Returns

  • area the area between the curves
  • net_integral integral of f - g (signed)
  • crossings x where the curves cross inside (a, b)

Applies when

  • a < b
  • f and g polynomials with rational coefficients

Example

m.ask("Find the area between y = x^2 and y = x from x = 0 to x = 2.")
→ area = 1, net_integral = 0.666667, crossings = [1.0]
Area enclosed by two curvesarea_enclosed_curves

The area of the region enclosed by two polynomial curves y = f(x) and y = g(x), between their first and last intersection.

A = \int_{x_1}^{x_n} \left|f(x) - g(x)\right|\,dx

Inputs

  • f the first curve f(x) (a polynomial) text
  • g the second curve g(x) (a polynomial) text

Returns

  • area the enclosed area
  • x_left first intersection
  • x_right last intersection
  • intersections all intersection x-values

Applies when

  • f and g polynomials with rational coefficients meeting in at least two points

Example

m.ask("Find the area enclosed by y = x^2 and y = x.")
→ area = 0.166667, x_left = 0, x_right = 1, intersections = [0.0, 1.0]
Average value of a functionaverage_value

The average value (1/(b - a)) * integral of f from a to b of a function on [a, b].

f_{\text{avg}} = \frac{1}{b-a}\int_a^b f(x)\,dx

Inputs

  • f the function f(x) text
  • a start of the interval
  • b end of the interval

Returns

  • average_value the average value of f on [a, b]
  • integral the integral of f over [a, b]

Applies when

  • a < b
  • f continuous on [a, b]

Example

m.ask("Find the average value of f(x) = x^2 on [0, 3].")
→ average_value = 3, integral = 9
Centroid of a region under a curvecentroid_region

The 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.

\bar x = \frac{1}{A}\int_a^b x f(x)\,dx,\quad \bar y = \frac{1}{2A}\int_a^b f(x)^2\,dx

Inputs

  • f the curve f(x) (a polynomial) text
  • a left end
  • b right end

Returns

  • area area of the region
  • x_bar x-coordinate of the centroid
  • y_bar y-coordinate of the centroid

Applies when

  • a < b
  • f(x) >= 0 on [a, b] (checked exactly)

Example

m.ask("Find the centroid of the region under y = x^2 from x = 0 to x = 1.")
→ area = 0.333333, x_bar = 0.75, y_bar = 0.3
Definite integraldefinite_integral

The definite integral of f(x) from x = a to x = b (net signed area).

\int_a^b f(x)\,dx

Inputs

  • f the integrand f(x) text
  • a lower limit
  • b upper limit

Returns

  • integral the value of the integral

Applies when

  • f real and continuous on the closed interval between a and b

Example

m.ask("Evaluate the integral of x^2 from 0 to 3.")
→ integral = 9
Derivative of an integral (fundamental theorem)ftc_derivative

d/dx of the integral of f(t) from a to g(x), evaluated at x = x0 (first fundamental theorem with the chain rule).

\frac{d}{dx}\int_a^{g(x)} f(t)\,dt = f(g(x))\,g'(x)

Inputs

  • f the integrand f(t) text
  • a the constant lower limit
  • g the upper limit g(x) text
  • x0 the point x = x0

Returns

  • derivative d/dx of the integral at x0

Applies when

  • f continuous between a and g(x0)
  • g differentiable at x0

Example

m.ask("Find the derivative of the integral from 0 to x^2 of sin(t) dt at x = 1.")
→ derivative = 1.68294
Improper integral to infinityimproper_integral

The improper integral of f(x) from x = a to infinity, when it converges.

\int_a^\infty f(x)\,dx = \lim_{R\to\infty}\int_a^R f(x)\,dx

Inputs

  • f the integrand f(x) text
  • a lower limit

Returns

  • integral the value of the improper integral

Applies when

  • f continuous on [a, infinity)
  • x^1.01 * f(x) has a finite limit (comparison test), so the integral converges absolutely

Example

m.ask("Evaluate the improper integral of exp(-x) from 0 to infinity.")
→ integral = 1
Left Riemann sumleft_riemann_sum

The left-endpoint Riemann sum of f on [a, b] with n equal subintervals.

L_n = h\sum_{k=0}^{n-1} f(a + k h),\quad h = \frac{b-a}{n}

Inputs

  • f the function f(x) text
  • a left end
  • b right end
  • n number of equal subintervals integer

Returns

  • approximation the left Riemann sum

Applies when

  • a < b
  • 1 <= n <= 100000
  • f defined at the sample points

Example

m.ask("Find the left Riemann sum of x^2 on [0, 2] with n = 4.")
→ approximation = 1.75
Right Riemann sumright_riemann_sum

The right-endpoint Riemann sum of f on [a, b] with n equal subintervals.

R_n = h\sum_{k=1}^{n} f(a + k h),\quad h = \frac{b-a}{n}

Inputs

  • f the function f(x) text
  • a left end
  • b right end
  • n number of equal subintervals integer

Returns

  • approximation the right Riemann sum

Applies when

  • a < b
  • 1 <= n <= 100000
  • f defined at the sample points

Example

m.ask("Find the right Riemann sum of x^2 on [0, 2] with n = 4.")
→ approximation = 3.75
Surface area of revolutionsurface_area_revolution

The area of the surface formed by rotating y = f(x), a <= x <= b, about the x-axis.

S = 2\pi\int_a^b |f(x)|\sqrt{1 + f'(x)^2}\,dx

Inputs

  • f the curve f(x) text
  • a left end
  • b right end

Returns

  • surface_area the area of the surface of revolution

Applies when

  • a < b
  • f' continuous on [a, b]

Example

m.ask("Find the surface area when y = x from x = 0 to x = 1 is rotated about the x-axis.")
→ surface_area = 4.44288
Volume of revolution (disk method)disk_volume

The volume of the solid formed by rotating y = f(x), a <= x <= b, about the x-axis.

V = \pi\int_a^b f(x)^2\,dx

Inputs

  • f the curve f(x) text
  • a left end
  • b right end

Returns

  • volume the volume of the solid

Applies when

  • a < b
  • f continuous on [a, b]

Example

m.ask("Find the volume when y = x^2 from x = 0 to x = 1 is rotated about the x-axis.")
→ volume = 0.628319
Volume of revolution (shell method)shell_volume

The volume swept when the region under y = f(x) >= 0 (a polynomial), a <= x <= b with a >= 0, is rotated about the y-axis.

V = 2\pi\int_a^b x\,f(x)\,dx

Inputs

  • f the curve f(x) (a polynomial) text
  • a left end (>= 0)
  • b right end

Returns

  • volume the volume of the solid

Applies when

  • 0 <= a < b
  • f(x) >= 0 on [a, b] (checked exactly)

Example

m.ask("Use the shell method to find the volume when y = x^2 on [0, 2] is rotated about the y-axis.")
→ volume = 25.1327
Volume of revolution (washer method)washer_volume

The 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.

V = \pi\int_a^b \left(f(x)^2 - g(x)^2\right)dx

Inputs

  • f outer radius f(x) (a polynomial) text
  • g inner radius g(x) (a polynomial) text
  • a left end
  • b right end

Returns

  • volume the volume of the solid

Applies when

  • a < b
  • f >= g >= 0 on [a, b] (checked exactly)
  • polynomials

Example

m.ask("Find the volume when the region between y = x + 2 and y = 1 on [0, 1] is rotated about the x-axis using washers.")
→ volume = 16.7552

Limits 2

Limit at a pointlimit_at_point

The two-sided limit of f(x) as x approaches a (including removable 0/0 forms such as sin(x)/x).

\lim_{x\to a} f(x)

Inputs

  • f the function f(x) text
  • a the point x = a

Returns

  • limit the limit of f(x) as x -> a

Applies when

  • the left and right limits exist, are finite and agree

Example

m.ask("Find the limit of (x^2 - 4)/(x - 2) as x approaches 2.")
→ limit = 4
Limit at infinitylimit_at_infinity

The limit of f(x) as x grows without bound (horizontal asymptote, end behaviour).

\lim_{x\to\infty} f(x)

Inputs

  • f the function f(x) text

Returns

  • limit the limit of f(x) as x -> infinity

Applies when

  • the limit exists and is finite

Example

m.ask("Find the limit of (3x^2 + 1)/(x^2 - 5) as x approaches infinity.")
→ limit = 3

Multiple integrals 4

Double integral over a rectangledouble_integral_rectangle

The double integral of f(x, y) over the rectangle [a, b] x [c, d].

\int_a^b\!\int_c^d f(x,y)\,dy\,dx

Inputs

  • f the integrand f(x, y) text
  • a x from
  • b x to
  • c y from
  • d y to

Returns

  • integral the value of the double integral

Applies when

  • a < b, c < d
  • f continuous on the rectangle

Example

m.ask("Find the double integral of x*y over [0, 2] x [0, 3].")
→ integral = 9
Double integral over a regiondouble_integral_region

The double integral of f(x, y) over the region a <= x <= b, g1(x) <= y <= g2(x).

\int_a^b\!\int_{g_1(x)}^{g_2(x)} f(x,y)\,dy\,dx

Inputs

  • f the integrand f(x, y) text
  • a x from
  • b x to
  • g1 the lower curve y = g1(x) text
  • g2 the upper curve y = g2(x) text

Returns

  • integral the value of the double integral

Applies when

  • a < b
  • g1 <= g2 on [a, b]
  • f, g1, g2 continuous

Example

m.ask("Find the double integral of x*y over the region 0 <= x <= 1, x^2 <= y <= x.")
→ integral = 0.0416667
Surface area of a graphsurface_area_graph

The area of the surface z = f(x, y) over the rectangle [a, b] x [c, d].

A = \iint_R \sqrt{1 + f_x^2 + f_y^2}\,dA

Inputs

  • f the surface z = f(x, y) text
  • a x from
  • b x to
  • c y from
  • d y to

Returns

  • surface_area the surface area

Applies when

  • a < b, c < d
  • f continuously differentiable on the rectangle

Example

m.ask("Find the surface area of z = x + y over [0, 1] x [0, 1].")
→ surface_area = 1.73205
Triple integral over a boxtriple_integral_box

The triple integral of f(x, y, z) over the box [x0, x1] x [y0, y1] x [z0, z1].

\iiint_B f(x,y,z)\,dV

Inputs

  • f the integrand f(x, y, z) text
  • x0 x from
  • x1 x to
  • y0 y from
  • y1 y to
  • z0 z from
  • z1 z to

Returns

  • integral the value of the triple integral

Applies when

  • x0 < x1, y0 < y1, z0 < z1
  • f continuous on the box

Example

m.ask("Find the triple integral of x*y*z over [0, 1] x [0, 2] x [0, 3].")
→ integral = 4.5

Multivariable calculus 6

Directional derivativedirectional_derivative

The rate of change of f at a point in the direction of a vector u (u is normalised to unit length).

D_{\mathbf u} f = \nabla f\cdot\frac{\mathbf u}{|\mathbf u|}

Inputs

  • f the function f(x, y) or f(x, y, z) text
  • p the point vector
  • u the direction vector vector

Returns

  • directional_derivative D_u f at the point

Applies when

  • u != 0 with as many components as p
  • f differentiable at p

Example

m.ask("Find the directional derivative of x^2*y at (1, 2) in the direction (3, 4).")
→ directional_derivative = 3.2
Gradientgradient

The gradient vector of f(x, y) or f(x, y, z) at a point and its length (the greatest rate of increase).

\nabla f = \left(f_x, f_y, f_z\right)

Inputs

  • f the function f(x, y) or f(x, y, z) text
  • p the point (x, y) or (x, y, z) vector

Returns

  • gradient the gradient vector
  • magnitude its length

Applies when

  • f differentiable at the point

Example

m.ask("Find the gradient of x^2 + y^2 at (1, 2).")
→ gradient = [2.0, 4.0], magnitude = 4.47214
Jacobian determinantjacobian_determinant

The Jacobian determinant d(x, y)/d(u, v) of a transformation x = x(u, v), y = y(u, v) at a point.

\frac{\partial(x,y)}{\partial(u,v)} = x_u y_v - x_v y_u

Inputs

  • xu x as a function of u and v text
  • yv y as a function of u and v text
  • p the point (u, v) vector

Returns

  • jacobian the Jacobian determinant at the point

Applies when

  • x and y differentiable at the point

Example

m.ask("Find the Jacobian of x = u*cos(v), y = u*sin(v) at (2, 0.5).")
→ jacobian = 2
Partial derivativepartial_derivative

The partial derivative of f(x, y) or f(x, y, z) with respect to one variable, at a point.

\frac{\partial f}{\partial x}(p)

Inputs

  • f the function f(x, y) or f(x, y, z) text
  • var the variable choice
  • p the point (x, y) or (x, y, z) vector

Returns

  • partial the partial derivative at the point

Applies when

  • f differentiable at the point

Example

m.ask("Find the partial derivative of x^2*y + y^3 with respect to x at (1, 2).")
→ partial = 4
Second derivative test (two variables)hessian_classification

Classifies a critical point of f(x, y) as a local minimum, local maximum or saddle point from the Hessian.

D = f_{xx}f_{yy} - f_{xy}^2

Inputs

  • f the function f(x, y) text
  • p the critical point (x, y) vector

Returns

  • fxx f_xx
  • fxy f_xy
  • fyy f_yy
  • D D = f_xx f_yy - f_xy^2
  • classification local minimum, local maximum or saddle point

Applies when

  • the gradient is zero at the point
  • D != 0 (D = 0 is inconclusive and refused)

Example

m.ask("Classify the critical point of x^2 + 3y^2 - 2x at (1, 0).")
→ fxx = 2, fxy = 0, fyy = 6, D = 12, classification = local minimum
Tangent planetangent_plane

The tangent plane z = f_x x + f_y y + c to the surface z = f(x, y) at (x0, y0).

z = f(x_0,y_0) + f_x(x - x_0) + f_y(y - y_0)

Inputs

  • f the surface z = f(x, y) text
  • p the point (x0, y0) vector

Returns

  • z0 f(x0, y0)
  • fx f_x(x0, y0)
  • fy f_y(x0, y0)
  • c the constant term c

Applies when

  • f differentiable at (x0, y0)

Example

m.ask("Find the tangent plane to z = x^2 + y^2 at (1, 2).")
→ z0 = 5, fx = 2, fy = 4, c = -5

Numerical differentiation 1

Finite-difference derivativenumerical_derivative

A forward, backward or central difference approximation of f'(a) with step h, with the exact derivative and the error.

f'(a) \approx \frac{f(a+h) - f(a-h)}{2h}

Inputs

  • f the function f(x) text
  • a the point x = a
  • h the step size h > 0
  • method forward, backward or central difference choice

Returns

  • approximation the difference quotient
  • exact the exact f'(a)
  • error approximation - exact

Applies when

  • h > 0
  • f defined at the points used

Example

m.ask("Estimate the derivative of x^2 at x = 1 using a central difference with h = 0.1.")
→ approximation = 2, exact = 2, error = 0

Numerical integration 4

Gauss-Legendre quadraturegauss_legendre

The 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.

\int_a^b f\,dx \approx \frac{b-a}{2}\sum_{i=1}^n w_i\, f\!\left(\frac{a+b}{2} + \frac{b-a}{2}x_i\right)

Inputs

  • f the function f(x) text
  • a left end
  • b right end
  • n number of nodes integer

Returns

  • approximation n-point Gauss-Legendre value
  • exact the integral
  • error approximation - exact

Applies when

  • a < b
  • 1 <= n <= 64
  • f continuous on [a, b]

Example

m.ask("Use 2-point Gauss-Legendre quadrature to approximate the integral of x^3 + x^2 from 0 to 2.")
→ approximation = 6.66667, exact = 6.66667, error = 0
Midpoint rulemidpoint_rule

The composite midpoint approximation of the integral of f on [a, b] with n subintervals, with the exact value and the error.

M_n = h\sum_{k=0}^{n-1} f\left(a + (k + \tfrac12) h\right)

Inputs

  • f the function f(x) text
  • a left end
  • b right end
  • n number of equal subintervals integer

Returns

  • approximation midpoint approximation M_n
  • exact the integral
  • error M_n - exact

Applies when

  • a < b
  • 1 <= n <= 100000
  • f continuous on [a, b]

Example

m.ask("Approximate the integral of x^2 from 0 to 2 using the midpoint rule with n = 4.")
→ approximation = 2.625, exact = 2.66667, error = -0.0416667
Simpson's rulesimpson_rule

The 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.

S_n = \frac{h}{3}\left[f(x_0) + 4\sum_{\text{odd } k} f(x_k) + 2\sum_{\text{even } k} f(x_k) + f(x_n)\right]

Inputs

  • f the function f(x) text
  • a left end
  • b right end
  • n number of equal subintervals integer

Returns

  • approximation Simpson approximation S_n
  • exact the integral
  • error S_n - exact

Applies when

  • a < b
  • n even, 2 <= n <= 100000
  • f continuous on [a, b]

Example

m.ask("Approximate the integral of x^4 from 0 to 2 using Simpson's rule with 4 subintervals.")
→ approximation = 6.41667, exact = 6.4, error = 0.0166667
Trapezoidal ruletrapezoid_rule

The composite trapezoidal approximation of the integral of f on [a, b] with n subintervals, with the exact value and the error (approximation - exact).

T_n = \frac{h}{2}\left[f(x_0) + 2\sum_{k=1}^{n-1} f(x_k) + f(x_n)\right]

Inputs

  • f the function f(x) text
  • a left end
  • b right end
  • n number of equal subintervals integer

Returns

  • approximation trapezoidal approximation T_n
  • exact the integral
  • error T_n - exact

Applies when

  • a < b
  • 1 <= n <= 100000
  • f continuous on [a, b]

Example

m.ask("Approximate the integral of x^2 from 0 to 2 using the trapezoidal rule with n = 4.")
→ approximation = 2.75, exact = 2.66667, error = 0.0833333

Numerical methods 1

Newton's methodnewton_method

n iterations of Newton's method x_{k+1} = x_k - f(x_k)/f'(x_k) for a root of f, from x_0.

x_{k+1} = x_k - \frac{f(x_k)}{f'(x_k)}

Inputs

  • f the function f(x) text
  • x0 the starting value x_0
  • n number of iterations integer

Returns

  • x_n the n-th iterate
  • f_x_n f(x_n)
  • iterates x_1 .. x_n

Applies when

  • f'(x_k) != 0 at every iterate
  • 1 <= n <= 50

Example

m.ask("Apply Newton's method to f(x) = x^2 - 2 starting at x0 = 1 for 3 iterations.")
→ x_n = 1.41422, f_x_n = 6.0073e-06, iterates = [1.5, 1.4166666666666667, 1.4142156862745099]

Parametric curves 2

Arc length of a parametric curveparametric_arc_length

The length of the curve x = x(t), y = y(t) for t0 <= t <= t1.

L = \int_{t_0}^{t_1}\sqrt{x'(t)^2 + y'(t)^2}\,dt

Inputs

  • xt x(t) text
  • yt y(t) text
  • t0 start parameter
  • t1 end parameter

Returns

  • arc_length the length of the curve

Applies when

  • t0 < t1
  • x and y continuously differentiable

Example

m.ask("Find the arc length of the parametric curve x = cos(t), y = sin(t) from t = 0 to t = pi.")
→ arc_length = 3.14159
Slope and concavity of a parametric curveparametric_slope

dy/dx and d^2y/dx^2 of the curve x = x(t), y = y(t) at a parameter value t0.

\frac{dy}{dx} = \frac{y'(t)}{x'(t)},\quad \frac{d^2y}{dx^2} = \frac{\frac{d}{dt}\frac{dy}{dx}}{x'(t)}

Inputs

  • xt x(t) text
  • yt y(t) text
  • t0 the parameter value

Returns

  • dy_dx dy/dx at t0
  • d2y_dx2 d^2y/dx^2 at t0

Applies when

  • dx/dt != 0 at t0

Example

m.ask("Find dy/dx for x = t^2, y = t^3 at t = 1.")
→ dy_dx = 1.5, d2y_dx2 = 0.75

Polar curves 1

Area in polar coordinatespolar_area

The area swept by the polar curve r = r(theta) between theta = alpha and theta = beta.

A = \frac{1}{2}\int_{\alpha}^{\beta} r(\theta)^2\,d\theta

Inputs

  • r the polar curve r(theta) text
  • al alpha, the start angle (radians)
  • be beta, the end angle (radians)

Returns

  • area the area

Applies when

  • alpha < beta <= alpha + 2 pi
  • r continuous

Example

m.ask("Find the area enclosed by the polar curve r = 1 + cos(theta) from theta = 0 to theta = 2pi.")
→ area = 4.71239

Series 6

Partial sum of a geometric seriesgeometric_partial_sum

The sum of the first n terms a + a r + ... + a r^(n-1).

S_n = a\,\frac{1 - r^n}{1 - r}

Inputs

  • a the first term
  • r the common ratio
  • n the number of terms integer

Returns

  • sum the sum of the first n terms

Applies when

  • 1 <= n <= 500

Example

m.ask("Find the sum of the first 4 terms of the geometric series with first term 2 and ratio 3.")
→ sum = 80
Ratio testratio_test

The 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).

L = \lim_{n\to\infty}\left|\frac{a_{n+1}}{a_n}\right|

Inputs

  • a the general term a_n, in n text

Returns

  • ratio_limit L = lim |a_(n+1)/a_n|
  • verdict converges or diverges

Applies when

  • L exists, is finite and is not 1 (L = 1 is inconclusive and refused)

Example

m.ask("Apply the ratio test to the series 2^n/n^3.")
→ ratio_limit = 2, verdict = diverges
Sum of an arithmetic seriesarithmetic_series_sum

The sum of the first n terms of an arithmetic sequence, and its last term.

S_n = \frac{n}{2}\left(2a_1 + (n-1)d\right)

Inputs

  • a1 the first term
  • d the common difference
  • n the number of terms integer

Returns

  • sum the sum of the first n terms
  • last_term the n-th term

Applies when

  • n >= 1

Example

m.ask("Find the sum of the first 10 terms of the arithmetic series with first term 2 and common difference 3.")
→ sum = 155, last_term = 29
Sum of an infinite geometric seriesgeometric_series_sum

The sum a + a r + a r^2 + ... of a convergent geometric series.

\sum_{n=0}^{\infty} a r^n = \frac{a}{1-r}

Inputs

  • a the first term
  • r the common ratio

Returns

  • sum the sum of the series

Applies when

  • |r| < 1

Example

m.ask("Find the sum of the geometric series with first term 3 and ratio 0.5.")
→ sum = 6
Sum of an infinite seriesseries_sum

The exact sum of a convergent series sum_{n=k}^infinity a_n (telescoping, geometric-type, zeta values, alternating harmonic, ...).

\sum_{n=k}^{\infty} a_n

Inputs

  • a the general term a_n, in n text
  • k the starting index integer

Returns

  • sum the sum of the series

Applies when

  • the series converges
  • a closed form exists

Example

m.ask("Find the sum of the series 1/n^2 from n = 1 to infinity.")
→ sum = 1.64493
Taylor polynomialtaylor_polynomial

The 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.

P_n(x) = \sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k

Inputs

  • f the function f(x) text
  • a the centre x = a
  • n the degree integer
  • x1 the evaluation point

Returns

  • coefficients 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)

Applies when

  • f is n times differentiable at a and defined at x1
  • 0 <= n <= 12

Example

m.ask("Find the Taylor polynomial of degree 3 of exp(x) about x = 0 and evaluate it at x = 0.5.")
→ coefficients = [1.0, 1.0, 0.5, 0.16666666666666666], value = 1.64583, function_value = 1.64872, error = 0.00288794

Special functions 8

Bessel function of the first kindbessel_j

The Bessel function J_n(x) of whole-number order n.

J_n(x) = \sum_{m=0}^{\infty}\frac{(-1)^m}{m!\,(m+n)!}\left(\frac{x}{2}\right)^{2m+n}

Inputs

  • n the order n integer
  • x the argument x

Returns

  • J J_n(x)

Applies when

  • 0 <= n <= 50
  • |x| <= 1000

Example

m.ask("Evaluate the Bessel function J_0(1).")
→ J = 0.765198
Beta functionbeta_function

The beta function B(a, b) for positive a and b.

B(a,b) = \int_0^1 t^{a-1}(1-t)^{b-1}dt = \frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}

Inputs

  • a the first argument (> 0)
  • b the second argument (> 0)

Returns

  • beta B(a, b)

Applies when

  • a > 0
  • b > 0

Example

m.ask("Evaluate the beta function B(2, 3).")
→ beta = 0.0833333
Chebyshev polynomialchebyshev_polynomial

The value of the Chebyshev polynomial of the first kind T_n(x) (T_n(cos t) = cos(n t)).

T_{k+1}(x) = 2x\,T_k(x) - T_{k-1}(x)

Inputs

  • n the degree n integer
  • x the argument x

Returns

  • T T_n(x)

Applies when

  • 0 <= n <= 500

Example

m.ask("Evaluate the Chebyshev polynomial T_3(0.5).")
→ T = -1
Error functionerror_function

The error function erf(x) and the complementary error function erfc(x) = 1 - erf(x).

\operatorname{erf}(x) = \frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}\,dt

Inputs

  • x the argument x

Returns

  • erf erf(x)
  • erfc erfc(x)

Applies when

  • x real

Example

m.ask("Evaluate erf(0.5).")
→ erf = 0.5205, erfc = 0.4795
Gamma functiongamma_function

The value of the gamma function (Gamma(n) = (n-1)! for whole n).

\Gamma(x) = \int_0^\infty t^{x-1}e^{-t}\,dt

Inputs

  • x the argument x

Returns

  • gamma Gamma(x)

Applies when

  • x is not 0 or a negative whole number
  • x < 171.6

Example

m.ask("Evaluate the gamma function at x = 4.5.")
→ gamma = 11.6317
Legendre polynomiallegendre_polynomial

The value of the Legendre polynomial P_n(x).

(k+1)P_{k+1}(x) = (2k+1)\,x\,P_k(x) - k\,P_{k-1}(x)

Inputs

  • n the degree n integer
  • x the argument x

Returns

  • P P_n(x)

Applies when

  • 0 <= n <= 200

Example

m.ask("Evaluate the Legendre polynomial P_3(0.5).")
→ P = -0.4375
Regularized incomplete gamma functionsregularized_gamma

The regularized lower and upper incomplete gamma functions P(a, x) and Q(a, x) = 1 - P(a, x).

P(a,x) = \frac{1}{\Gamma(a)}\int_0^x t^{a-1}e^{-t}\,dt

Inputs

  • a the shape a (> 0)
  • x the upper limit x (>= 0)

Returns

  • P P(a, x) = gamma(a, x)/Gamma(a)
  • Q Q(a, x) = Gamma(a, x)/Gamma(a)

Applies when

  • a > 0
  • x >= 0

Example

m.ask("Find the regularized incomplete gamma function P(2, 3).")
→ P = 0.800852, Q = 0.199148
Riemann zeta functionriemann_zeta

The Riemann zeta function zeta(s) = sum 1/n^s for s > 1 (the p-series sum).

\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s}

Inputs

  • s the argument s (> 1)

Returns

  • zeta zeta(s)

Applies when

  • s > 1

Example

m.ask("Find zeta(2).")
→ zeta = 1.64493

Vector calculus 7

Curlcurl

The curl of a vector field F = (P, Q, R) at a point.

\nabla\times\mathbf F = (R_y - Q_z,\ P_z - R_x,\ Q_x - P_y)

Inputs

  • P the x-component P(x, y, z) text
  • Q the y-component Q(x, y, z) text
  • R the z-component R(x, y, z) text
  • p the point (x, y, z) vector

Returns

  • curl curl F at the point

Applies when

  • the components are differentiable at the point

Example

m.ask("Find the curl of F = (x*y, y*z, z*x) at (1, 2, 3).")
→ curl = [-2.0, -3.0, -1.0]
Divergencedivergence

The divergence P_x + Q_y + R_z of a vector field F = (P, Q, R) at a point.

\nabla\cdot\mathbf F = P_x + Q_y + R_z

Inputs

  • P the x-component P(x, y, z) text
  • Q the y-component Q(x, y, z) text
  • R the z-component R(x, y, z) text
  • p the point (x, y, z) vector

Returns

  • divergence div F at the point

Applies when

  • the components are differentiable at the point

Example

m.ask("Find the divergence of F = (x*y, y*z, x*z) at (1, 2, 3).")
→ divergence = 6
Green's theorem on a rectanglegreens_theorem

Both 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.

\oint_C P\,dx + Q\,dy = \iint_R \left(Q_x - P_y\right)dA

Inputs

  • P the x-component P(x, y) text
  • Q the y-component Q(x, y) text
  • a x from
  • b x to
  • c y from
  • d y to

Returns

  • circulation the boundary line integral (counter-clockwise)
  • double_integral the integral of Q_x - P_y

Applies when

  • a < b, c < d
  • P and Q continuously differentiable on the rectangle

Example

m.ask("Verify Green's theorem for F = (-y, x) on the rectangle [0, 1] x [0, 2].")
→ circulation = 4, double_integral = 4
Laplacianlaplacian

The Laplacian f_xx + f_yy (+ f_zz) of a function at a point.

\nabla^2 f = f_{xx} + f_{yy} + f_{zz}

Inputs

  • f the function f(x, y) or f(x, y, z) text
  • p the point vector

Returns

  • laplacian the Laplacian at the point

Applies when

  • f twice differentiable at the point

Example

m.ask("Find the Laplacian of x^2*y + z^3 at (1, 2, 3).")
→ laplacian = 22
Line integral of a vector fieldline_integral_vector

The line integral (work) of F = (P, Q) along the path x = x(t), y = y(t) from t0 to t1.

\int_C \mathbf F\cdot d\mathbf r = \int_{t_0}^{t_1} \left(P\,x'(t) + Q\,y'(t)\right)dt

Inputs

  • P the x-component P(x, y) text
  • Q the y-component Q(x, y) text
  • xt the path x(t) text
  • yt the path y(t) text
  • t0 start parameter
  • t1 end parameter

Returns

  • line_integral the integral of F . dr along the path

Applies when

  • the integrand is continuous for t between t0 and t1

Example

m.ask("Find the line integral of F = (-y, x) along x = cos(t), y = sin(t) from t = 0 to t = 2pi.")
→ line_integral = 6.28319
Line integral with respect to arc lengthline_integral_scalar

The 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).

\int_C f\,ds = \int_{t_0}^{t_1} f(x(t),y(t))\sqrt{x'(t)^2 + y'(t)^2}\,dt

Inputs

  • f the function f(x, y) text
  • xt the path x(t) text
  • yt the path y(t) text
  • t0 start parameter
  • t1 end parameter

Returns

  • line_integral the integral of f ds along the path

Applies when

  • t0 < t1
  • the integrand continuous on [t0, t1]

Example

m.ask("Find the line integral of x + y ds along x = t, y = t from t = 0 to t = 1.")
→ line_integral = 1.41421
Outward flux through a box (divergence theorem)divergence_theorem_box

The outward flux of F = (P, Q, R) through the surface of the box [x0, x1] x [y0, y1] x [z0, z1].

\oiint_S \mathbf F\cdot\mathbf n\,dS = \iiint_B \nabla\cdot\mathbf F\,dV

Inputs

  • P the x-component text
  • Q the y-component text
  • R the z-component text
  • x0 x from
  • x1 x to
  • y0 y from
  • y1 y to
  • z0 z from
  • z1 z to

Returns

  • flux the outward flux

Applies when

  • the box is non-degenerate
  • F continuously differentiable on the box

Example

m.ask("Find the outward flux of F = (x^2, y^2, z^2) through the box [0, 1] x [0, 1] x [0, 1].")
→ flux = 3
Questions

Frequently asked

What does calculus-ai999x do?

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.

How do I install calculus-ai999x?

With pip: pip install calculus-ai999x. The same files are on Hugging Face (hf download AI999X/calculus-ai999x --local-dir calculus-ai999x) and GitHub.

Does it run offline?

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.

How many capabilities does calculus-ai999x have?

71 capabilities in 14 topics, including Derivatives, Integrals, Special functions, Vector calculus, Multivariable calculus.

Which field and tasks does it cover?

Field: Mathematics & Statistics. Tasks: Question Answering, Token Classification, Text Classification, Sentence Similarity, Feature Extraction.

What does an answer look like?

Asked "Find the limit of (x^2 - 4)/(x - 2) as x approaches 2.", it answers: limit = 4.

What happens when a question cannot be answered?

It says so and names what is missing or out of range, instead of guessing a number.

More from AI999X

Explore every model.