# mXparser - user defined functions applied to Fundamental theorem of calculus

Fundamental Theorem of Calculus is a kind of a link between two most important calculus concepts: derivative and integral.

## Fundamental Theorem of Calculus - formal statement

For continuous real-valued function $f:[a,b]\to\mathbb{R}$ defined on closed interval $[a,b]$ let $F:[a,b]\to\mathbb{R}$ be the function given by

$F(x)=\int_a^x f(t)\text{d}t$

The $F$ is uniformly continuous on $[a, b]$, differentiable on the open interval $(a, b)$, and

$F'(x)=f(x)$

## Fundamental Theorem of Calculus - mXparser test

import org.mariuszgromada.math.mxparser.*;
...
/* Function */
Function f = new Function("f(x) = sin(x)");

/* Antiderivative */
Function F = new Function("F(x) = int(f(t), t, 0, x)", f);

/* function = derivative ( antiderivative ) */
Argument x = new Argument("x = pi");
Expression e = new Expression("f(x) - der(F(x), x)", x, f, F);
mXparser.consolePrintln("Res : " + e.getExpressionString() + " = " + e.calculate());
mXparser.consolePrintln("Computing time = " + e.getComputingTime() + " s.");

Res : f(x) - der(F(x), x) = 6.237833817291525E-8
Computing time = 0.411 s.


Best regards,
Mariusz Gromada

## 6 thoughts on “mXparser - user defined functions applied to Fundamental theorem of calculus”

1. I’m not that much of a online reader to be honest but your sites really nice, keep
it up! I'll go ahead and bookmark your website
to come back later on. All the best

1. admin says:

Thanx a lot 🙂 Best regards - Mariusz

2. Carlo says:

Hello, i feel that i saw you visited my website so i got here to go back the
prefer?.I'm trying to find issues to enhance my site!I assume its ok to use a few of your ideas!!

1. Mariusz Gromada says:

Sure, go ahead!

3. Nagireddy.Bhavanam says:

Can you give max length of formula string

1. Mariusz Gromada says:

Formula string is a String type - if limitation exist this is related to String class. Additionally internal iterators are "int" types, so forula length is definitely limited by max int 🙂