Skip to content

Integration

Rafael Vuijk edited this page Aug 11, 2026 · 2 revisions

Analytical integration is available in AngouriMath.

Integration

Similarly to differentation, here you call method Integrate:

Entity expr = "a x2 + b x";
Console.WriteLine(expr.Integrate("x"));

Output:

a * x ^ 3 / 3 + b * x ^ 2 / 2 + C

An antiderivative is only defined up to a constant, and C is that constant. It is an ordinary variable, so substituting zero for it picks the antiderivative through the origin:

Entity expr = "a x2 + b x";
Console.WriteLine(expr.Integrate("x").Substitute("C", 0).InnerSimplified);

Output:

a * x ^ 3 / 3 + b * x ^ 2 / 2

If no integral can be found, it will return a node of integral. Example:

Entity expr = "{ x, a }";
Console.WriteLine(expr.Integrate("x"));

Output:

integral({ x, a }, x)

Same way as with derivative, you can use node Entity.Integralf inside an expression:

Entity expr = "integral(x2 + sin(x), x)";
Console.WriteLine(expr.Simplify());

Output:

C - cos(x) + x ^ 3 / 3

Extension: string.Integrate(Variable), in namespace AngouriMath.Extensions.

What the integrator does: a table of standard forms, splitting a sum, partial fractions over a denominator with a rational root, integration by parts, and trigonometric substitution. It is not a decision procedure — there is no Risch implementation — so plenty of integrands come back as an unevaluated integral node. That is the honest answer and not an error: NaN would mean the integral does not exist.

Clone this wiki locally