Mathc initiation/Fichiers c : c30ca


Sommaire


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

c2a.c
/* --------------------------------- */
/* save as c2a.c                     */
/* --------------------------------- */
#include  "x_hfile.h"
#include       "fa.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(%+.1f) = %5.3f || f(%+.2f) = %5.6f || f(%+.3f) = %5.8f\n",
     i,    f(i),
     i*.1, f(i*.1),
     i*.01,f(i*.01)
     );
 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(%+.1f) = %5.3f || f(%+.2f) = %5.6f || f(%+.3f) = %5.8f\n",
     i,    f(i),
     i*.1, f(i*.1),
     i*.01,f(i*.01)
     );
  stop();


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

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


On peut obtenir le même résultat en utilisant la Règle de L'Hôpital. [wikipedia].

  (sin(x))'/(x)' = cos(x)/1 et lim x->0  cos(x) = 1 

Remarque :

  (sin(A*x))'/(B*x)' = A*cos(A*x)/B et lim x->0  A*cos(A*x)/B = A*cos(A*0)/B = A/B 


Exemple de sortie écran :

 Does lim x->0 sin(x)/x exist ?

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

Exemple de sortie écran :

 f : x-> sin(x)/x

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

 f(+1.0) = 0.841 || f(+0.10) = 0.998334 || f(+0.010) = 0.99998333
 f(+0.9) = 0.870 || f(+0.09) = 0.998651 || f(+0.009) = 0.99998650
 f(+0.8) = 0.897 || f(+0.08) = 0.998934 || f(+0.008) = 0.99998933
 f(+0.7) = 0.920 || f(+0.07) = 0.999184 || f(+0.007) = 0.99999183
 f(+0.6) = 0.941 || f(+0.06) = 0.999400 || f(+0.006) = 0.99999400
 f(+0.5) = 0.959 || f(+0.05) = 0.999583 || f(+0.005) = 0.99999583
 f(+0.4) = 0.974 || f(+0.04) = 0.999733 || f(+0.004) = 0.99999733
 f(+0.3) = 0.985 || f(+0.03) = 0.999850 || f(+0.003) = 0.99999850
 f(+0.2) = 0.993 || f(+0.02) = 0.999933 || f(+0.002) = 0.99999933
 f(+0.1) = 0.998 || f(+0.01) = 0.999983 || f(+0.001) = 0.99999983
  Press return to continue.


Exemple de sortie écran :

 f : x-> sin(x)/x

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

 f(-1.0) = 0.841 || f(-0.10) = 0.998334 || f(-0.010) = 0.99998333
 f(-0.9) = 0.870 || f(-0.09) = 0.998651 || f(-0.009) = 0.99998650
 f(-0.8) = 0.897 || f(-0.08) = 0.998934 || f(-0.008) = 0.99998933
 f(-0.7) = 0.920 || f(-0.07) = 0.999184 || f(-0.007) = 0.99999183
 f(-0.6) = 0.941 || f(-0.06) = 0.999400 || f(-0.006) = 0.99999400
 f(-0.5) = 0.959 || f(-0.05) = 0.999583 || f(-0.005) = 0.99999583
 f(-0.4) = 0.974 || f(-0.04) = 0.999733 || f(-0.004) = 0.99999733
 f(-0.3) = 0.985 || f(-0.03) = 0.999850 || f(-0.003) = 0.99999850
 f(-0.2) = 0.993 || f(-0.02) = 0.999933 || f(-0.002) = 0.99999933
 f(-0.1) = 0.998 || f(-0.01) = 0.999983 || f(-0.001) = 0.99999983
 Press return to continue.


Exemple de sortie écran :

 With the table we arrive at the following conjecture.

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

 Press return to continue.