Advanced maths

Antiderivative family and slope field visualizer

Recognize limited elementary antiderivatives, plot a numerical base and constant-shifted family with a slope field, and export the SVG.

Your numbers

Use explicit multiplication. Powers, sin, cos, sec, exp, natural log, sqrt, abs, pi and e are supported numerically; symbolic recognition is limited to the stated elementary rules.
Choose a point inside the window where the integrand is defined.
At most 2,500 steps per direction; a separate half-step run provides a comparison.
1–7 distinct finite constants within ±10,000, separated by spaces or commas. Each shifts the numerical base vertically.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Try it, understand it

Explore the result

Compare a recognized primitive, its anchored numerical base and the family obtained by adding constants.

Worked example comparison
ExampleOutputWhat to notice
Original 2x exampleRecognized antiderivative family(x ^ 2) + CThe family is x²+C, with the zero-anchored numerical base matching x².
A different primitive constantRecognized antiderivative family(-1 * cos(x)) + CThe recognized −cos(x) differs from the zero-anchored numerical base by a constant.
Exponential primitiveRecognized antiderivative familyexp(x) + CThe recognized exp(x) is compared after subtracting its anchor value one.
One valid reciprocal domainRecognized antiderivative familyln(abs(x)) + CThe window stays on the positive component and the recognized primitive is ln|x|.
Numerical-only familyRecognized antiderivative familyNumerical family only — no symbolic rule recognizedThe elementary recognizer does not invent a formula for this smooth numerical example.

Check your understanding

Does changing the numerical anchor change the whole family of possible primitives?

No. It changes which additive-constant member is chosen as the numerical base.

Why do all family members have the same slope at a fixed x?

Their differences are constants, whose derivatives are zero.

Behind the numbers

How this calculation works

Recognize supported elementary rules where possible, while keeping numerical-only cases explicit. Integrate y′=f(x) from a selected anchor in both directions, then add the selected constants to visualize the antiderivative family. The slope field draws directions (1,f(x)); every constant-shifted curve has the same local slope at a fixed x.

THE FORMULAIf F′(x)=f(x), then every F(x)+C has derivative f(x); numerical base uses F(anchor)=0

A worked example

For f(x)=2x, an elementary primitive is x² and the family is x²+C. With anchor zero, the numerical base also has F(0)=0. For f(x)=sin(x), a recognized primitive is −cos(x), while the numerical zero-anchored base is 1−cos(x); the two differ only by an additive constant.

Good to know

Limited elementary recognition rather than a general symbolic integrator. The numerical family uses fixed-step RK4 with explicit anchor and stopping reasons; finite samples do not prove continuity or detect every hidden singularity. A real connected domain component and suitable smoothness must be established separately. Half-step agreement is not a certified error bound. Numerical and recognized primitives can use different additive constants.

An indefinite integral describes a family

An antiderivative F has derivative f on the domain interval under discussion. Adding a constant C leaves that derivative unchanged because a constant has derivative zero. The notation ∫f(x)dx=F(x)+C therefore represents a family rather than one uniquely selected curve.

The visualizer keeps that family separate from a definite integral, which produces a signed accumulation between limits. Its window controls describe what is drawn, while its anchor selects a numerical base satisfying F(anchor)=0. The chosen C values then shift that base vertically. The anchor is part of the numerical construction, not an extra property shared by every possible primitive.

A little curiosity

Follow the original linear-integrand example

For f(x)=2x, the power rule gives an elementary primitive x². The curves x²−2, x²−1, x², x²+1 and x²+2 all have derivative 2x. At a fixed x, their heights differ but their tangent slopes match. The table retains the numerical base and every requested constant shift so that this relationship is visible in both coordinates and arithmetic.

With anchor zero, x² already satisfies F(0)=0, so it matches the chosen numerical base apart from roundoff. Changing the anchor to one would instead select the base x²−1. That does not change the family of possible antiderivatives; it changes which member receives the numerical label C=0.

Keep the recognized primitive’s constant separate from the numerical anchor

For f(x)=sin(x), a familiar elementary primitive is −cos(x). Its value at zero is −1. The numerical base anchored at zero instead has value zero and corresponds to 1−cos(x). Comparing those two curves without adjusting their additive constant would incorrectly report a constant error of one.

When a recognized primitive can be evaluated, the comparison subtracts its value at the anchor before comparing sampled points with the numerical base. The symbolic family still displays its usual arbitrary C. The numerical table labels its own shifted base explicitly, so a zero family constant is not mistaken for a universally preferred antiderivative.

Use the slope field to understand vertical shifts

The slope field represents the differential equation y′=f(x). At every sampled position with a given x, the arrow direction is (1,f(x)), independent of y. This is why all vertically shifted members of the family follow the same local tangent directions. Changing C moves a curve through the field without changing the rate rule.

The graph uses independently scaled axes to fit the computed family. Both arrow components are transformed using those axis scales, so the screen direction corresponds to the stated coordinate slope. Arrows use one common display factor and do not encode a physical speed or prove that every point between samples is regular. Undefined slope samples are omitted and counted rather than replaced by zero.

Recognize the limits of the symbolic result

The recognizer handles constants, sums and constant multiples of supported primitives, powers of affine expressions, simple reciprocal forms, elementary sine/cosine/exponential cases and the secant-squared rule. These cover the basic polynomial and trigonometric forms of the original task. It is not a full computer-algebra integration system.

A more complicated expression can still receive a numerical family when the elementary rules do not recognize a symbolic primitive. That output is labeled numerical-only. Failure to recognize a formula does not prove that no elementary antiderivative exists, and a plotted numerical curve is not presented as a symbolic expression.

Substitution is a mathematical method for matching an inner expression and its derivative. The limited affine substitutions recognized here do not automatically solve arbitrary products or discover every useful substitution. Check any proposed symbolic result by differentiating it on the intended real domain.

Respect the anchor’s valid domain component

The numerical base is integrated from the anchor using fixed-step RK4 in both directions. A required undefined stage or a state safety limit stops that direction and leaves an explicit stopping message. The tool does not fabricate a point to continue through a known singularity. A finer-step run supplies an endpoint comparison only when both runs reach the same requested endpoints.

For an integrand such as 1/x, choose a window and anchor inside an appropriate connected domain component. The recognized ln|x| rule does not join the positive and negative domains into one integration path through zero. Finite sampling can still miss a singularity between nodes; establish the relevant real domain independently before interpreting a numerical run.

The first-order ODE solver restores a more general y′=f(x,y) initial-value task with a selectable initial point. The trapezoidal and Simpson integration calculator computes finite-interval signed accumulation. Those related pages illuminate different meanings of integration, and neither replaces the arbitrary-constant reasoning in an antiderivative family.

A few questions, answered

Why are there several curves?

Each chosen C shifts the same numerical base vertically and leaves its derivative unchanged.

Does C=0 select the same curve for every primitive formula?

No. The numerical base is anchored explicitly, while a recognized primitive can choose a different additive constant.

Does numerical-only mean there is no symbolic antiderivative?

No. It means the limited elementary recognizer did not identify one.

Can the numerical curve continue through 1/x at zero?

No valid antiderivative interval crosses that singularity. Choose and analyze an appropriate connected real domain.

Is the half-step difference a certified error bound?

No. It is a numerical comparison at matching endpoints.

Find your calculator

Start typing to explore the library.