Mathc initiation/0026
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
|---|
/* ---------------------------------- */
/* save as c00a.c */
/* ---------------------------------- */
#include "x_hfile.h"
#include "fa.h"
/* ---------------------------------- */
int main(void)
{
int n = 2*50;
double a = -1.;
double b = +1.;
clrscrn();
printf("An odd function with respect to x\n\n"
" (%.3f \n"
" int( (%s) * dx = %.6f \n"
" (%.3f \n\n\n\n",
b, feq, simpson(f,a,b,n), a);
printf(" With the antiderivative of f.\n\n"
" F(x) = %s \n\n\n"
" F(%.3f) - F(%.3f) = %.6f \n\n\n", Feq, b,a, F(b)-F(a));
stop();
return 0;
}
/* ---------------------------------- */
/* ---------------------------------- */
Verifier avec mathematica : Free: wolframalpha.com
int sin(x) dx from -a to a
Exemple de sortie écran :
An odd function with respect to x
(1.000
int( (sin(x)) * dx = -0.000000
(-1.000
With the antiderivative of f.
F(x) = -cos(x)
F(1.000) - F(-1.000) = 0.000000
Press return to continue.