Aller au contenu

Mathc initiation/001U

Un livre de Wikilivres.


Sommaire

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)
{
double  M = 5 * simpson(f,a, b, LOOP);
                               
double  N =     simpson(g,a, b, LOOP);
                               
 clrscrn();
 printf("First property of linearity        \n\n" 
 
        "        (b             (b            \n"
        " (A) int( f(x) dx = int( (A) f(x) dx \n"
        "        (a             (a       \n\n\n");       
 stop();
   
 clrscrn();
 printf(" I multiply int(f(x) dx by 5 \n\n");
 
 printf(" f : x ->   %s              \n\n", feq);

 printf("             (%+.1f           \n", b);
 printf(" M = 5 * [int( %s  dx] = %.6f \n",feq, M);
 printf("             (%+.1f       \n\n\n", a);


 printf(" I multiply f(x) by 5      \n\n");
 
 printf(" g : x,y,z -> %s           \n\n", geq);
 
 printf("           (%+.1f            \n", b);
 printf(" N =    int(  %s  dx  = %.6f \n",geq, N);
 printf("           (%+.1f        \n\n\n", a);
 
  stop();

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */

Verifier avec mathematica : Free: wolframalpha.com

integral 5*(x**2+cos(x)+1)  dx from 0 to 1

Exemple de sortie écran :

First property of linearity        

        (b             (b            
 (A) int( f(x) dx = int( (A) f(x) dx 
        (a             (a       


 Press return to continue. 


 I multiply int(f(x) dx by 5 

 f : x ->   (x**2+cos(x)+1)              

             (+1.0           
 M = 5 * [int( (x**2+cos(x)+1)  dx] = 10.874022 
             (+0.0       


 I multiply f(x) by 5      

 g : x,y,z -> 5*(x**2+cos(x)+1)           

           (+1.0            
 N =    int(  5*(x**2+cos(x)+1)  dx  = 10.874022 
           (+0.0        


 Press return to continue.