<html> <body> <table> <tbody> <tr> <td> <?php
/* Données */ $a=0; $b=2; function f($x){ return 4*pow($x,4)/(1 + pow($x,6)); } $n=20; // Nombre d'intervalles partiels = (Nombre de points) - 1 /* Tabulation de la fonction f sur l'intervalle [a, b] */ echo "<p><b>Tabulation de la fonction <i>f</i> sur l'intervalle [".$a.", ".$b."]</b></p>"; echo '<table style="max-width:360px"><tbody>'; $h=($b-$a)/$n; for($i=0; $i <= $n; $i++){ $x=$a + $i*$h; $y=f($x); echo '<tr><td style="text-align:right;">' .number_format($x, 3, '.', ' ') .'</td><td style="text-align:right;">' .number_format($y, 9, '.', ' ') .'</td></tr>'; } echo "</tbody></table>";
?> </td> </tr> </tbody> </table> </body> </html>