Aller au contenu

Mathc initiation/Fichiers c : c30cf

Un livre de Wikilivres.


Sommaire


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

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

 clrscrn();
 printf(" Does lim x->0 %s exist ?\n\n", feq);
 printf(" Substituing 0 for x gives 1**(oo).\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(%+.0e) = %5.4f || f(%+.0e) = %5.4f || f(%+.0e) = %5.4f\n",
     i,    f(i),
     i*.1, f(i*.1),
     i*.001,f(i*.001)
     );
 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=-.9; i<-0.1; i+=.1)
     printf(" f(%+.0e) = %7.4f || f(%+.0e) = %5.4f || f(%+.0e) = %5.4f\n",
     i,    f(i),
     i*.1, f(i*.1),
     i*.001,f(i*.001)
     );
     
 printf(" \n\n");
 printf(" With the table we arrive at the following conjecture.\n\n");
 printf("     lim x->0 %s = (%+.4f) = e \n\n", feq,exp(1));
 stop();

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


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

    Étudions ce cas : 


Exemple de sortie écran :

 Does lim x->0 (1+x)**(1./x) exist ?

 Substituing 0 for x gives 1**(oo).
 Press return to continue. 


**************************************


 f : x-> (1+x)**(1./x)

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

 f(+1e+00) = 2.0000 || f(+1e-01) = 2.5937 || f(+1e-03) = 2.7169
 f(+9e-01) = 2.0405 || f(+9e-02) = 2.6053 || f(+9e-04) = 2.7171
 f(+8e-01) = 2.0849 || f(+8e-02) = 2.6170 || f(+8e-04) = 2.7172
 f(+7e-01) = 2.1341 || f(+7e-02) = 2.6289 || f(+7e-04) = 2.7173
 f(+6e-01) = 2.1888 || f(+6e-02) = 2.6410 || f(+6e-04) = 2.7175
 f(+5e-01) = 2.2500 || f(+5e-02) = 2.6533 || f(+5e-04) = 2.7176
 f(+4e-01) = 2.3191 || f(+4e-02) = 2.6658 || f(+4e-04) = 2.7177
 f(+3e-01) = 2.3978 || f(+3e-02) = 2.6786 || f(+3e-04) = 2.7179
 f(+2e-01) = 2.4883 || f(+2e-02) = 2.6916 || f(+2e-04) = 2.7180
 f(+1e-01) = 2.5937 || f(+1e-02) = 2.7048 || f(+1e-04) = 2.7181
 Press return to continue. 


**************************************


 f : x-> (1+x)**(1./x)

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

 f(-9e-01) = 12.9155 || f(-9e-02) = 2.8516 || f(-9e-04) = 2.7195
 f(-8e-01) =  7.4767 || f(-8e-02) = 2.8356 || f(-8e-04) = 2.7194
 f(-7e-01) =  5.5843 || f(-7e-02) = 2.8200 || f(-7e-04) = 2.7192
 f(-6e-01) =  4.6050 || f(-6e-02) = 2.8046 || f(-6e-04) = 2.7191
 f(-5e-01) =  4.0000 || f(-5e-02) = 2.7895 || f(-5e-04) = 2.7190
 f(-4e-01) =  3.5861 || f(-4e-02) = 2.7747 || f(-4e-04) = 2.7188
 f(-3e-01) =  3.2835 || f(-3e-02) = 2.7602 || f(-3e-04) = 2.7187
 f(-2e-01) =  3.0518 || f(-2e-02) = 2.7460 || f(-2e-04) = 2.7186
 f(-1e-01) =  2.8680 || f(-1e-02) = 2.7320 || f(-1e-04) = 2.7184
 

 With the table we arrive at the following conjecture.

     lim x->0 (1+x)**(1./x) = (+2.7183) = e 

 Press return to continue.