Aller au contenu

Mathc initiation/Fichiers c : c30cc

Un livre de Wikilivres.


Sommaire


Installer et compiler ces fichiers dans votre répertoire de travail.

c2c.c
/* --------------------------------- */
/* save as c2c.c                     */
/* --------------------------------- */
#include  "x_hfile.h"
#include       "fc.h"
/* --------------------------------- */
int main(void)
{
double i;

 clrscrn();
 printf(" Does lim x->0 %s exist ?\n\n", feq);
 printf(" Substituing 0 for x gives 0/0.\n");
 stop();


 clrscrn();
 printf(" f : x-> %s\n\n", feq);

 printf(" Approximate f(x) by the right,\n");
 printf(" for x near 0.\n\n");

 for(i=1; i>0.1; i+=-.1)
     printf(" f(%+.5f) = %5.6f || f(%+.6f) = %5.7f\n",
     i*.0001, f(i*.0001),
     i*.00001,f(i*.00001)
     );
 stop();


 clrscrn();
 printf(" f : x-> %s\n\n", feq);

 printf(" Approximate f(x) by the left,\n");
 printf(" for x near 0.\n\n");

 for(i=-1; i<-0.1; i+=.1)
    printf(" f(%+.5f) = %5.6f || f(%+.6f) = %5.7f\n",
     i*.0001, f(i*.0001),
     i*.00001,f(i*.00001)
     );
  stop();


 clrscrn();
 printf(" With the table we arrive at the following conjecture.\n\n");
 printf("     lim x->0 %s = 0\n\n", feq);
 stop();

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


On peut obtenir le même résultat en utilisant la Règle de L'Hôpital. [wikipedia].
  (1-cos(x))'/(x)' = (sin(x)) / 1  
  
  et lim x->0   (sin(x)) = 0

Exemple de sortie écran :

 Does lim x->0 (1-cos(x))/x exist ?

 Substituing 0 for x gives 0/0.
 Press return to continue.

Exemple de sortie écran :

 f : x-> (1-cos(x))/x

 Approximate f(x) by the right,
 for x near 0.

 f(+0.00010) = 0.000050 || f(+0.000010) = 0.0000050
 f(+0.00009) = 0.000045 || f(+0.000009) = 0.0000045
 f(+0.00008) = 0.000040 || f(+0.000008) = 0.0000040
 f(+0.00007) = 0.000035 || f(+0.000007) = 0.0000035
 f(+0.00006) = 0.000030 || f(+0.000006) = 0.0000030
 f(+0.00005) = 0.000025 || f(+0.000005) = 0.0000025
 f(+0.00004) = 0.000020 || f(+0.000004) = 0.0000020
 f(+0.00003) = 0.000015 || f(+0.000003) = 0.0000015
 f(+0.00002) = 0.000010 || f(+0.000002) = 0.0000010
 f(+0.00001) = 0.000005 || f(+0.000001) = 0.0000005
 Press return to continue.


Exemple de sortie écran :

 f : x-> (1-cos(x))/x

 Approximate f(x) by the left,
 for x near 0.

 f(-0.00010) = -0.000050 || f(-0.000010) = -0.0000050
 f(-0.00009) = -0.000045 || f(-0.000009) = -0.0000045
 f(-0.00008) = -0.000040 || f(-0.000008) = -0.0000040
 f(-0.00007) = -0.000035 || f(-0.000007) = -0.0000035
 f(-0.00006) = -0.000030 || f(-0.000006) = -0.0000030
 f(-0.00005) = -0.000025 || f(-0.000005) = -0.0000025
 f(-0.00004) = -0.000020 || f(-0.000004) = -0.0000020
 f(-0.00003) = -0.000015 || f(-0.000003) = -0.0000015
 f(-0.00002) = -0.000010 || f(-0.000002) = -0.0000010
 f(-0.00001) = -0.000005 || f(-0.000001) = -0.0000005
 Press return to continue.


Exemple de sortie écran :

 With the table we arrive at the following conjecture.

     lim x->0 (1-cos(x))/x = 0

 Press return to continue.