File size: 212,010 Bytes
08c8a6d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 |
11 Calculus Kenneth E. Iverson Copyright Β© 2002 Jsoftware Inc. All rights reserved. 2 Calculus Preface Calculus is at once the most important and most difficult subject encountered early by students of mathematics; introductory courses often succeed only in turning students away from mathematics, and from the many subjects in which the calculus plays a major role. The present text introduces calculus in the informal manner adopted in my Arithmetic [1], a manner endorsed by Lakatos [2], and by the following words of Lanczos from his preface to [3]: Furthermore, the author has the notion that mathematical formulas have their βsecret lifeβ behind their Golem-like appearance. To bring out the βsecret lifeβ of mathematical relations by an occasional narrative digression does not appear to him a profanation of the sacred rituals of formal analysis but merely an attempt to a more integrated way of understanding. The reader who has to struggle through a maze of βlemmasβ, βcorollariesβ, and βtheoremsβ, can easily get lost in formalistic details, to the detriment of the essential elements of the results obtained. By keeping his mind on the principal points he gains in depth, although he may lose in details. The loss is not serious, however, since any reader equipped with the elementary tools of algebra and calculus can easily interpolate the missing details. It is a well-known experience that the only truly enjoyable and profitable way of studying mathematics is the method of βfilling in the detailsβ by oneβs own efforts. The scope is broader than is usual in an introduction, embracing not only the differential and integral calculus, but also the difference calculus so useful in approximations, and the partial derivatives and the fractional calculus usually met only in advanced courses. Such breadth is achievable in small compass not only because of the adoption of informality, but also because of the executable notation employed. In particular, the array character of the notation makes possible an elementary treatment of partial derivatives in the manner used in tensor analysis. The text is paced for a reader familiar with polynomials, matrix products, linear functions, and other notions of elementary algebra; nevertheless, full definitions of such matters are also provided. Chapter 1 Introduction 3 Table Of Contents Introduction ..............................................................................6 A. Calculus .......................................................................................... 6 B. Notation and Terminology.............................................................. 10 C. Role of the Computer and of Notation............................................ 14 D. Derivative, Integral, and Secant Slope ........................................... 14 E. Sums and Multiples......................................................................... 15 F. Derivatives of Powers ..................................................................... 16 G. Derivatives of Polynomials............................................................. 17 H. Power Series ................................................................................... 18 I. Conclusion ....................................................................................... 20 Differential Calculus.................................................................23 A. Introduction .................................................................................... 23 B. The derivative operator ................................................................... 24 C. Functions Defined by Equations (Relations) .................................. 24 D. Differential Equations..................................................................... 26 E. Growth F d.1 = F...................................................................... 26 F. Decay F d.1 = -@F ................................................................... 27 G. Hyperbolic Functions F d.2 = F ............................................... 28 H. Circular Functions F d.2 = -@F ............................................... 29 I. Scaling.............................................................................................. 30 J. Argument Transformations .............................................................. 31 K. Table of Derivatives ...................................................................... 31 L. Use of Theorems ............................................................................. 33 M. Anti-Derivative .............................................................................. 34 N. Integral............................................................................................ 35 Vector Calculus ........................................................................37 A. Introduction .................................................................................... 37 B. Gradient .......................................................................................... 38 C. Jacobian ......................................................................................... 40 D. Divergence And Laplacian ............................................................. 42 E. Symmetry, Skew-Symmetry, and Orthogonality ............................ 42 F. Curl.................................................................................................. 45 Difference Calculus ..................................................................47 A. Introduction .................................................................................... 47 B. Secant Slope Conjunctions ............................................................. 47 C. Polynomials and Powers ................................................................. 48 D. Stope Functions .............................................................................. 50 4 Calculus E. Slope of the Stope ........................................................................... 51 F. Stope Polynomials........................................................................... 52 G. Coefficient Transformations........................................................... 53 H. Slopes as Linear Functions ............................................................. 54 Fractional Calculus ..................................................................59 A. Introduction .................................................................................... 59 B. Table of Semi-Differintegrals ......................................................... 61 Properties of Functions ...........................................................65 A. Introduction .................................................................................... 65 B. Experimentation.............................................................................. 67 C. Proofs.............................................................................................. 70 D. The Exponential Family ................................................................. 70 E. Logarithm and Power...................................................................... 71 F. Trigonometric Functions ................................................................. 73 G. Dot and Cross Products .................................................................. 77 H. Normals .......................................................................................... 79 Interpretations and Applications ............................................83 A. Introduction .................................................................................... 83 B. Applications and Word Problems ................................................... 84 C. Extrema and Inflection Points......................................................... 85 D. Newton's Method............................................................................ 87 E. Kerner's Method.............................................................................. 89 F. Determinant and Permanent ............................................................ 90 G. Matrix Inverse................................................................................. 92 H. Linear Functions and Operators ..................................................... 92 I. Linear Differential Equations........................................................... 94 J. Differential Geometry ...................................................................... 95 K. Approximate Integrals .................................................................... 97 L. Areas and Volumes ......................................................................... 101 M. Physical Experiments..................................................................... 103 Analysis.....................................................................................107 A. Introduction .................................................................................... 107 B. Limits .............................................................................................. 108 C. Continuity ....................................................................................... 111 D. Convergence of Series .................................................................... 111 Appendix ...................................................................................117 A. Polynomials .................................................................................... 117 B. Binomial Coefficients ..................................................................... 119 C. Complex Numbers .......................................................................... 119 D. Circular and Hyperbolic Functions................................................. 120 Chapter 1 Introduction 5 E. Matrix Product and Linear Functions ............................................. 120 F. Inverse, Reciprocal, And Parity ...................................................... 121 Index ..........................................................................................126 6 Calculus Chapter 1 Introduction A. Calculus Calculus is based on the notion of studying any phenomenon (such as the position of a falling body) together with its rate of change, or velocity. This simple notion provides insight into a host of familiar things: the growth of trees or financial investments (whose rates of change are proportional to themselves); the vibration of a pendulum or piano string; the shape of the cables in a powerline or suspension bridge; and the logarithmic scale used in music. In spite of the simplicity and ubiquity of its underlying notion, the calculus has long proven difficult to teach, largely because of the difficult notion of limits. We will defer this difficulty by first confining attention to the polynomials familiar from high-school algebra. We begin with a concrete experiment of dropping a stone from a height of twenty feet, and noting that both the position and the velocity (rate of change of position) appear to depend upon (are functions of) the elapsed time. However, because of the rapidity of the process, we are unable to observe either with any precision. More precise observation can be provided by recording the fall with a video camera, playing it back one frame at a time, and recording the successive positions in a vertical line on paper. A clearer picture of the motion can be obtained by moving the successive points to a succession of equally spaced vertical lines to obtain a graph or plot of the position against elapsed time. The position of the falling stone can be described approximately by an algebraic expression as follows: p(t) = 20 - 16 * t * t We will use this definition in a computer system (discussed in Section B) to compute a table of times and corresponding heights, and then to plot the points detailed in the table. The computer expressions may be followed by comments (in Roman font) that are not executed: i.11 First eleven integers, beginning at zero 0 1 2 3 4 5 6 7 8 9 10 t=:0.1*i.11 Times from 0 to 1 at intervals of one-tenth h=:20-16*t*t Corresponding heights Chapter 1 Introduction 7 t,.h 0 20 0.1 19.84 0.2 19.36 0.3 18.56 0.4 17.44 0.5 16 0.6 14.24 0.7 12.16 0.8 9.76 0.9 7.04 1 4 load βplotβ PLOT=:βstick,lineβ&plot PLOT t;h The plot gives a graphic view of the velocity (rate of change of position) as the slopes of the lines between successive points, and emphasizes the fact that it is rapidly increasing in magnitude. Moreover, the table provides the information necessary to compute the average velocity between any pair of points. For example, the last two rows appear as: 0.9 7.04 1 4 and subtraction of the first of them from the last gives both the change in time (the elapsed time) and the corresponding change in position: 1 4 - 0.9 7.04 8 Calculus 0.1 _3.04 Finally, the change in position divided by the change in time gives the average velocity: _3.04 % 0.1 Division is denoted by % _30.4 The _ denotes a negative number The negative value of this velocity indicates that the velocity is in a downward direction. Both the table and the plot suggest abrupt changes in velocity, but smaller intervals between points will give a truer picture of the actual continuous motion: t=:0.01*i.101 Intervals of one-hundredth over the same range h=:20-16*t*t PLOT t;h This plot suggests that the actual (rather than the average) rate of change at any point is given by the slope of the tangent (touching line) to the curve of the graph. In terms of the table, it suggests the use of an interval of zero. But this would lead to the meaningless division of a zero change in position by a zero change in time, and we are led to the idea of the "limit" of the ratio as the interval "approaches" zero. For many functions this limit is difficult to determine, but we will avoid the problem by confining attention to polynomial functions, where it can be determined by simple algebra. The velocity (rate of change of position) is also a function of t and, because it is derived from the function p, it is called the derivative of p . It also can be expressed algebraically as follows: v(t) = -32*t. Moreover, since the velocity is also a function of t, it has a derivative (the acceleration) which is also called the second derivative of the original function p . Various notations (with various advantages) have been used for the derivative: Chapter 1 Introduction 9 . .. newton leibniz p d2y/d2t dy/dt p dny/dnt (y = p (t)) modern p' p'' pn heaviside (J) p D.1 p D.2 p D.n Heaviside also introduced the notion of D as a derivative operator, an entity that applies to a function to produce another function. This is a new notion not known in elementary algebra. In the foregoing we have seen that calculus requires three notions that will not have been met by most students of high school algebra: 1. The notion of the rate of change of a function. 2. The notion of an operator that applies to a function to produce a function. 3. The notion of a limit of an expression that depends upon a parameter whose limiting value leads to an indeterminate expression such as 0%0. Although the notion of an operator that produces a function is not difficult in itself, its first introduction as the derivative operator (that is, jointly with another new notion of rate of change) makes it more difficult to embrace. We will therefore begin with the use of simpler (and eminently useful) operators before even broaching the notion of rate of change. A further obstacle to the teaching of calculus (common to other branches of mathematics as well) is the absence of working models of mathematical ideas, models that allow a student to gain familiarity through concrete and accurate experimentation. Such working models are provided automatically by the adoption of mathematical notation that is also executable on a computer. In teaching mathematics, the necessary notation is normally introduced in context and in passing, with little or no discussion of notation as such. Notation learned in a simple context is often expanded without explicit comment. For example, although the significance of a fractional power may require discussion, the notations x1/2 and xm/n and xpi used for it may be silently adapted from the more restricted integer cases x2 and xn. Although an executable notation must differ somewhat from conventional notation (if only to resolve conflicts and ambiguities), it is important that it be introducible in a similarly casual manner, so as not to distract from the mathematical ideas it is being used to convey. The subsequent section illustrates such use of the executable notation J (available free from webside jsoftware.com) in introducing and using vectors and operators. 10 Calculus B. Notation and Terminology The terminology used in J is drawn more from English than from mathematics: a) Functions such as + and * and ^ are also referred to as verbs (because they act upon nouns such as 3 and 4), and operators such as / and & are accordingly called adverbs and conjunctions, respectively. b) The symbol =: used in assigning a name to a referent is called a copula, and the names credits and sum used in the sentences credits=: 24.5 17 38 and sum=:+/ are referred to as pronouns and proverbs (pronounced with a long o), respectively. c) Vectors and matrices are also referred to by the more suggestive terms lists and tables. Because the notation is executable, the computer can be used to explore and elucidate topics with a clarity that can only be appreciated from direct experience of its use. The reader is therefore urged to use the computer to do the exercises provided for each section, as well as other experiments that may suggest themselves. To avoid distractions from the central topic of the calculus, we will assume a knowledge of some topics from elementary math (discussed in an appendix), and will introduce the necessary notation with a minimum of comment, assuming that the reader can grasp the meaning of new notation from context, from simple experiments on the computer, from the on-line Dictionary, or from the study of more elementary texts such as Arithmetic [1]. The remainder of this section is a computer dialog (annotated by comments in a different font) that introduces the main characteristics of the notation. The reader is urged to try the following sentences (and variants of them) on the computer: 3.45+6.78+0.01 10.24 2*3 6 2^3 8 1 2 3 * 4 5 6 4 10 18 2 < 3 2 1 false) 1 0 0 2 <. 3 2 1 2 2 1 (+: , -: , *: , %:) 16 32 8 256 4 +/4 5 6 15 Plus Times Power (product of three twos) Lists or vectors Less than (1 denotes true, and 0 denotes Lesser of (Minimum) Related spellings denote related verbs Double, halve, square, square root The symbol / denotes the adverb insert 4+5+6 15 */4 5 6 120 3-5 _2 -5 _5 Chapter 1 Introduction 11 Verbs are ambivalent, with a meaning that depends on context; the symbol - denotes subtraction or negation according to context 2^1 2 3 2 4 8 ^1 2 3 2.71828 7.38906 20.0855 The power function The exponential function */4 5 6 120 A derived verb produced by an adverb is also ambivalent; the 1 2 3 */ 4 5 6 4 5 6 8 10 12 12 15 18 a=: 1 2 3 b=: 4 5 6 7 powertable=: ^/ c=: a powertable b c 1 1 1 1 16 32 64 128 81 243 729 2187 +/ c 98 276 794 2316 +/"1 c 4 240 3240 dyadic case of */ produces a multiplication table The copula (=:) can be used to assign names to nouns, verbs, adverbs, and conjunctions Adds together items (rows) of the table c The rank conjunction " applies its argument (here the function +/) to each rank-1 cell (list) 3"1 c The constant function 3 applied to each list of c 3 3 3 3"1 b The constant function 3 applied to the list b 3 3"0 b The constant function 3 applied to each atom of b 3 3 3 x=: 4 1+x*(3+x*(3+x*(1))) Parentheses provide punctuation 125 1+x*3+x*3+x*1 125 (3*4)+5 17 3*4+5 27 as in high-school algebra. However, there is no precedence or hierarchy among verbs; each applies to the result of the entire phrase to its right 12 Calculus tithe=: %&10 tithe 35 3.5 log=: 10&^. log 10 20 100 1 1.30103 2 sin=: 1&o. sin 0 1 1r2p1 0 0.841471 1 x=:1 2 3 4 ^&3 x 1 8 27 64 The conjunction & bonds a dyad to a noun; result is a corresponding function of one argument (a monad) Sine (of radian arguments) Sine of 0, 1, and one-half pi Cube of x We will write informal proofs by writing a sequence of sentences to imply that each is equivalent to its predecessor, and that the last is therefore equivalent to the first. For example, to show that the sum of the first n odd numbers is the square of n, we begin with: The identity function ]causes display of result ] odds=: 1+2*i.n=: 8 1 3 5 7 9 11 13 15 |.odds 15 13 11 9 7 5 3 1 odds + |.odds 16 16 16 16 16 16 16 16 n#n 8 8 8 8 8 8 8 8 and then write the following sequence of equivalent sentences: +/odds +/|.odds -:(+/odds) + (+/|.odds) -:+/ (odds+|.odds) +/ -:(odds+|.odds) +/n#n n*n *:n Solutions or hints appear in bold brackets. Make serious attempts before consulting them. Exercises B1 To gain familiarity with the keyboard and the use of the computer, enter some of the sentences of this section and verify that they produce the results shown in the text. Do not enter any of the comments that appear to the right of the sentences. B2 To test your understanding of the notions illustrated by the sentences of this section, enter variants of them, but try to predict the results before pressing the Enter key. B3 Enter p=: 2 3 5 7 11 and predict the results of +/p and */p; then review the discussion of parentheses and predict the results of -/p and %/p . Chapter 1 Introduction 13 B4 Enter i. 5 and #p and i.#p and i.-#p . Then state the meanings of the primitives # and i. . B5 Enter asp=: p * _1 ^ i. # p to get a list of primes that alternate in sign (enter asp alone to display them). Compare the results of -/p and +/asp and state in English the significance of the phrase -/ . [ -/ yields the alternating sum of a list argument] B6 Explore the assertion that %/a is the alternating product of the list a. [ Use arp=: p^_1^i.#p ] B7 Execute (by entering on the computer) each of the sentences of the informal proof preceding these exercises to test the equivalences. Then annotate the sentences to state why each is equivalent to its predecessor (and thus provide a formal proof). B8 Experiment with, and comment upon, the following and similar sentences: s=: '4%5' |.s do=: ". do s do |.s |.i.5 |. 'I saw' [ Enclosing quotes produce a list of characters that may be manipulated like other lists and may, if they represent proper sentences, be executed by applying the verb ". .] B9 Experiment with and comment upon: ]a=: <1 2 3 >a 2*a 2*>a ]b=: (<1 2 3),(<'pqrs') |.b #b 1 2 3;'pqrs' [ < boxes its argument to produce a scalar encoding; > opens it.] B10 Experiment with and comment upon: power=:^ with=:& cube=:^ with 3 cube 1 2 3 4 1 8 27 64 cube ^&3 [ Entering the name of a function alone shows its definition in linear form; 14 Calculus the foreign conjunction !: provides other forms] B11 Press the key F1 (in the top row) to display the J vocabulary, and click the mouse on any item (such as -) to display its definition. C. Role of the Computer and of Notation Seeing the computer determine the derivatives of functions such as the square might well cause a student to forget the mathematics and concentrate instead on the wonder of how the computer does it. A student of astronomy might likewise be diverted by the wonders of optics and telescopes; they are respectable, but they are not astronomy. In the case of the derivative operator, the computer simply consults a given table of derivatives and an associated table of rules (such as the chain rule). The details of the computer calculation of the square root of 3.14159 are much more challenging. The important point for a student of mathematics is to treat the computer as a tool, being clear about what it does, not necessarily how it does it. In particular, the tool should be used for convenient and accurate experimentation with mathematical ideas. The study of notation itself can be fascinating, but the student of calculus should concentrate on the mathematical ideas it is being used to convey, and not spend too much time on byways suggested by the notation. For example, a chance application of the simple factorial function to a fraction (! 0.5) or the square root to a negative number (%:-4) might lead one away into the marvels of the gamma function and imaginary numbers. A student must, of course, learn some notation, such as the use of ^ for power (first used by de Morgan) and of + and * for plus and times. However, it is best not to spend too much conscious effort on memorizing vocabulary, but rather to rely on the fact that most words will be used frequently enough in context to fix them in mind. Moreover, the definition of a function may be displayed by simply entering its name without the usual accompanying argument, as illustrated in Exercise B10. D. Derivative, Integral, and Secant Slope The central notions of the calculus are the derivative and the integral or anti-derivative. Each is an adverb in the sense that it applies to a function (or verb) to produce a derived function. Both are illustrated (for the square function x2) by the following graph, in which the slope of the tangent at the point x,x2 as a function of x is the derivative of the square function, that is 2x. The area under the graph is the integral of the square, that is, the function x3 /3, a function whose derivative is the square function. Certain important properties of a function are easily seen in its graph. For example, the square has a minimum at the point 0 0; increases to the right of zero at an accelerating rate; and the area under it can be estimated by summing the areas of the trapezoids: PLOT x;*: x=:i:4 Chapter 1 Introduction 15 These properties concern the local behavior of a function in the sense that they concern how rapidly the function value is changing at any point. They are not easily discerned from the expression for the function itself, but are expressed directly by its derivative. More surprisingly, a host of important functions can be defined simply in terms of their derivatives. For example, the important exponential (or growth) function is completely defined by the fact that it is equal to its derivative (therefore growing at a rate equal to itself), and has the value 1 for the argument 0. The difference calculus (Chapter 4) is based upon secant slopes, such as illustrated by the lines in the foregoing plot of the square function. The slope of the secant (from ligne secante, or cutting line) through the points x,f x and (x+r),(f x+r) is obtained by dividing the rise(f x+r)-(f x) by the run r; the result of ((f x+r)-f x)%r is called the r-slope of f at the point x. The difference calculus proves useful in a wide variety of applications, including approximations to arbitrary functions, and financial calculations in which events (such as payments) occur at fixed intervals. The function used to plot the square must be prepared as follows: load 'graph plot' PLOT=:'stick,line'&plot E. Sums and Multiples The derivative of the function p+q (the sum of the functions p and q) is the sum of their derivatives. This may be seen by plotting the functions together with their sum. We will illustrate this by the sine and cosine functions: p=:1&o. The sine function q=:2&o. The cosine function x=:(i.11)%5 PLOT x;>(p x);(q x);((p x)+(q x)) 16 Calculus Since each value of the sum function is the sum of the component functions, the slopes of its secants are also the sum of the corresponding slopes. Since this is true for every secant, it is true for the derivative. Similarly, the slopes of a multiple of a function p are all the same multiple of the slopes of p, and its derivative is therefore the same multiple of the derivative of p. For example: PLOT x;>(p x);(2 * p x) F. Derivatives of Powers The derivative of the square function f=: ^&2 can be obtained by algebraically expanding the expression f(x+r) to the equivalent form (x^2)+(2*x*r)+(r^2), as shown in the following proof, or list of identical expressions: ((f x+r)-(f x)) % r (((x+r)^2)-(x^2))%r (((x^2)+(2*x*r)+(r^2)) - (x^2)) % r ((2*x*r)+(r^2)) % r (2*x)+r Moreover, if r is set to zero in the final expression (2*x)+r, the result is 2*x, the value of the derivative of ^&2. Similar analysis can be performed on other power functions. Thus if g=: ^&3 : ((g x+r)-(g x)) % r ((3*(x^2)*r)+(3*x*r^2)+(r^3)) % r (3*x^2)+(3*x*r)+(r^2) Again the derivative is obtained by setting r to zero, leaving 3*x^2. Chapter 1 Introduction 17 Similar analysis shows that the derivative of ^&4 is 4*^&3 and, in general, the derivative of ^&n is n*^&n. Since the first term of the expansion of (x+r)^n is cancelled by the subtraction of x^n, and since all terms after the second include powers of r greater than 1, the only term relevant to the derivative is the second, that is, n*x^n-1. G. Derivatives of Polynomials The expression (8*x^0)+(_20*x^1)+(_3*x^2)+(2*x^3) is an example of a polynomial. We may also express it as 8 _20 _3 2 p. x, using the polynomial function denoted by p. . The elements of the list 8 _20 _3 2 are called the coefficients of the polynomial. For example: x=:2 (8*x^0)+(_20*x^1)+(_3*x^2)+(2*x^3) _28 8 _20 _3 2 p. x _28 c=:8 _20 _3 2 x=:0 1 2 3 4 5 (8*x^0) + (_20*x^1) + (_3*x^2) + (2*x^3) 8 _13 _28 _25 8 83 c p. x 8 _13 _28 _25 8 83 The expression (8*x^0)+(_20*x^1)+(_3*x^2)+(2*x^3) is a sum whose derivative is therefore a sum of the derivatives of the individual terms. Each term is a multiple of a power, so each of these derivatives is a multiple of the derivative of the corresponding power. The derivative is therefore the sum: (0*8)+(_20*1*x^0)+(_3*2*x^1)+(2*3*x^2) This is a polynomial with coefficients given by c*i.#c, with the leading element removed to reduce each of the powers by 1 : c 8 _20 _3 2 i.#c 0 1 2 3 c*i.#c 0 _20 _6 6 dc=:}.c*i.#c dc _20 _6 6 dc p. x _20 _20 _8 16 52 100 x,.(c p. x),.(dc p. x) 0 8 _20 1 _13 _20 18 Calculus 2 _28 _8 3 _25 16 4 8 52 5 83 100 PLOT x;>(c p. x);(dc p. x) As remarked in Section A, " β¦ the functions of interest in elementary calculus are easily approximated by polynomials β¦ ". The following illustrates this for the sine function and its derivative (the cosine), using _1r6 for the rational fraction negative one-sixths: csin=:0 1 0 _1r6 0 1r120 0 _1r5040 ccos=:}.csin*i.#csin x=:(i:6)%2 PLOT x;>(csin p. x);(ccos p. x) H. Power Series We will call s a series function if s n produces a list of n elements. For example: s1=:$&0 1 Press F1 for the vocabulary, and see the definition of $ s2=:_1&^@s1 s1 5 0 1 0 1 0 s2 8 1 _1 1 _1 1 _1 1 _1 A polynomial with coefficients produced by a series function is a sum of powers weighted by the series, and is called a power series. For example: x=:0.5*i.6 (s1 5) p. x Sum of odd powers 0 0.625 2 4.875 10 18.125 Chapter 1 Introduction 19 (s2 8) p. x Alternating sum of powers 1 0.664063 0 _9.85156 _85 _435.68 We will define an adverb PS such that n (s PS) x gives the n-term power series determined by the series function s: PS=:1 : (':'; '(u. x.) p. y.') See definition of : (Explicit definition) 5 s1 PS x 0 0.625 2 4.875 10 18.125 8 s2 PS x 1 0.664063 0 _9.85156 _85 _435.68 S1=:s1 PS 5 S1 x 0 0.625 2 4.875 10 18.125 Power series can be used to approximate the functions needed in elementary calculus. For example: s3=:%@!@i. Reciprocal of factorial of integers s4=:$&0 1 0 _1 s5=:s3*s4 s3 7 1 1 0.5 0.166667 0.0416667 0.00833333 0.00138889 s4 7 0 1 0 _1 0 1 0 s5 7 0 1 0 _0.166667 0 0.00833333 0 S3=:s3 PS S4=:s4 PS S5=:s5 PS 7 S3 x Seven-term power series approximation to 1 1.64872 2.71806 4.47754 7.35556 12.0097 ^x the exponential function 1 1.64872 2.71828 4.48169 7.38906 12.1825 10 S5 x Ten-term power series approximation to 0 0.479426 0.841471 0.997497 0.909347 0.599046 1&o. x the sine function 0 0.479426 0.841471 0.997495 0.909297 0.598472 Since c=:s5 10 provides the coefficients of an approximation to the sine function, the expression }. c * i.10 provides (according to the preceding section) the coefficients of an approximation to its derivative (the cosine). Thus: c=:s5 10 20 Calculus y1=:c p. y=:0.5*i:6 y2=:(}.c*i.10) p. y PLOT y;>y1;y2 I. Conclusion We conclude with a brief statement of the ways in which the present treatment of the calculus differs from most introductory treatments. For the differential calculus of Chapter 2, the important difference is the avoidance of problems of limits by restricting attention to polynomials, and the use of power series to extend results to other functions. Moreover: 1. In Vector Calculus (Chapter 3), Partial derivatives are treated in a simpler and more general way made possible by the use of functions that deal with arguments and results of arbitrary rank; this in contrast to the restriction to scalars (single elements) common in elementary treatments of the calculus. 2. The Calculus of Differences (Chapter 4) is developed as a topic of interest in its own right rather than as a brief way-station to integrals and derivatives. 3. Fractional derivatives (Chapter 5) constitute a powerful tool that is seldom treated in calculus courses. They are an extension of derivatives of integral order, introduced here in a manner analogous to the extension of the power function to fractional exponents, and the extension of the factorial and binomial coefficient functions to fractional arguments. 4. Few formal proofs are presented, and proofs are instead treated (as they are in Arithmetic [1]) in the spirit of Lakatos in his Proofs and Refutations [2], of which the author says: "Its modest aim is to elaborate the point that informal, quasi-empirical, mathematics does not grow through the monotonous increase of the number of indubitably established theorems but through the incessant improvement of guesses by speculation and criticism, by the logic of proofs and refutations." 5. The notation used is unambiguous and executable. Because it is executable, it is used for experimentation; new notions are first introduced by leading the student to see them in action, and to gain familiarity with their use before analysis is attempted. 6. As illustrated at the end of Section B, informal proofs will be presented by writing a sequence of expressions to imply that each is equivalent to its predecessor, and that the last is therefore equivalent to the first. Chapter 1 Introduction 21 7. The exercises are an integral part of the development, and should be attempted as early as possible, perhaps even before reading the relevant sections. Try to provide (or at least sketch out) answers without using the computer, and then use it to confirm your results. 8. Two significant parts may be distinguished in treatments of the calculus: a) A body comprising the central notions of derivative and anti-derivative (integral), together with their important consequences. b) A basis comprising the analysis of the notion of limit (that arises in the transition from the secant slope to the tangent slope) needed as a foundation for an axiomatic deductive treatment. The common approach is to treat the basis first, and the body second. For example, in Johnson and Kiokemeister Calculus with analytic geometry [6], the section on The derivative of a function occurs after eighty pages of preliminaries. The present text defers discussion of the analytical basis to Chapter 8, first providing the reader with experience with the derivative and the importance of its fruits, so that she may better appreciate the point of the analysis. 23 Chapter 2 Differential Calculus A. Introduction In Chapter 1 it was remarked that: β’ The power of the calculus rests upon the study of functions together with their derivatives, or rates-of-change. β’ The difficult notion of limits encountered in determining derivatives can be deferred by restricting attention to functions expressible as polynomials. β’ The results for polynomials can be extended to other functions by the use of power series. β’ The derivative of d=:}.c*i.#c. the polynomial c&p. is the polynomial d&p., where We begin by defining a function deco for the derivative coefficients, and applying it repeatedly to a list of coefficients that represent the cube (third power): deco=:}.@(] * i.@#) c=:0 0 0 1 x=:0 1 2 3 4 5 6 c p. x 0 1 8 27 64 125 216 x^3 0 1 8 27 64 125 216 ]cd=:deco c Coefficients of first derivative of cube 0 0 3 cd p. x 0 3 12 27 48 75 108 3*x^2 0 3 12 27 48 75 108 #cd Number of elements 3 ]cdd=:deco cd Coefficients of second derivative of cube 0 6 cdd p. x 0 6 12 18 24 30 36 2*3*x^1 0 6 12 18 24 30 36 24 Calculus #cdd Number of elements 2 ]cddd=:deco cdd Coefficients of third derivative of cube 6 cddd p. x A constant function 6 6 6 6 6 6 6 1*2*3*x^0 6 6 6 6 6 6 6 #cddd Number of elements 1 ]cdddd=:deco cddd Coefficients of fourth derivative of cube (empty list) cdddd p. x Sum of an empty list (a zero constant function) 0 0 0 0 0 0 0 #cdddd Number of elements 0 B. The derivative operator If f=:c&p. is a polynomial function, then g=:(deco c)&p. is its derivative. For example: c=:3 1 _4 _2 f=:c&p. g=:(deco c)&p. ]x=:i:3 _3 _2 _1 0 1 2 3 f x 18 1 0 3 _2 _27 _84 g x _29 _7 3 1 _13 _39 _77 PLOT x;>(f x);(g x) Since deco provides the computations for obtaining the derivative of f in terms of its defining coefficients, it can also provide the basis for a derivative operator that applies directly to the function f. For example: f d. 1 x _29 _7 3 1 _13 _39 _77 In the expression f d. 1, the right argument determines the order of the derivative, in this case giving the first derivative. Successive derivatives can be obtained as follows: Chapter 2 Differential Calculus 25 f d. 2 x 28 16 4 _8 _20 _32 _44 (deco deco c) p. x 28 16 4 _8 _20 _32 _44 f d. 3 x _12 _12 _12 _12 _12 _12 _12 (deco deco deco c) p. x _12 _12 _12 _12 _12 _12 _12 C. Functions Defined by Equations (Relations) A function may be defined directly, as in f=:^&3 or g=:0 0 0 1&p. It may also be defined indirectly by an equation that specifies some relation that it must satisfy. For example: 1. invcube is the inverse of the cube. A function that satisfies this equation may be expressed directly in various ways. For example: cube=:^&3 cube x=: 1 2 3 4 5 1 8 27 64 125 invcube=: ^&(%3) invcube cube x 1 2 3 4 5 cube invcube x 1 2 3 4 5 altinvcube=: cube ^:_1 Inverse operator altinvcube cube x 1 2 3 4 5 2. reccube is the reciprocal of the cube. reccube=: %@cube reccube x 1 0.125 0.037037 0.015625 0.008 (reccube * cube) x 1 1 1 1 1 3. The derivative of s is the cube. s=:0 0 0 0 0.25&p. s x 0.25 4 20.25 64 156.25 s d.1 x 1 8 27 64 125 26 Calculus A stated relation may not specify a function completely. For example, the equation for Example 3 is also satisfied by the alternative function as=: 8"0+s. Thus: as=:8"0 + s as x 8.25 12 28.25 72 164.25 as d.1 x 1 8 27 64 125 Further conditions may therefore be stipulated to define the function completely. For example, if it is further required that s 2 must be 7, then s is completely defined. Thus: as=:3"0 + s as 2 7 as d.1 x 1 8 27 64 125 C1 Experiment with the expressions of this section. D. Differential Equations An equation that involves derivatives of the function being defined is called a differential equation. The remainder of this chapter will use simple differential equations to define an important collection of functions, including the exponential, hyperbolic, and circular (or trigonometric). We will approach the solution of differential equations through the use of polynomials. Because a polynomial includes one more term than its derivative, it can never exactly equal the derivative, and we consider functions that approximate the desired solution. However, for the cases considered, successive coefficients decrease rapidly in magnitude, and approximation can be made as close as desired. Consideration of the convergence of such approximations is deferred to Chapter 8. E. Growth F d.1 = F If the derivative of a function is equal to (or proportional to) the function itself, it is said to grow exponentially. Examples of exponential growth include continuous compound interest, and the growth of a well-fed colony of bacteria. If f is the polynomial c&p., then the derivative of f is the polynomial with coefficients deco c. Thus: ]c=:1,(%1),(%1*2),(%1*2*3),(%!4),(%!5),(%!6) 1 1 0.5 0.166667 0.0416667 0.00833333 0.00138889 c*i.#c 0 1 1 0.5 0.166667 0.0416667 0.00833333 }. c*i.#c 1 1 0.5 0.166667 0.0416667 0.00833333 deco c 1 1 0.5 0.166667 0.0416667 0.00833333 In this case the coefficients of the derivative polynomial agree with the original coefficients except for the missing final element. The same is true for any coefficients produced by the following exponential coefficients function: Chapter 2 Differential Calculus 27 ec=: %@! ]c=: ec i. n=: 7 1 1 0.5 0.166667 0.0416667 0.00833333 0.00138889 deco c 1 1 0.5 0.166667 0.0416667 0.00833333 Consequently, the function c&p. is approximately equal to its derivative. For example: c&p. x=: 0 1 2 3 1 2.71806 7.35556 19.4125 (deco c)&p. x 1 2.71667 7.26667 18.4 The primitive exponential function, denoted by ^, is defined as the limiting case for large n. For example: c=: ec i. n=: 12 c&p. x 1 2.71828 7.38905 20.0841 ^x 1 2.71828 7.38906 20.0855 The related function ^@(r&*) grows at a rate proportional to the function, the ratio being r. For example: r=:0.1 q=: ^@(r&*) q d.1 x 0.1 0.110517 0.12214 0.134986 r * q x 0.1 0.110517 0.12214 0.134986 F. Decay F d.1 = -@F A function whose derivative is equal to or proportional to its negation is decaying at a rate proportional to itself. Interpretations include the charge of water remaining in a can punctured at the bottom, and the electrical charge remaining in a capacitor draining through a resistor; the rate of flow (and therefore of loss) is proportional to the pressure provided by the remaining charge at any time. The coefficients of a polynomial defining such a function must be similar to that for growth, except that the elements must alternate in sign. Thus: eca=: _1&^ * ec eca i.7 1 _1 0.5 _0.166667 0.0416667 _0.00833333 0.00138889 deco eca 7 _1 1 _0.5 0.166667 _0.0416667 0.00833333 28 Calculus (eca 20)&p. x 1 0.367879 0.135335 0.0497871 0.0183153 (deco eca 20)&p x _1 _0.367879 _0.135335 _0.0497871 _0.0183175 The relation between the growth and decay functions will be explored in exercises and in Chapter 6. F1 Define a function pp such that (a pp b)&p. is equivalent to the product (a&p.*b&p.) ; test it for a=:1 2 1 [ b=:1 3 3 1. [ pp=: +//.@(*/) ] F2 Predict the value of a few elements of (ec pp eca) i.7 and enter the expression to validate your prediction. F3 Enter x=:0.1*i:30 and y1=:^ x and y2=:^@-x. Then enter PLOT x;>y1;y2. F4 Predict and confirm the result of the product y1*y2. G. Hyperbolic Functions F d.2 = F The second derivative of a function may be construed as its acceleration, and many phenomena are described by functions defined in terms of their acceleration. We will again use polynomials to approximate functions, first a function that is equal to its second derivative. Since the second derivative of the exponential ^ is also equal to itself, the coefficients ec i.n would suffice. However, we seek new functions and therefore add the restriction that f d.1 must not equal f. Coefficients satisfying these requirements can be obtained by suppressing (that is, replacing by zeros) alternate elements of ec i.n. Thus: 2|i.n=: 9 0 1 0 1 0 1 0 1 0 hsc=: 2&| * ec ]c=: hsc i.n 0 1 0 0.166667 0 0.00833333 0 0.000198413 0 deco c 1 0 0.5 0 0.0416667 0 0.00138889 0 deco deco c 0 1 0 0.166667 0 0.00833333 0 The result of deco c was shown above to make clear that the first derivative differs from the function. However, it should also be apparent that it qualifies as a second function that equals its second derivative. We therefore define a corresponding function hcc : hcc=: 0&=@(2&|) * ec hcc i.n 1 0 0.5 0 0.0416667 0 0.00138889 0 2.48016e_5 Chapter 2 Differential Calculus 29 deco deco hcc i.n 1 0 0.5 0 0.0416667 0 0.00138889 The limiting values of the corresponding polynomials are called the hyperbolic sine and hyperbolic cosine, respectively. They are the functions defined by hsin=: 5&o. and hcos=: 6&o.. Thus: hsin=:5&o. hcos=:6&o. (hsc i.20)&p. x=: 0 1 2 3 4 0 1.1752 3.62686 10.0179 27.2899 hsin x 0 1.1752 3.62686 10.0179 27.2899 (hcc i.20)&p. x 1 1.54308 3.7622 10.0677 27.3082 hcos x 1 1.54308 3.7622 10.0677 27.3082 It should also be noted that each of the hyperbolic functions is the derivative of the other. Further properties of these functions will be explored in Chapter 6. In particular, it will be seen that a plot of one against the other yields a hyperbola. The more pronounceable abbreviations cosh and sinh (pronounced cinch) are also used for these functions. G1 Enter x=:0.1*i:30 and y1=:hsin x and y2=:hcos x. Then plot the two functions by entering PLOT x;>y1;y2. G2 Enter PLOT y1;y2 to plot cosh against sinh, and comment on the shape of the plot. G3 Predict the result of (y2*y2)-(y1*y1) and test it on the computer. H. Circular Functions F d.2 = -@F It may be noted that the hyperbolics, like the exponential, continue to grow with increasing arguments. This is not surprising, since their acceleration increases with the increase of the function. We now consider functions whose acceleration is opposite in sign to the functions themselves, a characteristic that leads to periodic functions, whose values repeat as arguments grow. These functions are useful in describing periodic phenomena such as the oscillations in a mechanical system (the motion of a weight suspended on a spring) or in an electrical system (a coil connected to a capacitor). Appropriate polynomial coefficients are easily obtained by alternating the signs of the non-zero elements resulting from hsc and hcc. Thus: sc=: _1&^@(3&=)@(4&|) * hsc cc=: _1&^@(2&=)@(4&|) * hcc sc i.n 0 1 0 _0.166667 0 0.00833333 0 _0.000198413 0 cc i.n 30 Calculus 1 0 _0.5 0 0.0416667 0 _0.00138889 0 2.48016e_5 (sc i.20)&p. x 0 0.841471 0.909297 0.14112 _0.756803 sin=:1&o. cos=:2&o. sin x 0 0.841471 0.909297 0.14112 _0.756802 (cc i.20)&p. x 1 0.540302 _0.416147 _0.989992 _0.653644 cos x 1 0.540302 _0.416147 _0.989992 _0.653644 It may be surprising that these functions defined only in terms of their derivatives are precisely the sine and cosine functions of trigonometry (expressed in terms of arguments in radians rather than degrees); these relations are examined in Section 6F. H1 Repeat Exercises G1-G3 with modifications appropriate to the circular functions. Use the "power seriesβ operator PS and other ideas from Section 1G in H2 experiments on the hyperbolic and circular functions. I. Scaling The function ^@(r&*) used in Section B is an example of scaling; its argument is first multiplied by the scale factor r before applying the main function ^. Such scaling is generally useful, and we define a more convenient conjunction for the purpose as follows: AM=: 2 : 'x. @ (y.&*)' Atop Multiplication For example: ^&(0.1&*) x=: 0 1 2 3 4 1 1.10517 1.2214 1.34986 1.49182 ^ AM 0.1 x 1 1.10517 1.2214 1.34986 1.49182 Thus, f AM r may be read as "f atop multiplication (by) r". Also: ^ AM 0.1 d.1 x 0.1 0.110517 0.12214 0.134986 0.149182 0.1 * ^ AM 0.1 x 0.1 0.110517 0.12214 0.134986 0.149182 Chapter 2 Differential Calculus 31 J. Argument Transformations Scaling is only one of many useful argument transformations; we define two further conjunctions, atop addition and atop polynomial: AA=: 2 : 'x. @ (y.&+)' AP=: 2 : 'x. @ (y.&p.)' In Section H it was remarked that the circular functions sin and cos "repeat" their values after a certain period. Thus: per=: 6.28 cos x 1 0.540302 _0.416147 _0.989992 _0.653644 cos AA per x 0.999995 0.54298 _0.413248 _0.989538 _0.656051 Experimentation with different values of per can be used to determine a better approximation to the true period of the cosine. The conjunction AP provides a more general transformation. Thus: f AA 3 AM 4 is f AP 3 4 f AM 3 AA 4 is f AP 12 3 A function FfC to yield Fahrenheit from Celsius can be used to further illustrate the use of argument transformation: FfC=: 32"0 + 1.8"0 * ] Uses Constant functions (See Section 1B) fahr=: _40 0 100 FfC fahr _40 32 212 ] AA 32 AM 1.8 fahr _40 32 212 ] AP 32 1.8 fahr _40 32 212 The following derivatives are easily obtained by substitution and the use of the table of Section K: Function f AA r f AM r f AP c Derivative f D AA r (f D AM r * r"0) (f D AP c * (d c)&p.) K. Table of Derivatives The following table lists a number of important functions, together with their derivatives. Each function is accompanied by a phrase (such as Identity) and an index that will be used to refer to it, as in Theorem 2 or ΞΈ2 (where ΞΈ is the Greek letter theta) . 32 Calculus ΞΈ NAME FUNCTION DERIVATIVE 1 Constant function 2 Identity a"0 ] 3 Constant Times a"0 * ] 0"0 1"0 a"0 4 Sum 5 Difference 6 Product 7 Quotient f+g f-g f*g (f d.1)+(g d.1) (f d.1)-(g d.1) (f*(g d.1))+((f d.1)*g) f%g (f%g)*((f d.1)%f)-((g d.1)%g) 8 Composition f@g (f d.1)@g * (g d.1) 9 Inverse 10 Reciprocal 11 Power 12 Polynomial Legend: f INV %@(f d.1 @(f INV)) %@f ^&n c&p. -@(f d.1 % (f*f)) n&p. * ^&(n-1) (deco c)&p. Functions f and g and constants a and n, and list constant c Polynomial derivative deco=:}.@(] * i.@#) Inverse adverb INV=:^:_1 Although more thorough analysis will be deferred to Chapter 8, we will here present arguments for the plausibility of the theorems: ΞΈ 1 ΞΈ 2 Since a"0 x is a for any x, the rise is the zero function 0"0. Since (]a+x)-(]x) is (a+x)-x, the rise is a, and the slope is a%a ΞΈ 3 Multiplying a function by a multiplies all of its rises, and hence its slopes, by a as well. ΞΈ 4,5 The rise of f+g (or f-g) is the sum (or difference) of the rises of f and g. Also see the discussion in Section 1D. ΞΈ 6 If the result of f is fixed while the result of g changes, the result of f*g changes by f times the change in g; conversely if f changes while g is fixed. The total change in f*g is the sum of these changes. ΞΈ 7 If h=: f%g, then g*h is f, and, using ΞΈ 6 : f d.1 (g*h) d.1 (g*(h d.1))+((g d.1)*h) The equation (f d.1)=(g*(h d.1))+((g d.1)*h) can be solved for h d.1, giving the result of ΞΈ 7. ΞΈ 8 The derivative of f@g is the derivative of f "applied at the point g" (that is, (f d.1)@g), multiplied by the rate of change of the function that is applied first (that is, g d.1) Chapter 2 Differential Calculus 33 ΞΈ 9 f@(f INV) d.1 is the product (f d.1)@(f INV) * ((f INV) d.1) (from ΞΈ 6). But since f@(f INV) is the identity function, its derivative is 1&p. and the second factor (f INV) d.1 is therefore the reciprocal of the first. ΞΈ 10 This can be obtained from ΞΈ 7 using the case f=: ] . ΞΈ 11 Since ^&5 is equivalent to the product function ] * ^&4, its derivative may be obtained from ΞΈ 6 and the result for the derivative of ^&4. Further cases may be obtained similarly; that is, by induction. ΞΈ 12 This follows from ΞΈ 3 and ΞΈ 11. K1 K2 Enter f=: ^&2 and f=: ^&3 and x=: 1 2 3 4 ; then test the equivalence of the functions in the discussion of Theorem 7 by entering each followed by x, being sure to parenthesize the entire sentence if need be. If a is a noun (such as 2.7), then a"0 is a constant function. Prove that ((a"0 + f) d.1 = f d.1) is a tautology, that is, gives 1 (true) for every argument. L. Use of Theorems The product of the identity function (]) with itself is the square (^&2 or *:), and the expression for the derivative of a product can therefore be used as an alternative determination of the derivative of the square and of higher powers: (] * ]) d.1 (] * (] d.1)) + ((] d.1) * ]) Theorem 6 (] * 1"0) + (1"0 * ]) Theorem 2 ] + ] 2"0 * ] Twice the argument Further powers may be expressed as products with the identity function. Thus: f4=:]*f3=:]*f2=:]*f1=:]*f0=:1"0 x=:0 1 2 3 4 >(f0;f1;f2;f3;f4) x 1 1 1 1 1 0 1 2 3 4 0 1 4 9 16 0 1 8 27 64 0 1 16 81 256 Their derivatives can be analyzed in the manner used for the square: f3 d.1 (]*f2) d.1 (((] d.1)*f2)+(]*(f2 d.1))) ((1"0 * f2)+(]*2"0 * ])) 34 Calculus (f2+2"0 * f2) (3"0 * f2) M. Anti-Derivative The anti-derivative is an operator defined by a relation: applied to a function f, it produces a function whose derivative is f. Simple algebra can be applied to produce a function adeco that is inverse to deco. Since deco multiplies by indices and then drops the leading element, the inverse must divide by one plus the indices, and then append an arbitrary leading element. We will try two different leading elements, and then define adeco as a dyadic function whose left argument specifies the arbitrary element (known as the constant of integration): f1=: 5"1 , ] % >:@i.@#@] Constant of integration is 5 c=:3 1 4 2 f1 c 5 3 0.5 1.33333 0.5 deco f1 c 3 1 4 2 f2=: 24"1 , ] % >:@i.@#@] Constant of integration is 24 f2 c 24 3 0.5 1.33333 0.5 deco f2 c 3 1 4 2 adeco=: [ , ] % >:@i.@#@] Constant specified by left argument 4 adeco c 4 3 0.5 1.33333 0.5 deco 4 adeco c 3 1 4 2 zadeco=:0&adeco Monadic for common case of zero zadeco c 0 3 0.5 1.33333 0.5 deco zadeco c 3 1 4 2 Just as deco provides a basis for the derivative operator d., so does adeco provide the basis for extending d. to the anti-derivative, using negative arguments. For example: x=:i.6 f=:c&p. f x 3 10 37 96 199 358 f d._1 x 0 5.33333 26.6667 90 233.333 506.667 (0 adeco c) p. x 0 5.33333 26.6667 90 233.333 506.667 Chapter 2 Differential Calculus 35 N. Integral The area under (bounded by) the graph of a function has many important interpretations and uses. For example, if circle=: %: @ (1"0 - *:), then circle x gives the y coordinate of a point on a circle with radius 1. The first quadrant may then be plotted as follows: circle=: %: @ (1"0 - *:) Square root of 1 minus the square x=:0.1*i.11 y=:circle x x,.y 0 1 0.1 0.994987 0.2 0.979796 0.3 0.953939 0.4 0.916515 0.5 0.866025 0.6 0.8 0.7 0.714143 0.8 0.6 0.9 0.43589 1 0 PLOT x;y The approximate area of the quadrant is given by the sum of the ten trapezoids, and (using r=:0.1) its change from x to x+r is r times the average height of the trapezoid, that is, the average of circle x, and circle x+r. Therefore, its rate-of change (derivative) at any argument value x is approximately the corresponding value of the circle function. As the increment r approaches zero, the rate of change approaches the exact function value, as illustrated below for the value r=:0.01: x=:0.01*i.101 36 Calculus PLOT x;circle x In other words, the area under the curve is given by the anti-derivative. 37 Chapter 3 Vector Calculus A. Introduction Applied to a list of three dimensions (length, width, height) of a box, the function vol=:*/ gives its volume. For example: lwh=:4 3 2 vol=:*/ vol lwh 24 Since vol is a function of a vector, or list (rank-1 array), the rank-0 derivative operator d. used in the differential calculus in Chapter 1 does not apply to it. But the derivative operator D. does apply, as illustrated below: vol D.1 lwh 6 8 12 The last element of this result is the rate of change as the last element of the argument (height) changes or, as we say, the derivative with respect to the last element of the vector argument. Geometrically, this rate of change is the area given by the other two dimensions, that is, the length and width (whose product 12 is the area of the base). Similarly, the other two elements of the result are the derivatives with respect to each of the further elements; for example, the second is the product of the length and height. The entire result is called the gradient of the function vol. The function vol produces a rank-0 (called scalar, or atomic) result from a rank-1 (vector) argument, and is therefore said to have form 0 1 or to be a 0 1 function; its derivative produces a rank-1 result from a rank-1 argument, and has form 1 1. The product over the first two elements of lwh gives the "volume in two dimensions" (that is, the area of the base), and the product over the first element alone is the "volume in one dimension". All are given by the function VOLS as follows: VOLS=:vol\ VOLS lwh 4 12 24 The function VOLS has form 1 1, and its derivative has form 2 1. For example: 38 Calculus VOLS D.1 lwh 1 0 0 3 4 0 6 8 12 This table merits attention. The last row is the gradient of the product over the entire argument, and therefore agrees with gradient of vol shown earlier. The second row is the gradient of the product over the first two elements (the base); its value does not depend at all on the height, and the derivative with respect to the height is therefore zero (as shown by the last element). Strictly speaking, vector calculus concerns only functions of the forms 0 1 and 1 1; other forms tend to be referred to as tensor analysis. Since the analysis remains the same for other forms, we will not restrict attention to the forms 0 1 and 1 1. However, we will normally restrict attention to three-space (as in vol 2 3 4 for the volume of a box) or two-space (as in vol 3 4 for the area of a rectangle), although an arbitrary number of elements may be treated. Because the result of a 1 1 function is a suitable argument for another of the same form, a sequence of them can be applied. We therefore reserve the term vector function for 1 1 functions, even though 0 1 and 2 1 functions are also vector functions in a more permissive sense. We adopt the convention that a name ending in the digits r and a denotes an r,a func- tion. For example, F01 is a scalar function of a vector, ABC11 is a vector function of a vector, and G02 is a scalar function of a matrix (such as the determinant det=: -/ . *). The functions vol and VOLS might therefore be renamed vol01 and VOLS11. Although the function vol was completely defined by the expression vol=:*/ our initial comments added the physical interpretation of the volume of a box of dimensions lwh. Such an interpretation can be exceedingly helpful in understanding the function and its rate of change, but it can also be harmful: to anyone familiar with finance and fearful of geometry, it might be better to use the interpretation cost=:*/ applied to the argument cip (c crates of i items each, at the price p). We will mainly allow the student to provide her own interpretation from some familiar topic, but will devote a separate Chapter (7) to the matter of interpretations. Chapter 7 may well be consulted at any point. B. Gradient As illustrated above for the vector function VOLS, its first derivative produces a matrix result called the complete derivative or gradient. We will now use the conjunction D. to define an adverb GRAD for this purpose: GRAD=:D.1 VOLS GRAD lwh 1 0 0 3 4 0 6 8 12 We will illustrate its application to a number of functions: E01=: +/@:*: Sum of squares F01=: %:@E01 Square root of sum of squares G01=: 4p1"1 * *:@F01 Four pi times square of F01 Chapter 3 Vector Calculus 39 H01=: %@G01 p=: 1 2 3 (E01,F01,G01,H01) p 14 3.74166 175.929 0.00568411 E01 GRAD p 2 4 6 F01 GRAD p 0.267261 0.534522 0.801784 G01 GRAD p 25.1327 50.2655 75.3982 H01 GRAD p _0.000812015 _0.00162403 _0.00243604 B1 Develop interpretations for each of the functions defined above. ANSWERS: E01 p is the square of the distance (from the origin) to a point p. F01 p is the distance to a point p, or the radius of the sphere (with centre at the origin) through the point p. G01 p is the surface area of the sphere through the point p. H01 is the intensity of illumination at point p provided by a unit light source at the origin. B2 Without using GRAD, provide definitions of functions equivalent to the derivatives of each of the functions defined above. ANSWERS: E11=: +:"1 F11=: -:@%@%:@E01 * E11 G11=: 4p1"0 * E11 H11=: -@%@*:@G01 * G11 Three important results (called the Jacobian, Divergence, and Laplacian) are obtained from the gradient by applying two elementary matrix functions. They are the determinant, familiar from high-school algebra, and the simpler but less familiar trace, defined as the sum of the diagonal. Thus: det=:+/ . * trace=:+/@((<0 1)&|:) VOLS GRAD lwh 1 0 0 3 4 0 6 8 12 det VOLS GRAD lwh 48 trace VOLS GRAD lwh 17 40 Calculus We will also have occasion to use the corresponding adverbs det@ and trace@. Thus: DET=:det@ VOLS GRAD DET lwh 48 TRACE=:trace@ VOLS GRAD TRACE lwh 17 C. Jacobian The Jacobian is defined as the determinant of the gradient. Thus: JAC=: GRAD DET VOLS lwh 4 12 24 VOLS GRAD lwh 1 0 0 3 4 0 6 8 12 VOLS JAC lwh 48 The Jacobian may be interpreted as the volume derivative, or rate of change of volume produced by application of a function. This interpretation is most easily appreciated in the case of a linear function. We will begin with a linear function in 2-space, in which case the "volume" of a body is actually the area: mp=: +/ . * Matrix Product ]m=: 2 2$2 0 0 3 2 0 0 3 L11=: mp&m"1 ]fig1=:>1 1;1 0;0 0;0 1 1 1 1 0 0 0 0 1 ]fig2=: L11 fig1 2 3 2 0 0 0 0 3 L11 JAC 1 1 6 L11 JAC 1 0 6 L11 JAC fig1 6 6 6 6 The result of the Jacobian is indeed the ratio of the areas of fig1 and fig2, as may be verified by plotting the two figures by hand. Moreover, for a linear function, the value of the Jacobian is the same at every point. Chapter 3 Vector Calculus 41 C1 Provide an interpretation for the function K11.=:(H11*])"1. [ The result of K11 is the direction and magnitude of the repulsion of a negative electrical charge from a positive charge at the origin. The function -@K11 may be interpreted as gravitational attraction. ] C2 What is the relation between the Jacobian of the linear function L11 and the determinant of the matrix m used in its definition? C3 What is the relation between the Jacobians of two linear functions LA11 and LB11 and the Jacobian of LC11=: LA11@LB11 (their composition). [ TEST=:LA11@LB11 JAC |@- LA11 JAC * LB11 JAC ] C4 Define functions LA11 and LB11, and test the comparison expressed in the solution to Exercise C3 by applying TEST to appropriate arguments. C5 The Jacobian of the linear LR11=: mp&(>0 1;1 0)"1 is _1. State the significance of a negative Jacobian. [ Plot figures fig1 and fig2, and note that one can be moved smoothly onto the other "without crossing lines". Verify that this cannot be done with fig1 and LR11 fig1; it is necessary to "lift the figure out of the plane and flip it over". A transformation whose Jacobian is negative is said to involve a "reflection". ] C6 Enter, experiment with, and comment upon the following functions: RM2=: 2 2&$@(1 1 _1 1&*)@(2 1 1 2&o.)"0 R2=: (] mp RM2@[)"0 1 [ R2 is a linear function that produces a rotation in 2-space; the expression a R2 fig rotates a figure (such as fig1 or fig2) about the origin through an angle of a radians in a counter-clockwise sense, without deforming the figure.] C7 What is the value of the Jacobian of a rotation a&R2"1? C8 Enter an expression to define FIG1 as an 8 by 3 table representing a cube, making sure that successive coordinates are adjacent, for example, 0 1 1 must not succeed 1 1 0. Define 3-space linear functions to apply to FIG1, and use them together with K11 to repeat Exercises 1-5 in 3-space. C9 Enter, experiment with, and comment upon the functions RM3=: 1 0 0&,@(0&,.)@RM2 R30=: (] mp RM3@[)"0 1 [ a&R30"1 produces a rotation through an angle a in the plane of the last two axes in 3-space (or about axis 0). Test the value of the Jacobian.] C10 Define functions R31 and R32 that rotate about the other axes, and experiment with functions such as a1&R31@(a2&R30)"1. [Experiment with the permutations p=: 2&A. and p=: 5&A. in the expression p&.|:@p@RM3 o.%2, and use the ideas in functions defined in terms of R30. ] 42 Calculus D. Divergence and Laplacian The divergence and Laplacian are defined and used as follows: DIV=: GRAD TRACE LAP=: GRAD DIV f=: +/\"1 f a 1 3 6 f GRAD a 1 0 0 1 1 0 1 1 1 f DIV a 3 g=: +/@(] ^ >:@i.@#)"1 g a 32 g LAP a 22.0268 It is difficult to provide a helpful interpretation of the divergence except in the context of an already-familiar physical application, and the reader may be best advised to seek interpretations in some familiar field. However, in his Advanced Calculus [8], F.S. Woods offers the following: "The reason for the choice of the name divergence may be seen by interpreting F as equal to rv, where r is the density of a fluid and v is its velocity. ... Applied to an infinitesimal volume it appears that div F represents the amount of fluid per unit time which streams or diverges from a point." E. Symmetry, Skew-Symmetry, and Orthogonality A matrix that is equal to its transpose is said to be symmetric, and a matrix that equals the negative of its transpose is skew-symmetric. For example: ]m=:VOLS GRAD lwh The gradient of the volumes function 1 0 0 3 4 0 6 8 12 |:m The gradient is not symmetric 1 3 6 0 4 8 0 0 12 ]ms=:(m+|:m)%2 The symmetric part of the gradient 1 1.5 3 1.5 4 4 3 4 12 ]msk=:(m-|:m)%2 The skew-symmetric part 0 _1.5 _3 Chapter 3 Vector Calculus 43 1.5 0 _4 3 4 0 ms+msk Sum of parts gives m 1 0 0 3 4 0 6 8 12 The determinant of any skew-symmetric matrix is 0, and its vectors therefore lie in a plane: det=:-/ . * The determinant function det msk Shows that the vectors of msk lie in a plane 0 The axes of a rank-3 array can be "transposed" in several ways, by interchanging different pairs of axes. Such transposes are obtained by using |: with a left argument: ]a=:i.2 2 2 0 1 2 3 4 5 6 7 0 2 1 |: a Interchange last two axes 0 2 1 3 4 6 5 7 1 0 2 |: a Interchange first two axes 0 1 4 5 2 3 6 7 The permutation 0 2 1 is said to have odd parity because it can be brought to the normal order 0 1 2 by an odd number of interchanges of adjacent elements; 1 2 0 has even parity because it requires an even number of interchanges. The function C.!.2 yields the parity of its argument, 1 if the argument has even parity, _1 if odd, and 0 if it is not a permutation. An array that is skew-symmetric under any interchange of axes is said to be completely skew. Such an array is useful in producing a vector that is normal (or orthogonal or perpendicular) to a plane. In particular, we will use it in a function called norm that produces the curl of a vector function, a vector normal to the plane of (the skew- symmetric part of) the gradient of the function. We will generate a completely skew array by applying the parity function to the table of all indices of an array: indices=:{@(] # <@i.) indices 3 +-----+-----+-----+ |0 0 0|0 0 1|0 0 2| 44 Calculus +-----+-----+-----+ |0 1 0|0 1 1|0 1 2| +-----+-----+-----+ |0 2 0|0 2 1|0 2 2| +-----+-----+-----+ +-----+-----+-----+ |1 0 0|1 0 1|1 0 2| +-----+-----+-----+ |1 1 0|1 1 1|1 1 2| +-----+-----+-----+ |1 2 0|1 2 1|1 2 2| +-----+-----+-----+ +-----+-----+-----+ |2 0 0|2 0 1|2 0 2| +-----+-----+-----+ |2 1 0|2 1 1|2 1 2| +-----+-----+-----+ |2 2 0|2 2 1|2 2 2| +-----+-----+-----+ e=:C.!.2@>@indices Result is called an "e-system" by McConnell [4] e 3 0 0 0 0 0 1 0 _1 0 0 0 _1 0 0 0 1 0 0 0 1 0 _1 0 0 0 0 0 <"2 e 4 Boxed for convenient viewing +--------+--------+--------+--------+ |0 0 0 0 |0 0 0 0|0 0 0 0|0 0 0 0| |0 0 0 0 |0 0 0 0|0 0 0 _1|0 0 1 0| |0 0 0 0 |0 0 0 1|0 0 0 0|0 _1 0 0| |0 0 0 0 |0 0 _1 0|0 1 0 0|0 0 0 0| +--------+--------+--------+--------+ |0 0 0 0|0 0 0 0 | 0 0 0 1|0 0 _1 0| |0 0 0 0|0 0 0 0 | 0 0 0 0|0 0 0 0| |0 0 0 _1|0 0 0 0 | 0 0 0 0|1 0 0 0| |0 0 1 0|0 0 0 0 |_1 0 0 0|0 0 0 0| +--------+--------+--------+--------+ |0 0 0 0|0 0 0 _1|0 0 0 0 | 0 1 0 0| |0 0 0 1|0 0 0 0|0 0 0 0 |_1 0 0 0| |0 0 0 0|0 0 0 0|0 0 0 0 | 0 0 0 0| |0 _1 0 0|1 0 0 0|0 0 0 0 | 0 0 0 0| +--------+--------+--------+--------+ Chapter 3 Vector Calculus 45 |0 0 0 0| 0 0 1 0|0 _1 0 0|0 0 0 0 | |0 0 _1 0| 0 0 0 0|1 0 0 0|0 0 0 0 | |0 1 0 0|_1 0 0 0|0 0 0 0|0 0 0 0 | |0 0 0 0| 0 0 0 0|0 0 0 0|0 0 0 0 | +--------+--------+--------+--------+ Finally, we will use e in the definition of the function norm, as follows: norm=:+/^:(]`(#@$)`(* e@#)) % !@(# - #@$) mp=:+/ . * Matrix product ]m=:VOLS GRAD lwh Gradient of the volumes function 1 0 0 3 4 0 6 8 12 ]skm=:(m-|:m)%2 Skew part 0 _1.5 _3 1.5 0 _4 3 4 0 ]orth=:norm m Result is perpendicular to plane of skm _8 6 _3 orth mp skm Test of perpendicularity 0 0 0 norm skm Norm of skew part gives the same result _8 6 _3 norm norm skm Norm on a skew matrix is self-inverse 0 _1.5 _3 1.5 0 _4 3 4 0 These matters are discussed further in Chapter 6. F. Curl The curl is the perpendicular to the grade, and is produced by the function norm. We will use the adverb form as follows: NORM=:norm@ CURL=: GRAD NORM VOLS CURL lwh _8 6 _3 subtotals=:+/\ subtotals lwh 4 7 9 subtotals CURL lwh _1 1 _1 46 Calculus Interpretation of the curl is perhaps even more intractable than the divergence. Again Woods offers some help: The reason for the use of the word curl is hard to give without extended treatment of the subject of fluid motion. The student may obtain some help by noticing that if F is the velocity of a liquid, then for velocity in what we have called irrotational motion, curl F=0, and for vortex motion, curl Fβ 0. It may be shown that if a spherical particle of fluid be considered, its motion in a time dt may be analyzed into a translation, a deformation, and a rotation about an instantaneous axis. The curl of the vector v can be shown to have the direction of this axis and a magnitude equal to twice the instantaneous angular velocity. In his Div, Grad, Curl, and all that [9], H.M. Schey makes an interesting attempt to introduce the concepts of the vector calculus in terms of a single topic. His first chapter begins with: In this text the subject of the vector calculus is presented in the context of simple electrostatics. We follow this procedure for two reasons. First, much of vector calculus was invented for use in electromagnetic theory and is ideally suited to it. This presentation will therefore show what vector calculus is, and at the same time give you an idea of what it's for. Second, we have a deep-seated conviction that mathematics -in any case some mathematics- is best discussed in a context which is not exclusively mathematical. Schey's formulation, exhibit the powers of div, grad, and curl in joint use. includes Maxwell's equations which, treatment in Heaviside's elegant F1 Experiment with GRAD, CURL, DIV, and JAC on the functions in Exercise B2. F2 Experiment with GRAD, CURL, DIV, and JAC on the following 1 1 functions: q=: *:"1 r=: 4&A. @: q s=: 1 1 _1&* @: r t=: 3&A. @: ^ @: - u=: ]% (+/@(*~)) ^ 3r2"0 F3 Enter the definitions x=: 0&{ and y=: 1&{ and z=: 2&{, and use them to define the functions of the preceding exercise in a more conventional form. [ as=: *:@z,*:@x,-@*:@y at=: ^@-@y,^@-@z,^@-@x au=: (x,y,z) % (*:@x + *:@y + *:@z) ^ 3r2"0 ] F4 Experiment with LAP on various 0 1 functions. F5 Express the cross product of Section 6G so as to show its relation to CURL. See Section 6H. [ CR=: */ NORM CURL=: GRAD NORM ]. 47 Chapter 4 Difference Calculus A. Introduction Although published some fifty years ago, Jordan's Calculus of Finite Differences [10] still provides an interesting treatment. In his introductory section on Historical and Biographical Notes, he contrasts the difference and differential (or infinitesimal) calculus: Two sorts of functions are to be distinguished. First, functions in which the variable x may take every possible value in a given interval; that is, the variable is continuous. These functions belong to the domain of the Infinitesimal Calculus. Secondly, functions in which the variable takes only the given values x0, x1, x2, ... xn; then the variable is discontinuous. To such functions the methods of Infinitesimal Calculus are not applicable, The Calculus of Finite Differences deals especially with such functions, but it may be applied to both categories. The present brief treatment is restricted to three main ideas: 1) The development of a family of functions which behaves as simply under the difference (secant slope) adverb as does the family of power functions ^&n under the derivative adverb. 2) The definition of a polynomial function in terms of this family of functions. 3) The development of a linear transformation from the coefficients of such a polynomial to the coefficients of an equivalent ordinary polynomial. B. Secant Slope Conjunctions The slope of a line from the point x,f x to the point x,f(x+r) is said to be the secant slope of f for a run of r, or the r-slope of f at x. Thus: cube=:^&3"0 x=:1 2 3 4 5 r=:0.1 ((cube x+r)-(cube x))%r 3.31 12.61 27.91 49.21 76.51 The same result is given by the secant-slope conjunction D: as follows: 48 Calculus r cube D: 1 x 3.31 12.61 27.91 49.21 76.51 0.01 cube D: 1 x 3.0301 12.0601 27.0901 48.1201 75.1501 0.0001 cube D: 1 x 3.0003 12.0006 27.0009 48.0012 75.0015 cube d. 1 x 3 12 27 48 75 3*x^2 3 12 27 48 75 In the foregoing sequence, smaller runs appear to be approaching a limiting value, a value given by the derivative. It is also equal to three times the square. The alternate expression ((cube x)-(cube x-r))%r could also be used to define a slope, and it will prove more convenient in our further work. We therefore define an alternate conjunction for it as follows: SLOPE=:2 : (':'; 'x. u."0 D: n. y.-x.') r cube SLOPE 1 x 2.71 11.41 26.11 46.81 73.51 ((cube x)-(cube x-r))%r 2.71 11.41 26.11 46.81 73.51 0.0001 cube SLOPE 1 x 2.9997 11.9994 26.9991 47.9988 74.9985 cube d. 1 x 3 12 27 48 75 Much like the derivative, the slope conjunction can be used to give the slope of the slope, and so on. Thus: cube d.2 x 6 12 18 24 30 r cube SLOPE 2 x 6 12 18 24 30 We will be particularly concerned with the "first" slope applied to scalar (rank-0) functions, and therefore define a corresponding adverb: S=:("0) SLOPE 1 r cube S x 2.71 11.41 26.11 46.81 73.51 C. Polynomials and Powers In Chapter 3, the analysis of the power function ^&n led to the result that the derivative of the polynomial c&p. could be written as another polynomial : (}.c*i.#c)&p.. This is an important property of the family of power functions, and we seek another family of functions that behaves similarly under the r-slope. We begin by adopting the names p0 and p1 and p2, etc., for the functions ^&0 and ^&1 and ^&2, and by showing how each member of the family can be defined in terms of another. Thus: Chapter 4 Difference Calculus 49 p4=: ]*p3=: ]*p2=: ]*p1=: ]*p0=: 1:"0 The following expressions for the derivatives of sums and products of functions were derived in Chapter 1. The corresponding expressions for the r-slopes may be obtained by simple algebra: f + g Sum (r f S)+(r g S) r-Slope (f d.1) + (g d.1) Derivative f * g Product (f*(r g S))+((r f S)*g)-(r"0*(r f S)*(r g S)) r-Slope (f*g d.1)+(f d.1*g) Derivative For example: r=:0.1 x=:1 2 3 4 5 f=:^&3 g=:^&2 (f+g) x 2 12 36 80 150 r (f+g) S x Slope of sum 4.61 15.31 32.01 54.71 83.41 (r f S x)+ (r g S x) Sum of slopes 4.61 15.31 32.01 54.71 83.41 (f+g) d. 1 x Derivative of sum 5 16 33 56 85 (f d.1 + g d.1) x 5 16 33 56 85 r (f*g) S x Slope of product 4.0951 72.3901 378.885 1217.58 3002.48 ]t1=:(f x)*(r g S x) Terms for slope of product 1.9 31.2 159.3 505.6 1237.5 ]t2=:(r f S x)*(g x) 2.71 45.64 234.99 748.96 1837.75 ]t3=:r * (r f S x) * (r g S x) 0.5149 4.4499 15.4049 36.9799 72.7749 t1+t2-t3 Sum and diff of terms gives slope 4.0951 72.3901 378.885 1217.58 3002.48 (f*g) d. 1 x Derivative of product 5 80 405 1280 3125 ((f d.1 *g) + (f*g d.1)) x 5 80 405 1280 3125 50 Calculus Since the derivative of the identity function ] is the constant function 1"0, expressions for the derivatives of the power functions can be derived using the expressions for the sum and product in informal proofs as follows: p0 d.1 1"0 d.1 (]*p0) d.1 0"0 p1 d.1 (]*p0 d.1)+(] d.1*1"0) (]*0"0)+(1"0*1"0) 1"0 p2 d.1 (]*p1) d.1 (]*p1 d.1)+(] d.1*p1) (]*1"0)+(1"0*p1) p1+p1 2"0*p1 p4 d.1 (]*p3) d.1 p3 d.1 (]*p2) d.1 (]*p2 d.1)+(] d.1*p2) (]*p3 d.1)+(] d.1*p3) (]*2"0*p1)+(1"0*p2) (]*3"0*p2)+(1"0*p3) (2"0*p2)+p2 3"0*p2 (3"0*p3)+p3 4"0*p3 Each of the expressions in the proofs may be tested by applying it to an argument such as x=: i. 6, first enclosing the entire expression in parentheses. We will next introduce stope functions whose behavior under the slope operator is analogous to the behavior of the power function under the derivative. D. Stope Functions The list x+r*i.n begins at x and changes in steps of size r, like the steps in a mine stope that follows a rising or falling vein of ore. We will call the product over such a list a stope: x=:5 r=:0.1 n=:4 x+r*i.n 5 5.1 5.2 5.3 */x+r*i.n 702.78 */x+1*i.n Case r=:1 is called a rising factorial 1680 */x+_1*i.n Falling factorial 120 */x+0*i.n Case r=:0 gives product over list of n x's 625 x^n Equivalent to the power function 625 The two final examples illustrate the fact that the case r=:0 is equivalent to the power function. We therefore treat the stope as a variant of the power function, produced by the conjunction !. as follows: x ^!.r n Chapter 4 Difference Calculus 51 702.78 x ^!.0 n 625 stope=: ^!. The stope adverb x r stope n 702.78 We now define a set of stope functions analogous to the functions p0=:^&0 and p1=:^&1, etc. used for successive powers. Thus: q0=:r stope&0 q1=:r stope&1 q2=:r stope&2 q3=:r stope&3 q4=:r stope&4 x=:0 1 2 3 4 >(q0;q1;q2;q3;q4) x 1 1 1 1 1 0 1 2 3 4 0 1.1 4.2 9.3 16.4 0 1.32 9.24 29.76 68.88 0 1.716 21.252 98.208 296.184 E. Slope of the Stope We will now illustrate that the r-slope of r stope&n is n*r stope&(n-1): r q4 S x 0 5.28 36.96 119.04 275.52 4*q3 x 0 5.28 36.96 119.04 275.52 r q3 S x 0 3.3 12.6 27.9 49.2 3*q2 x 0 3.3 12.6 27.9 49.2 This behavior is analagous to that of the power functions p4, p3, etc. under the derivative. Moreover, the stope functions can be defined as a sequence of products, in a manner similar to that used for defining the power functions. Thus (using R for a constant function): R=:r"0 f4=:(]+3"0*R)*f3=:(]+2"0*R)*f2=:(]+1"0*R)*f1=:(]+0"0*R)*f0=:1"0 From these definitions, the foregoing property of the r-slopes of stopes can be obtained in the manner used for the derivative of powers, but using the expression: 52 Calculus (f*(r g S))+((r f S)*g)-(R*(r f S)*(r g S)) For the r-slope of the product of functions instead of the: (f*g d.1)+(f d.1*g) used for the derivative. F. Stope Polynomials The polynomial function p. also possesses a variant p.!.r, in which the terms are based upon the stope ^!.r rather than upon the power ^ . For example: spr=:p.!.r c=:4 3 2 1 c&spr x 4 10.52 27.64 61.36 117.68 (4*x ^!.r 0)+(3*x^!.r 1)+(2*x^!.r 2)+(1*x^!.r 3) 4 10.52 27.64 61.36 117.68 The r-slope of the stope polynomial c&spr then behaves analogously to the derivative of the ordinary polynomial. Thus: deco=: 1:}.]*i.@# Function for coefficients of derivative polynomial ]d=:deco c 3 4 3 c&p. x Ordinary polynomial with coefficients c 4 10 26 58 112 c&p. d.1 x Derivative of polynomial 3 10 23 42 67 d p. x Agrees with polynomial with "derivative" coefficients 3 10 23 42 67 spr=:p.!.r Stope polynomial for run r c&spr x Stope polynomial with coefficients c 4 10.52 27.64 61.36 117.68 r c&spr S x r-slope of stope polynomial 3 10.3 23.6 42.9 68.2 d&spr x Agrees with stope polynomial with coefficients d 3 10.3 23.6 42.9 68.2 We now define a stope polynomial adverb, whose argument specifies the run: SPA=: 1 : '[ p.!.x. ]' c 0 SPA x Zero gives ordinary polynomial 4 10 26 58 112 c p. x 4 10 26 58 112 c r SPA x Stope with run r Chapter 4 Difference Calculus 53 4 10.52 27.64 61.36 117.68 Integration behaves analogously: adeco=: [ , ] % >:@i.@#@] The integral coefficient function (0 adeco c)&spr x 0 6.959 25.773 70.342 160.566 G. Coefficient Transformations It is important to be able to express an ordinary polynomial as an equivalent stope polynomial, and vice versa. We will therefore show how to obtain the coefficients for an ordinary polynomial that is equivalent to a stope polynomial with given coefficients: The expression vm=:x ^/ i.#c gives a table of powers of x that is called a Vandermonde matrix. If mp=:+/ . * is the matrix product, then vm mp c gives weighted sums of these powers that are equivalent to the polynomial c p. x. For example: x=:2 3 5 7 11 c=:3 1 4 2 1 c p. x 53 177 983 3293 17801 ]vm=:x ^/ i.#c 1 2 4 8 16 1 3 9 27 81 1 5 25 125 625 1 7 49 343 2401 1 11 121 1331 14641 mp=:+/ . * ]y=:vm mp c 53 177 983 3293 17801 If x has the same number of elements as c, and if the elements of x are all distinct, then the matrix vm is non-singular, and its inverse can be used to obtain the coefficients of a polynomial that gives any specified result. If the result is y, these coefficients are, of course, the original coefficients c. Thus: (%.vm) mp y 3 1 4 2 1 The coefficients c used with a stope polynomial give a different result y2, to which we can apply the same technique to obtain coefficients c2 for an equivalent ordinary polynomial: r=:0.1 ]y2=:c p.!.r x 61.532 200.928 1077.98 3536.71 18690.4 ]c2=:(%.vm) mp y2 3 1.446 4.71 2.6 1 c2 p. x 61.532 200.928 1077.98 3536.71 18690.4 54 Calculus We now incorporate this method in a conjunction FROM, such that r1 FROM r2 gives a function which, applied to coefficients c, yields d such that d p.!.r1 x is equivalent to c p.!.r2 x. Thus: VM=:1 : '[ ^!.x./i.@#@]' FROM=: 2 : '((y. VM %. x. VM)~ @i.@#) mp ]' ]cr=:r FROM 0 c 3 0.619 3.47 1.4 1 cr p.!.r x 53 177 983 3293 17801 c p.!.0 x 53 177 983 3293 17801 A conjunction that yields the corresponding Vandermonde matrix rather than the coefficients can be obtained by removing the final matrix product from FROM. For the case of the falling factorial function (r=:_1) this matrix gives results of general interest: VMFROM=: 2 : '((y. VM %. x. VM)~ @i.@#)' 0 VMFROM _1 c 1 0 0 0 0 0 1 _1 2 _6 0 0 1 _3 11 0 0 0 1 _6 0 0 0 0 1 _1 VMFROM 0 c 1 0 0 0 0 0 1 1 1 1 0 0 1 3 7 0 0 0 1 6 0 0 0 0 1 The elements of the last of these tables are called Stirling numbers of the scond kind, and the magnitudes of those of the first are Stirling numbers of the first kind. G1 Experiment with the adverb VM. D2 Enter expressions to obtain the matrices S1 and S2 that are Stirling numbers of order 6 (that is, $ S1 is 6 6). [c=: 6?9 S1=:0 FROM 1 c S2=:1 FROM 0 c] D3 Test the assertion that S1 is the inverse of S2. H. Slopes as Linear Functions A linear function can be represented by a matrix bonded with the matrix product. For example, if v is a vector and ag=: <:/~@i.@# , then sum=: ag v is a summation or aggregation matrix; the linear function (mp=: +/ . *)&sum produces sums over prefixes of its argument. Thus: ]v=: ^&3 i. 6 0 1 8 27 64 125 Chapter 4 Difference Calculus 55 mp=: +/ . * ag=: <:/~@i.@# sum=: ag v sum 1 1 1 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 0 0 0 1 1 1 0 0 0 0 1 1 0 0 0 0 0 1 sum mp sum 1 2 3 4 5 6 0 1 2 3 4 5 0 0 1 2 3 4 0 0 0 1 2 3 0 0 0 0 1 2 0 0 0 0 0 1 v mp sum 0 1 9 36 100 225 v mp (sum mp sum) 0 1 10 46 146 371 +/\v 0 1 9 36 100 225 +/\ +/\v 0 1 10 46 146 371 mp&sum v 0 1 9 36 100 225 mp&(sum mp sum) v 0 1 10 46 146 371 L1=: mp&sum L2=:mp&(sum mp sum) L1 v 0 1 9 36 100 225 L2 v 0 1 10 46 146 371 +/\v 0 1 9 36 100 225 +/\ +/\v 0 1 10 46 146 371 mp&sum v 0 1 9 36 100 225 mp&(sum mp sum) v 0 1 10 46 146 371 L1=: mp&sum L2=:mp&(sum mp sum) L1 v 0 1 9 36 100 225 L2 v 0 1 10 46 146 371 The results of L1 v are rough approximations to the areas under the graph of ^&3, that is, to the integrals up to successive points. Similarly, the inverse matrix dif=: %. sum can define a linear function that produces differences between successive elements of its argument. For example: dif=: %. sum dif 1 _1 0 0 0 0 0 1 _1 0 0 0 0 0 1 _1 0 0 0 0 0 1 _1 0 0 0 0 0 1 _1 0 0 0 0 0 1 dif mp dif 1 _2 1 0 0 0 0 1 _2 1 0 0 0 0 1 _2 1 0 0 0 0 1 _2 1 0 0 0 0 1 _2 0 0 0 0 0 1 LD1=: mp&dif LD1 v 0 1 7 19 37 61 LD2=: mp&(dif mp dif) LD2 v 0 1 6 12 18 24 56 Calculus These results may be compared with the 1-slopes of the cube function, noting that the first k elements of the kth slope are meaningless. The r-slopes of a function f can be obtained similarly, by applying %&r@LD1 to the results of f applied to arguments differing by r. For example: ]x=: r*i.6 [ r=: 0.1 0 0.1 0.2 0.3 0.4 0.5 %&r@LD1 ^&3 x 0 0.01 0.07 0.19 0.37 0.61 r (^&3) S x 0.01 0.01 0.07 0.19 0.37 0.61 Because the results for the 1-slope are so easily extended to the case of a general r-slope, we will discuss only the 1-slope provided by the linear function DIF=: mp&dif . Consider the successive applications of DIF to the identity matrix: ID=: (i. =/ i.) 6 DIF=: mp&dif ID DIF ID 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 DIF DIF ID 1 _1 0 0 0 0 1 _2 1 0 0 0 0 1 _1 0 0 0 0 1 _2 1 0 0 0 0 1 _1 0 0 0 0 1 _2 1 0 0 0 0 1 _1 0 0 0 0 1 _2 1 0 0 0 0 1 _1 0 0 0 0 1 _2 0 0 0 0 0 1 0 0 0 0 0 1 2 3$ <"2@(DIF^:0 1 2 3 4 5) ID +----------------+----------------+-------------------+ | 1 0 0 0 0 0 |1 _1 0 0 0 0| 1 _2 1 0 0 0 | | 0 1 0 0 0 0 |0 1 _1 0 0 0| 0 1 _2 1 0 0 | | 0 0 1 0 0 0 |0 0 1 _1 0 0| 0 0 1 _2 1 0 | | 0 0 0 1 0 0 |0 0 0 1 _1 0| 0 0 0 1 _2 1 | | 0 0 0 0 1 0 |0 0 0 0 1 _1| 0 0 0 0 1 _2 | | 0 0 0 0 0 1 |0 0 0 0 0 1| 0 0 0 0 0 1 | +----------------+----------------+-------------------+ |1 _3 3 _1 0 0|1 _4 6 _4 1 0|1 _5 10 _10 5 _1| |0 1 _3 3 _1 0|0 1 _4 6 _4 1|0 1 _5 10 _10 5| |0 0 1 _3 3 _1|0 0 1 _4 6 _4|0 0 1 _5 10 _10| |0 0 0 1 _3 3|0 0 0 1 _4 6|0 0 0 1 _5 10| |0 0 0 0 1 _3|0 0 0 0 1 _4|0 0 0 0 1 _5| |0 0 0 0 0 1|0 0 0 0 0 1|0 0 0 0 0 1| +----------------+----------------+-------------------+ The foregoing results suggest that the k-th difference is a weighted sum of k+1 elements in which the weights are the alternating binomial coefficients of order k. For example: ]v=: ^&3 i. 8 0 1 8 27 64 125 216 343 w=: mp & 1 _2 1 w 0 1 2{v 6 w 1 2 3{v 12 w 2 3 4{v w 3 4 5{v 18 24 3 <\ v +-----+------+-------+---------+----------+-----------+ Box applied to each 3-element window Chapter 4 Difference Calculus 57 |0 1 8|1 8 27|8 27 64|27 64 125|64 125 216|125 216 343| +-----+------+-------+---------+----------+-----------+ 3 w\ v 6 12 18 24 30 36 4 (mp & _1 3 _3 1)\ v 6 6 6 6 6 Weighting function applied to each 3-element window The third difference of the cube function is the constant !3 6 (mp & _1 5 _10 10 _5 1)\ ^&5 i. 11 120 120 120 120 120 120 The binomial (i. n+1)!n. For example: coefficients of order n are provided by the expression (i.@>: ! ]) n=: 5 1 5 10 10 5 1 The alternating coefficients could be obtained by multiplying alternate elements by _1. However, they are provided more directly by the extension of the function ! to negative arguments, as may be seen in the following "bordered" function table: ]i=: i: 7 _7 _6 _5 _4 _3 _2 _1 0 1 2 3 4 5 6 7 i ! table i +--+-------------------------------------------------+ | | _7 _6 _5 _4 _3 _2 _1 0 1 2 3 4 5 6 7| +--+-------------------------------------------------+ |_7| 1 _6 15 _20 15 _6 1 0 0 0 0 0 0 0 0| |_6| 0 1 _5 10 _10 5 _1 0 0 0 0 0 0 0 0| |_5| 0 0 1 _4 6 _4 1 0 0 0 0 0 0 0 0| |_4| 0 0 0 1 _3 3 _1 0 0 0 0 0 0 0 0| |_3| 0 0 0 0 1 _2 1 0 0 0 0 0 0 0 0| |_2| 0 0 0 0 0 1 _1 0 0 0 0 0 0 0 0| |_1| 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0| | 0| 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1| | 1| _7 _6 _5 _4 _3 _2 _1 0 1 2 3 4 5 6 7| | 2| 28 21 15 10 6 3 1 0 0 1 3 6 10 15 21| | 3| _84 _56 _35 _20 _10 _4 _1 0 0 0 1 4 10 20 35| | 4| 210 126 70 35 15 5 1 0 0 0 0 1 5 15 35| | 5| _462 _252 _126 _56 _21 _6 _1 0 0 0 0 0 1 6 21| | 6| 924 462 210 84 28 7 1 0 0 0 0 0 0 1 7| | 7|_1716 _792 _330 _120 _36 _8 _1 0 0 0 0 0 0 0 1| +--+-------------------------------------------------+ Except for a change of sign required for those of odd order, the required alternating binomial coefficients can be seen in the diagonals beginning in row 0 of the negative columns of the foregoing table. The required weights are therefore given by the following function: w=: _1&^ * (i. ! i. - ])@>:"0 w 0 1 2 3 4 1 0 0 0 0 _1 1 0 0 0 1 _2 1 0 0 _1 3 _3 1 0 1 _4 6 _4 1 Differences may therefore be expressed as shown in the following examples: 58 Calculus ]v=: ^&3 i. 8 0 1 8 27 64 125 216 343 2 mp & (w 1)\ v 1 7 19 37 61 91 127 3 mp & (w 2)\ v 6 12 18 24 30 36 5 mp & (w 4)\ ^&6 i. 10 1560 3360 5880 9120 13080 17760 It may also be noted that the diagonals beginning in row 0 of the non-negative columns of the table contain the weights appropriate to successive integrations as, for example, in the diagonals beginning with 1 1 1 1 1 and 1 2 3 4 5 and 1 3 6 10 15. This fact can be used to unite the treatment of derivatives and integrals in what Oldham and Spanier call differintegrals in their Fractional Calculus [5]. Moreover, the fact that the function ! is generalized to non-integer arguments will be used (in Chapter 5) to define fractional derivatives and integrals. For example: (i.7)!4 1 4 6 4 1 0 00 0j4":(0.01+i.7)!4 Formatted to four decimal places 1.0210 4.0333 5.9998 3.9666 0.9793 _0.0020 0.0003 59 Chapter 5 Fractional Calculus A. Introduction The differential and the difference calculus of Chapters 2 and 4 concern derivatives and integrals of integer order. The fractional calculus treated in this chapter unites the derivative and the integral in a single differintegral, and extends its domain to non- integral orders. Section H of Chapter 1 included a brief statement of the utility of the fractional calculus and a few examples of fractional derivatives and integrals. Section E of Chapter 4 concluded with the use of the alternating binomial coefficients produced by the outof function ! to compute differences of arbitrary integer order. The extension of the function ! to non-integer arguments was also cited as the basis for an analogous treatment of non- integer differences, and therefore as a basis for approximating non-integer differintegrals. Our treatment of the fractional calculus will be based on Equation 3.2.1 on page 48 of OS (Oldham and Spanier [5]). Thus: f=: ^&3 Function treated q=: 2 N=: 100 a=: 0 x=: 3 Order of differintegral Number of points used in approximation Starting point of integration Argument OS=: '+/(s^-q)*(j!j-1+q)*f x-(s=:N%~x-a)*j=:i.N' ". OS 17.82 Execute the Oldham Spanier expression to obtain the approximation to the second derivative of f at x q=: 1 ". OS 26.7309 q=: 0 ". OS Approximation to the first derivative (the exact value is 3*x^2, that is, 27) Zeroth derivative (the function itself) 60 Calculus 27 q=: _1 ". OS 20.657 q=: _2 ". OS 12.7677 q=: 0.5 ". OS 27.9682 The first integral (exact value is 4%~x^4) The second integral (exact value is 20%~x^5) Semi-derivative (exact value is 28.1435) We will use the expression OS to define a fractional differintegral conjunction fd such that q (a,N) fd f x produces an N-point approximation to the q-th derivative of the function f at x if q>:0, and the (|q)-th integral from a to x if q is negative: j=: ("_) (i.@}.@) s=: (&((] - 0: { [) % 1: { [)) (@]) m=: '[:+/(x.s^0:-[)*(x.j!x.j-1:+[)*[:y.]-x.s*x.j' fd=: 2 : m For example: 2 (0,100) fd (^&3) 3 17.82 2 (0,100) fd (^&3)"0 i. 4 _. 5.94 11.88 17.82 An approximation to a derivative given by a set of N points will be better over shorter intervals. For example: x=: 6 1 (0,100) fd f x 106.924 3*x^2 108 1 ((x-0.01),100) fd f x 107.998 Anyone wishing to study the OS formulation and discussion will need to appreciate the relation between the function ! used here, and the gamma function (G) used by OS. Although the gamma function was known to be a generalization of the factorial function on integer arguments, it was not defined to agree with it on integers. Instead, G n is is here defined as equivalent (!n)%(!m)*(!n-m); the three occurrences of the gamma function in Equation 3.2.1 of OS may therefore be written as j!j-1+q, as seen in the expression OS used above. to ! n-1. Moreover, the dyadic case m!n The related complete beta function is also used in OS, where it is defined (page 21) by B(p,q) = (G p) * (G q) % (G p+q). This definition may be re-expressed so as to show its relation to the binomial coefficients, by substituting m for p-1 and n for p+q-1. The expression B(p,q) is then equivalent to (!m)*(!n-m)%(!n), or simply % m!n. Chapter 5 Fractional Calculus 61 B. Table of Semi-Differintegrals The differintegrals of the sum f+g and the difference f-g are easily seen to be the sums and differences of the corresponding differintegrals, and it might be expected that fractional derivatives satisfy further relationships analogous to those shown in Section 2K for the differential calculus. Such relations are developed by Oldham and Spanier, but most are too complex for treatment here. We will confine attention to a few of their semi-differintegrals (of orders that are integral multiples of 0.5 and _0.5). We begin by defining a conjunction FD (similar to fd, but with the parameters a and N fixed at 0 and 100), and using it to define adverbs for approximating semi-derivatives and semi-integrals: FD=: 2 : 'x."0 (0 100) fd y. ]' ("0) x=: 1 2 3 4 5 1 FD (^&3) x 2.9701 11.8804 26.7309 47.5216 74.2525 3*x^2 3 12 27 48 75 Exact expression si=: _1r2 FD sd=: 1r2 FD s3i=: _3r2 FD ^&3 sd x 1.79416 10.1493 27.9682 57.4131 100.296 Semi-derivative of cube _1r2 is the rational constant _1%2 sdc=: *:@!@[*(4&*@] ^ [) % !@+:@[ *%:@o.@] 3 sdc x 1.80541 10.2129 28.1435 57.773 100.925 Exact expression from OS[5] page 119 ^&3 si x 0.520349 5.88707 24.3343 66.6046 145.442 Semi-integral of cube sic=:*:@!@[*(4&*@]^+&0.5@[)%!@>:@+:@[*%:@o.@1: 3 sic x 0.51583 5.83596 24.123 66.0263 144.179 Exact function from OS[5] page 119 Although the conjunctions sd and si and s3i provide only rough approximations, we will use them in the following table to denote exact conjunctions for the semi- differintegrals. This makes it possible to use the expressions in computer experiments, remembering, of course, to wrap any fork in parentheses before applying it. Function Semi-derivative f sd + g sd f sd - g sd Semi-integral f si + g si f si - g si (]*g sd)+-:@(g si) (]*g si)--:@(g s3i) c"0 * g sd c"0 % %:@o. %@%:@o. +:@%:@%@o.@% c"0 * g si (2*c)"0*%:@(]%1p1"0) +:@%:@%@o.@% 4r3"0*(^&3r2)%1p1r2"0 f+g f-g ]*g c"0*g c"0 1"0 ] 62 Calculus *: %: 8r3"0*(^&3r2)%1p1r2"0 16r15"0*(^&5r2)%1p1r2"0 1r2p1r2"0 -:@(]*1p1r2"0) %@>: (%:@>:-%:*_5&o.@%: +:@(_5&o.@%:)%%:@(>:*1p1"0) ).%%:@o.*>:^3r2"0 %@%: %:@>: 0"0 %:@(1p1"0) 1p1r2"0%~%:@%+_3&o.@%: 1p1r2"0%~%:+>:*_3&o.@%: %@%:@>: %@(>:*%:*1p1r2"0) +:@(_3&o.)@%:%1p1r2"0 ^&p ^&n %/@!@((p-0 1r2)"0 %/@!@((p+0 1r2)"0)*^&(p+1r2) )*^&(p-1r2) *:@!@(n"0)*^&n@4: *:@!@(n"0)*^&(n+1r2)@4: %!@+:@(n"0)*%:@o. %!@>:@+:@(n"0)*1p1r2" ^&(n+1r2) !@>:@+:@(n"0)*1p !@>:@>:@+:@(n"0)*1p1 1r2"0*^&n@(1r4& r2"0*^&(>:n)@(%&4) *)%+:@*:@!@(n"0) _3&o.@%: -:@%:@(1p1"0%>:) %*:@!@>:@(n"0) 1p1r2"0*%:&.>: Notes: f Function g Function n Integer p Constant greater than _1 c Constant To experiment with entries in the foregoing table, first enter the definitions of sd and si and s3i, and definitions for f and g (such as f=: ^&3 and g=: ^&2). The first row would then be treated as: (f+g) sd x=: 1 2 3 4 3.29303 14.3887 35.7565 69.404 (f sd + g sd) x 3.29303 14.3887 35.7565 69.404 (f+g) si x 1.12591 9.31267 33.7741 85.9827 (f si + g si) x 1.12591 9.31267 33.7741 85.9827 Entries in the table can be rendered more readable to anyone familiar only with conventional notation by a few assignments such as: twice=: +: sqrt=: %: pitimes=: o. reciprocal=: % on=: @ The table entry for the semi-derivative of the identity function could then be expressed as follows: Chapter 5 Fractional Calculus 63 ] sd x 1.12697 1.59378 1.95197 2.25394 twice on sqrt on reciprocal on pitimes on reciprocal x 1.12838 1.59577 1.95441 2.25676 Alternatively, it can be expressed using the under conjunction as follows: under=: &. twice on sqrt on (pitimes under reciprocal) x 1.12838 1.59577 1.95441 2.25676 65 Chapter 6 Properties of Functions A. Introduction In this chapter we will analyze relations among the functions developed in Chapter 2, and express them all as members of a single family. We will first attempt to discover interesting relations by experimentation, and then to construct proofs. In this section we will use the growth and decay functions to illustrate the process, and then devote separate sections to experimentation and to proof. We will use the adverb D=: ("0)(D.1) . The reader is urged to try to develop her own experiments before reading Section B, and her own proofs before reading Section C. In Sections E and F of Chapter 2, the functions ec and eca were developed to approximate growth and decay functions. Thus: eca=: _1&^ * ec=: %@! ec i.7 1 1 0.5 0.166667 0.0416667 0.00833333 0.00138889 eca i.7 1 _1 0.5 _0.166667 0.0416667 _0.00833333 0.00138889 We will now use the approximate functions to experiment with growth and decay: GR=: (ec i.20)&p. DE=: (eca i.20)&p. It might be suspected that the decay function would be the reciprocal of the growth function, in other words that their product is one. We will test this conjecture in two ways, first by computing the product directly, and then by computing the coefficients of the corresponding product polynomial. Thus: GR x=: 0 1 2 3 4 1 2.71828 7.38906 20.0855 54.5981 DE x 1 0.367879 0.135335 0.0497871 0.0183153 (GR x) * (DE x) 66 Calculus 1 1 1 1 0.999979 (GR * DE) x 1 1 1 1 0.999979 PP=: +//.@(*/) 1 2 1 PP 1 3 3 1 1 5 10 10 5 1 6{. (ec i.20) PP (eca i.20) 1 0 0 _2.77556e_17 6.93889e_18 _1.73472e_18 6{.(ec PP eca) i.20 1 0 0 _2.77556e_17 6.93889e_18 _1.73472e_18 ((ec PP eca) i.20) p. x 1 1 1 1 0.999979 Since the growth and decay functions were defined only in terms of their derivatives, any proof of the foregoing conjecture must be based on these defining properties. We begin by determining the derivative of the product as follows: (DE*GR) d.1 (DE*GR d.1)+(DE d.1 *GR) See Section 2K (DE*GR)+(DE d.1 *GR) Definition of GR (DE*GR)+(-@DE*GR) Definition of DE (DE*GR)-(DE*GR) 0"0 Consequently, the derivative of DE*GR is zero; DE*GR is therefore a constant, whose value may be determined by evaluating the function at any point. At the argument 0, all terms of the defining polynomials are zero except the first. Hence the constant value of DE*GR is one, and it is defined by the function 1"0 . Thus: (DE*GR) x 1 1 1 1 0.999979 1"0 x 1 1 1 1 1 A second experiment is suggested by the demonstration (in Section I of Chapter 2) that the derivative of the function f=: ^@(r&*) is r times f; the case r=: _1 should give the decay function: r=: _1 DE x=: 0 1 2 3 4 1 0.367879 0.135335 0.0497871 0.0183153 ^@(r&*) x 1 0.367879 0.135335 0.0497871 0.0183156 ^ AM r x 1 0.367879 0.135335 0.0497871 0.0183156 Chapter 6 Properties of Functions 67 The final expression uses the scaling conjunction of Section I of Chapter 2. We may now conclude that the function ^ AM r describes growth at any rate, and that negative values of r subsume the case of decay. In the foregoing discussion we have used simple observations (such as the probable reciprocity of growth and decay) to motivate experiments that led to the statement and proof of significant identities. To any reader already familiar with the exponential function these matters may seem so obvious as to require neither suggestion nor proof, and he may therefore miss the fact that all is based only on the bare definitions given in Sections 2E and 2F. Similar remarks apply to the hyperbolic and circular functions treated in Sections 2G,H. The points might be better made by using featureless names such as f1, f2, and f3 for the functions. However, it seems better to adopt commonly used names at the outset. A1 Test the proof of this section by entering each expression with an argument. A2 Make and display the table T whose (counter) diagonal sums form the product of the coefficients ec i.7 and eca i.7. [ T=: (ec */ eca) i.7 ] A3 Denoting the elements of the table t=: 2 2{.T by t00, t01, t10, and t11, write explicit expressions for them. Then verify that t00 and t01+t10 agree with the first two elements of the product polynomial given in the text. [ t00 is 1*1 t01+t10 is (1*_1)+(1*1) ] A4 Use the scheme of A3 on larger subtables of T to check further elements of the polynomial product. A5 Repeat the exercises of this section for other relations between functions that might be known to you. [Consider the functions f=: ^*^ and g=: ^@+: beginning by applying them to arguments such as f"0 i.5 and g"0 i. 5] B. Experimentation Hyperbolics. One hyperbolic may be plotted against the other as follows: sinh=: 5&o. cosh=: 6&o. load'plot' plot (cosh;sinh) 0.1*i:21 The resulting plot suggests a hyperbola satisfying the equation 1= (sqr x)-(sqr y). Thus: 68 Calculus (*:@cosh - *:@sinh) i:10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Finally, each of the hyperbolics is the derivative of the other, and their second derivatives equal the original functions: sinh x=: 0 1 2 3 4 0 1.1752 3.62686 10.0179 27.2899 cosh x 1 1.54308 3.7622 10.0677 27.3082 sinh d.1 x 1 1.54308 3.7622 10.0677 27.3082 cosh d.1 x 0 1.1752 3.62686 10.0179 27.2899 sinh d.2 x 0 1.1752 3.62686 10.0179 27.2899 cosh d.2 x 1 1.54308 3.7622 10.0677 27.3082 Circulars. The circular functions may be plotted similarly: sin=: 1&o. cos=: 2&o. plot (cos;sin) 0.1*i:21 The resulting (partial) circle (flattened by scaling) suggests that the following sum of squares should give the result 1 : (*:@cos + *:@sin) i:10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Finally, the derivative of cos is -@sin and sin d.1 is cos. Parity. If f -x equals f x for every value of x, then f is said to be even. Geometrically, this implies that the plot of f is reflected in the vertical axis. For example: Chapter 6 Properties of Functions 69 f=:^&2 x=:0 1 2 3 4 f x 0 1 4 9 16 f -x 0 1 4 9 16 plot f i:4 If f -x equals -f x, then f is said to be odd, and its plot is reflected in the origin: f=:^&3 f x 0 1 8 27 64 f -x 0 _1 _8 _27 _64 plot f i:3 The adverbs: EVEN=: .. - ODD=: .: - give the even and odd parts of a function to which they are applied; that is, f EVEN is an even function, f ODD is odd, and their sum is equal to f. For example: ^ x 0.0497871 0.135335 0.367879 1 2.71828 7.38906 20.0855 70 Calculus ^ EVEN x 10.0677 3.7622 1.54308 1 1.54308 3.7622 10.0677 ^ ODD x _10.0179 _3.62686 _1.1752 0 1.1752 3.62686 10.0179 (^EVEN x)+(^ODD x) 0.0497871 0.135335 0.367879 1 2.71828 7.38906 20.0855 Since the coefficients that define the hyperbolic and circular functions each have zeros in alternate positions, each is either odd or even. The following functions are all tautologies, that is, they yield 1 for any argument: (sinh = sinh ODD) (sinh = ^ ODD) (cosh = cosh EVEN) (cosh = ^ EVEN) (sin = sin ODD) (cos = cos EVEN) B1 Repeat Exercises A2-A5 with modifications appropriate to the circular and hyperbolic functions. C. Proofs We will now use the definitions of the hyperbolic and circular functions to establish the two main conjectures of Section B: (*:@cosh - *:@sinh) is 1 (*:@cos + *:@sin) is 1 See Section K of Chapter 2 for justification of the steps in the proof: (*:@cosh - *:@sinh) d.1 (*:@cosh d.1 - *:@sinh d.1) ((*: d.1 @cosh*sinh)-(*: d.1 @sinh * cosh)) ((2"0 * cosh * sinh)-(2"0 * sinh * cosh)) (2"0 * ((cosh * sinh) - (sinh * cosh))) 0"0 The circular case differs only in the values for the derivatives: cos d.1 is -@sin sin d.1 is cos C1 Write and test a proof of the fact that the sum of the squares of the functions 1&o. and 2&o. is 1. D. The Exponential Family We have now shown how the growth, decay, and hyperbolic functions can be expressed in terms of the single exponential function ^ : Chapter 6 Properties of Functions 71 ^ AM r ^ EVEN ^ ODD Growth at rate r Hyperbolic cosine Hyperbolic sine Complex numbers can be used to add the circular functions to the exponential family as follows: ^@j. EVEN ^@j. ODD For example: Cosine Sine multiplied by 0j1 ^@j. EVEN x=: 0 1 2 3 4 1 0.540302 _0.416147 _0.989992 _0.653644 cos x 1 0.540302 _0.416147 _0.989992 _0.653644 ^@j. ODD x 0 0j0.841471 0j0.909297 0j0.14112 0j_0.756802 j. sin x 0 0j0.841471 0j0.909297 0j0.14112 0j_0.756802 j.^:_1 ^@j. ODD x 0 0.841471 0.909297 0.14112 _0.756802 ^ ODD &. j. x 0 0.841471 0.909297 0.14112 _0.756802 D1 Write and test tautologies involving cosh and sinh . [ t=: cosh = sinh@j. and u=: sinh = cosh@j. ] D2 Repeat D1 for cos and sin. E. Logarithm and Power The inverse of the exponential is called the logarithm, or natural logarithm. It is denoted by ^. ; some of its properties are shown below: I=: ^:_1 Inverse adverb ^ I x=: 1 2 3 4 5 0 0.693147 1.09861 1.38629 1.60944 ^ ^ I x 1 2 3 4 5 ^. x 0 0.693147 1.09861 1.38629 1.60944 Natural log 72 Calculus ^. d.1 x 1 0.5 0.333333 0.25 0.2 % ^. d.1 x 1 2 3 4 5 ^. x ^ b=: 3 0 2.07944 3.29584 4.15888 4.82831 b * ^. x 0 2.07944 3.29584 4.15888 4.82831 The dyadic case of the logarithm ^. is defined in terms of the monadic as illustrated below: (^.x) % (^.b) 0 0.63093 1 1.26186 1.46497 b ^. x 0 0.63093 1 1.26186 1.46497 b %&^.~ x 0 0.63093 1 1.26186 1.46497 The dyadic case of ^ is the power function; it has, like other familiar dyads (including + - * %) been used without definition. We now define it in terms of the dyadic logarithm as illustrated below: (Where I=: ^:_1 is the inverse adverb) b&^. I x 3 9 27 81 243 b ^ x 3 9 27 81 243 This definition extends the domain of the power function beyond the non-negative integer right arguments embraced in the definition of power as the product over repetitions of the left argument, as illustrated below: m=: 1.5 n=: 4 n # m 1.5 1.5 1.5 1.5 */ n # m 5.0625 m^n 5.0625 Moreover, the extended definition retains the familiar properties of the simple definition. For example: Chapter 6 Properties of Functions 73 5 ^ 4+3 78125 (5^4)*(5^3) 78125 E1 Comment on the question of whether the equivalence of */n#m and m^n holds for the case n=:0. F. Trigonometric Functions Just as a five-sided (or five-angled) figure may be characterized either as pentagonal or pentangular, so may a three-sided figure be characterized as trigonal or triangular. The first of these words suggests the etymology of trigonometry, the measurement of three- sided figures. This section concerns the equivalence of the functions sin and cos (that have been defined only by differential equations) and the corresponding trigonometric functions sine and cosine. The sine and cosine are also called circular functions, because they can be defined in terms of the coordinates of a point on a unit circle (with radius 1 and centre at the origin) as functions of the length of arc to the point, measured counter-clockwise from the reference point with coordinates 1 0. As illustrated in Figure F1, the cosine of a is the horizontal (or x) coordinate of the point whose arc is a, and the sine of a is the vertical coordinate. The length of arc is also called the angle, and the ratio of the circumference of a circle to its diameter is called pi, given by pi=: o. 1, or by the constant 1p1. The circular functions therefore have the period 2p1, that is two pi. Moreover, the coordinates of the end points of arcs of lengths 1p1 and 0.5p1 are _1 0 and 0 1; the supplementary angle 1p1&- a and the complementary angle 0.5p1&- a are found by moving clockwise from these points. sin a 1 a cos a Figure F1 Taken together with these remarks, the properties of the circle make evident a number of useful properties of the sine and cosine. We will illustrate some of them below by tautologies, each of which can be tested by enclosing it in parentheses and applying it to an argument, as illustrated for the first of them: S=: 1&o. 74 Calculus C=: 2&o. x=: 1 2 3 4 5 (1"0 = *:@S + *:@C) x 1 1 1 1 1 S@- = -@S S ODD = S C@- = C Theorem of Pythagoras The sine is odd The cosine is even S @ (2p1&+) = S The period of the sine is twice pi C @ (2p1&+) = C The period of the cosine is twice pi S @ (1p1&-) = S Supplementary angles C @ (1p1&-) = -@C " S @ (0.5p1&-) = C Complementary angles C @ (0.5p1&-) = S " Sum Formulas. A function applied to a sum of arguments may be expressed equivalently in terms of the function applied to the individual arguments; the resulting relation is called a sum formula: a=: 2 3 5 7 b=: 4 3 2 1 +: a+b 12 12 14 16 (+:a)+(+:b) 12 12 14 16 *: a+b 36 36 49 64 (*:a)+(+:a*b)+(*:b) 36 36 49 64 ^ a+b 403.429 403.429 1096.63 2980.96 (^a)*(^b) 403.429 403.429 1096.63 2980.96 Sum formulas may also be expressed as tautologies: +:@+ = +:@[ + +:@] a(+:@+ = +:@[ + +:@]) b 1 1 1 1 *:@+ = *:@[ + +:@* + *:@] ^@+ = ^@[ * ^@] The following sum formulas for the sine and cosine are well-known in trigonometry: Chapter 6 Properties of Functions 75 S@+ = (S@[ * C@]) + (C@[ * S@]) S@- = (S@[ * C@]) - (C@[ * S@]) C@+ = *&C - *&S C@- = *&C + *&S Since a S@+ a is equivalent to (the monadic) S@+:, we may obtain the following identities for the double angle: S@+: = +:@(S * C) C@+: = *:@C - *:@S The theorem of Pythagoras can be used to obtain two further forms of the identity for C@+: : C@+: = -.@+:@*:@S C@+: = <:@+:@*:@C An identity for the sine of the half angle may be obtained as follows: (C@+:@-: = 1"0 - +:@*:@S@-:) (C = 1"0 - +:@*:@S@-:) (+:@*:@S@-: = 1"0 - C) (S@-: =&| (+:@*: I)@(1"0 - C)) (S@-: =&| %:@-:@(1"0 - C)) The last two tautologies above compare magnitudes (=&|) because the square root yields only the positive of the two possible roots. Similarly for the cosine: (C@+:@-: = <:@+:@*:@C@-:) (C = <:@+:@*:@C@-:) (C@-: =&| %:@-:@>:@C) Tautologies may be re-expressed in terms of arguments i and x as illustrated below for S@+ and C@+: i=:0.1 (S i+x) = ((S i)*(C x)) + ((C i)*(S x)) (C i+x) = ((C i)*(C x)) - ((S i)*(S x)) Derivatives. Using the results of Section 2A, we may express the secant slope of the sine function at the points x and i+x as follows: 76 Calculus ((S i+x)-(S x))%i Using the sum formula for the sine we obtain the following equivalent expressions: (((S i)*(C x)) + ((C i)*(S x)) - (S x))%i (((S i)*(C x)) + (S x)*(<:C i))%i (((S i)*(C x))%i) - (S x)*((1-C i)%i) ((C x)*((S i)%i)) - (S x)*((1-C i)%i) To obtain the derivative of S from this secant slope, it will be necessary to obtain limiting values of the ratios (S i)%i and (1-C i)%i. In the unit circle of Figure F2, the magnitude of the area of the sector with arc length (angle in radians) i lies between the areas of the triangles OSC and OST. Moreover, the lengths of the relevant sides are as shown below: OC C i CS S i OS 1 ST (S%C) i S i O C T Figure F2 ST is the tangent to the circle, and its length is called the tangent of i. Its value (S%C) i follows from the ratios in the similar triangles. The values of the cited areas are therefore -:@(S*C) i and -:@i and -:@(S%C) i . Multiplying by 2 and dividing by S i gives the relative sizes C i and i%S i and %C i . Hence, the ratio i%S i lies between C i and %C i, both of which are 1 if i=: 0. Finally, the desired limiting ratio (S i)%i is the reciprocal, also 1. The limiting value of (1-C i)%i is given by the identity +:@*:@S@-: = 1"0-C, for : (1-C i)% i (+: *: S i%2) % i (*: S i%2) % (i%2) Chapter 6 Properties of Functions 77 ((S i%2)%(i%2)) * (S i%2) The limit of the first factor has been shown to be 1, and the limit of S i%2 is 0; hence the limit of (1-C i)%i is their product, that is, 0. Substituting these limiting values in the expression for the secant slope ((C x)*((S i)%i)) - (S x)*((1-C i)%i) we obtain the expression for the derivative of the sine, namely: ((C x)*(1)) - (S x)*(0) C x Similar analysis shows that the derivative of C is -@S, and we see that the relations between S and C and their derivatives are the same as those between sin and cos and their derivatives. Moreover, the values of S and sin and of C and cos agree at the argument 0. F1 Define f=:sin@(+/) = perm@:sc and sc=:1 2&o."0 and perm=: +/ . * and sin=:1&o.and cos=:2&o.; then evaluate f a,b for various scalar values of a and b and comment on the results. [ f is a tautology recognizable as (sin(a+b))=((sin a)*(cos b))+((cos a)*(sin b))] F2 Define other tautologies known from trigonometry in the form used in F1. [ Consider the use of det=: -/ . * ] G. Dot and Cross Products As illustrated in Section 3E, the vector derivative of the function */\ yields a matrix result; the vectors in this matrix lie in a plane, and the vector perpendicular or normal to this plane is an important derivative called the curl of the vector function. We will now present a number of results needed in its definition, including the dot or scalar product and the cross or vector product. The angle between two rays from the origin is defined as the length of arc between their intersections with a circle of unit radius centred at the origin. The angle between two vectors is defined analogously. For example, the angle between the vectors 3 3 and 0 2 is 1r4p1 (that is, one-fourth of pi) radians, or 45 degrees. If the angle between two vectors is 1r2p1 radians (90 degrees), they are said to be perpendicular or normal. Similar notions apply in three dimensions, and a vector r that is normal to each of two vectors p and q is said to be normal to the plane defined by them, in the sense that it is normal to every vector of the form (a*p)+(b*q), where a and b are scalars. The remainder of this section defines the dot and cross products, and illustrates their properties. Proofs of these properties may be found in high-school level texts as, for example, in Sections 6.7, 6.8, and 6.12 of Coleman et al [11]. Again we will leave interpretations to the reader, and will defer comment on them to exercises. The dot product may be defined by +/@* or, somewhat more generally, by +/ . * . Thus: a=: 1 2 3 +/a*b 16 [ b=: 4 3 2 78 Calculus dot=: +/ . * a dot b 16 dot~ a 14 L=: %:@(dot~)"1 a,:b 1 2 3 4 3 2 L a,:b 3.74166 5.38516 */ L a,:b 20.1494 (a dot b) % */L a,:b 0.794067 cos=:dot % */@(L@,:) a cos b 0.794067 0 0 1 cos 0 1 0 0 0 0 1 cos 0 1 1 0.707107 2 o. 1r4p1 0.707107 The product of the cosine of the angle between a and b with the product of their lengths Squared length of a Length function Product of lengths Re-definition of cos (not of 2&o.) Perpendicular or normal vectors Cosine of 45 degrees The following expressions lead to a definition of the cross product and to a definition of the sine of the angle between two vectors: Rotation of vectors rot=: |."0 1 1 _1 rot a 2 3 1 3 1 2 (1 _1 rot a) * (_1 1 rot b) 4 12 3 9 2 8 ]c=:-/(1 _1 rot a)*(_1 1 rot b) Cross product _5 10 _5 a dot c 0 b dot c 0 The vectors are each normal to their cross product Chapter 6 Properties of Functions 79 cross=: -/@(1 _1&rot@[ * _1 1&rot@]) a cross b _5 10 _5 (a,:b) dot a cross b 0 0 b cross a 5 _10 5 L a cross b 12.2474 The cross product is not commutative The product of the sine of the angle between the vectors with the product of their lengths (L a cross b) % */ L a,:b The sine of the angle 0.607831 sin=: L@cross % */@(L@,:) The sine function a sin b 0.607831 a +/@:*:@(sin , cos) b 1 The following expressions suggest interpretations of the dot and cross products that will be pursued in exercises: c=: 4 1 2 c dot a cross b _20 m=: c,a,:b m 4 1 2 1 2 3 4 3 2 -/ . * m _20 G1 Experiment with the dot and cross products, beginning with vectors in 2-space (that is with two elements) for which the results are obvious. Continue with other vectors in 2-space and in 3-space. Sketch the rays defined by the vectors, showing their intersection with the unit circle (or sphere). H. Normals We now use the function e introduced in Section 3E to define a function norm that is a generalization of the cross product; it applies to arrays other than vectors, and produces a result that is normal to its argument. Moreover, when applied to skew arrays of odd order (having an odd number of items) it is self-inverse. Thus: indices=:{@(] # <@i.) e=:C.!.2@>@indices Result is called an "e-system" by McConnell [4] A skew matrix ]skm=: *: .: |: i. 3 3 0 _4 _16 4 0 _12 16 12 0 ]v=: -: +/ +/ skm * e #skm _12 16 _4 80 Calculus v +/ . * skm 0 0 0 Test of orthogonality Inverse transformation +/ v * e #v 0 _4 _16 4 0 _12 16 12 0 norm=: +/^:(]`(#@$)`(* e@#)) % !@(#-#@$) ]m=: (a=: 1 2 3) */ (b=: 4 3 2) 4 3 2 8 6 4 12 9 6 n=: norm ^: 0 n m 4 3 2 8 6 4 12 9 6 1 n m _5 10 _5 a cross b _5 10 _5 2 n m 0 _2.5 _5 2.5 0 _2.5 5 2.5 0 3 n m _5 10 _5 1 n a 0 1.5 _1 _1.5 0 0.5 1 _0.5 0 2 n a 1 2 3 mp=: +/ . * a mp 1 n a*/b 0 b mp 1 n a*/b 0 x=: 1 2 1 n x _2 1 x mp 1 n x 0 2 n x _1 _2 An adverb for powers of norm Skew part of m Self-inverse for odd dimension For even orders 2 n is inverse only up to sign change Chapter 6 Properties of Functions 81 Alternative definition of cross product 4 n x 1 2 2 n y=: 1 2 3 4 _1 _2 _3 _4 4 n y 1 2 3 4 2 n 1 2 3 4 5 1 2 3 4 5 cr=: norm@(*/) a cr b _5 10 _5 a cross b _5 10 _5 H1 Experiment with the expressions of this section. H2 Using the display of e 3 shown in Section 3E, and using a0, a1, and a2 to denote the elements of a vector a in 3-space, show in detail that norm(*/) is indeed an alternative definition of the cross product. H3 Show in detail that +/@,@(e@# * *//) is an alternative definition of the determinant. 83 Chapter 7 Interpretations and Applications A. Introduction As remarked in Section 3A, various interpretations of a particular function definition are possible (as in vol=: */ and cost=: */), and any one of them may be either helpful or confusing, depending upon the background of the reader. A helpful interpretation may also be misleading, either by suggesting too little or too much. We will illustrate this point by three examples. Example 1. The sentences: S=: 2 : '%&x. @ (] -&y. -&x.)' f=: ^ h=: 1e_8 sf=: h S f sf x=: 1 2.71828 define and use the function sf. Moreover, sf can be helpfully interpreted as the secant slope of the exponential with spacing h, and (because h is small) as an approximation to the tangent slope of the exponential. However, for the case of the discontinuous integer part function <. this interpretation would be misleading because its "tangent slope" at the point 1 is infinite. Thus: h S <. x 1e8 Example 2. If the spacing h is complex, the function h S ^ has the behaviour expected of a secant slope: ^ y=: 2j3 _7.31511j1.04274 h=: 1e_6j1e_8 h S ^ y 84 Calculus _7.31511j1.04274 (r=: 1e_6j0) S ^ y _7.31511j1.04274 (i=: 0j1e_8) S ^ y _7.31511j1.04274 Again the interpretation of the function h S f as an approximation to the tangent slope is valid. However, the (continuous) conjugate function + shows unusual behaviour: h S + y 0.9998j_0.019998 r S + y i S + y 1 _1 The problem arises because the conjugate is not an analytic function. A clear and simple discussion of this matter may be found in Churchill [12]. Example 3. Section 2D interprets the integral of a function f as a function that gives the area under the graph of f from a point a (that is, the point a,f a on the graph of f) to a second point b. This interpretation is helpful for real-valued functions, but how should we visualize the area under a function that gives a complex result? It is, of course, possible to interpret the integral as a complex result whose real and imaginary parts are the areas under the real and imaginary parts of f, respectively. However, the beginning and end points may themselves be complex, and although there is a clearly defined "path" through real numbers between a pair of real numbers a and b, there are an infinity of different paths through complex numbers from complex a to complex b. This observation leads to the more difficult, but highly useful, notion of integration along a prescribed path (called a line or contour integral), a notion not hinted at by the interpretation of integration as the area under a curve. B. Applications and Word Problems What we have treated as interpretations of functions may also be viewed as applications of math, or as word problems in math. For example, if cos=:2&o. and sin=:1&o., then the function: f=:0.1&path=:(cos,sin)@*"0 may be interpreted as the βPosition of a car ... moving on a circular path at an angular velocity of 0.1 radians per secondβ. Conversely, the expression in quotes could be considered as an application of the circular functions, and could be posed as a word problem requiring as its solution a definition of the function f. Similarly, the phrase f D.1 may be interpreted as the velocity of the car whose position is prescribed by f. Because the phrase involved a derivative, the corresponding word problem would be considered as an application of the calculus. Chapter 7 Interpretations And Applications 85 Just as a readerβs background will determine whether a given interpretation is helpful or harmful in grasping new concepts in the calculus, so will it determine the utility of word problems. We will limit our treatment of interpretations and applications to a few examples, and encourage the reader to choose further applications from any field of interest, or from other calculus texts. C. Extrema and Inflection Points If f=: (c=: 0 1 2.5 _2 0.25)&p., then p. is a polynomial in terms of coefficients, and f is a specific polynomial whose (tightly) formatted results: (fmt=: 5.1&":) f x=: 0.1*>:i.6 10 0.1 0.3 0.5 0.7 0.9 1.1 1.3 1.5 1.6 1.8 1.8 1.9 1.8 1.8 1.6 1.4 1.2 0.9 0.5 0.0 _0.5 _1.1 _1.8 _2.6 _3.4 _4.2 _5.2 _6.1 _7.2 _8.2 _9.4_10.5_11.7_12.9_14.1_15.3_16.5_17.7_18.9_20.0 _21.1_22.1_23.0_23.9_24.6_25.2_25.7_26.1_26.3_26.2 _26.0_25.6_25.0_24.1_22.9_21.4_19.6_17.4_14.9_12.0 suggest that it has a (local) maximum (of 1.9) near 1.2 and a minimum near 4.9. Moreover, a graph of the function over the interval from 0 to 4 shows their location more precisely. A graph of the derivative f d.1 over the same interval illustrates the obvious fact that the derivative is zero at an extremum (minimum or maximum): fmt f d.1 x 1.4 1.8 2.0 2.1 2.1 2.1 1.9 1.7 1.4 1.0 0.6 0.1 _0.4 _1.0 _1.6 _2.3 _2.9 _3.6 _4.3 _5.0 _5.7 _6.4 _7.1 _7.7 _8.4 _9.0 _9.6_10.1_10.6_11.0 _11.4_11.7_11.9_12.1_12.1_12.1_12.0_11.8_11.4_11.0 _10.4 _9.8 _8.9 _8.0 _6.9 _5.6 _4.2 _2.6 _0.9 1.0 3.1 5.4 7.8 10.5 13.4 16.5 19.8 23.3 27.0 31.0 We may therefore determine the location of an extremum by determining the roots (arguments where the function value is zero) of the derivative function. Since we are concerned only with real roots we will define a simple adverb for determining the value of a root in a specified interval, where the function values at the ends of the interval must differ in sign. The method used is sometimes called the bisection method; the interval is repeatedly halved in length by using the midpoint (that is, the mean) together with that endpoint for which the function value differs in sign. Thus: m=: +/ % # bis=: 1 : '2&{.@(m , ] #~ m ~:&(*@x.) ])' f y=: 1 4 1.75 _20 Interval that bounds a root of f f bis y 2.5 1 One step of the bisection method 86 Calculus f f bis y _3.35938 1.75 f bis^:0 1 2 3 4 y 1 4 2.5 1 1.75 2.5 2.125 1.75 1.9375 2.125 f bis^:_ y 2 2 Resulting interval still bounds a root Successive bisections Limit of bisection ]root=: m f bis^:_ y 2 Root is mean of final interval f root _3.55271e_14 A root of the derivative of f identifies an extremum of f: f d.1 z=: 0.5 1.5 2.125 _1.625 ]droot=: m f d.1 bis^:_ z 1.21718 f d.1 droot _9.52571e_14 When the derivative of f is increasing, the graph of f bends upward; when the derivative is decreasing, it bends downward. At a maximum (or minimum) point of the derivative, the graph of f therefore changes its curvature, and the graph crosses its own tangent. Such a point is called a point of inflection. Since an extremum of the derivative occurs at a zero of its derivative, an inflection point of f occurs at a zero of f d.2 . Thus: fmt f d.2 x 3.8 2.7 1.7 0.7 _0.3 _1.1 _1.9 _2.7 _3.4 _4.0 _4.6 _5.1 _5.5 _5.9 _6.3 _6.5 _6.7 _6.9 _7.0 _7.0 _7.0 _6.9 _6.7 _6.5 _6.2 _5.9 _5.5 _5.1 _4.6 _4.0 _3.4 _2.7 _1.9 _1.1 _0.2 0.7 1.7 2.7 3.8 5.0 6.2 7.5 8.9 10.3 11.8 13.3 14.9 16.5 18.2 20.0 21.8 23.7 25.7 27.7 29.8 31.9 34.1 36.3 38.6 41.0 * f (d.2) 0 1 1 _1 ]infl=: m f d.2 bis^:_ (0 1) 0.472475 f d.2 infl _6.83897e_14 A graph of f will show that the curve crosses its tangent at the point infl. Chapter 7 Interpretations And Applications 87 C1 Test the assertion that droot is a local minimum of f . [ f droot + _0.0001 0 0.0001 It is not a minimum, but a maximum. ] C2 What is the purpose of 2&{.@ in the definition of bis? [ Remove the phrase and try f bis 1 3 ] C3 For various coefficients c, make tables or graphs of the derivative c&p. D to determine intervals bounding roots, and use them with bis to determine extrema of the polynomial c&p. D. Newton's Method Although the bisection method is certain to converge to a root when applied to an interval for which the function values at the endpoints differ in sign, this convergence is normally very slow. The derivative of the function can be used in a method that normally converges much faster, although convergence is assured only if the initial guess is "sufficiently near" the root. The function g=: (]-1:)*(]-2:) has roots at 1 and 2, as shown by its graph: plot y;g y=: 1r20*i.60 Draw a tangent at the point x,g x=: 3 intersecting the axis at a point nx,0 and note that nx is a much better approximation to the nearby root at 2 than is x. The length x-nx is the run that produces the rise g x with the slope g d.1 x. As a consequence, nx=:x-(g x) % (g d.1 x) is a better approximation to the root at 2. Thus: x=:3 g=: (]-1:)*(]-2:) g x 2 ]nx=:x-(g x) % (g d.1 x) 2.33333 g nx 0.444444 A root can be determined by repeated application of this process, using an adverb N as follows: N=:(1 : '] - x. % x. d.1') (^:_) f=: (c=: 0 1 2.5 _2 0.25)&p. Used in Section C 88 Calculus f N 6 6.31662 f f N 6 7.01286e_16 Test if f N 6 is a root of f f N x=: i. 7 0 _0.316625 2 2 2 6.31662 6.31662 Different starts converge to different roots f f N x 0 0 0 0 0 7.01286e_16 7.01286e_16 This use of the derivative to find a root is called Newton's method. Although it converges rapidly near a single root, the method may not converge to the root nearest the initial guess, and may not converge at all. The initial guess droot determined in the preceding section as a maximum point of f illustrates the matter; the derivative at the point is approximately 0, and division by it yields a very large value as the next guess: f N droot 6.31662 Since the derivative of a polynomial function c&p. can be computed directly using the coefficients }.c*i.#c, it is possible to define a version of Newton's method that does not make explicit use of the derivative adverb. Thus: dc=: 1 : '}.@(] * i.@#)@(x."_) p. ]' ("0) NP=: 1 : '] - x.&p. % x. dc' ("0)(^:_) c NP x 0 _0.316625 2 2 2 6.31662 6.31662 c&p. N x 0 _0.316625 2 2 2 6.31662 6.31662 The following utilities are convenient for experimenting with polynomials and their roots: pir=:<@[ p. ] _1 _1 _1 pir x 1 8 27 64 125 216 343 1 3 3 1 p. x 1 8 27 64 125 216 343 pp=: +//.@(*/) 1 2 1 pp 1 3 3 1 1 5 10 10 5 1 (1 2 1 pp 1 3 3 1) p. x 1 32 243 1024 3125 7776 16807 (1 2 1 p. x) * (1 3 3 1 p. x) 1 32 243 1024 3125 7776 16807 Polynomial in terms of roots Polynomial product cfr=: pp/@(- ,. 1:) cfr _1 _1 _1 Coefficients from roots Chapter 7 Interpretations And Applications 89 1 3 3 1 D1 Use Newton's method to determine the roots for which the bisection method was used in Section C. E. Kerner's Method Kerner's method for the roots of a polynomial is a generalization of Newton's method; at each step it treats an n-element list as an approximation to all of the <:#c roots of the polynomial c&p., and produces an "improved" approximation. We will first define and illustrate the use of an adverb K such that c K b yields the <:#c (or #b) roots of the polynomial with coefficients c: k=: 1 : ']-x.&p. % (<0 1)&|:@((1&(*/\."1))@(-/~))' K=: k (^:_) b=: 1 2 3 4 ]c=: cfr b+0.5 59.0625 _93 51.5 _12 1 Coefficients of polynomial with roots at b+0.5 c k b 2.09375 2.46875 3.28125 4.15625 Single step of Kerner c K b 1.5 2.5 3.5 4.5 c k ^: (i.7) b 1 2 3 4 2.09375 2.46875 3.28125 4.15625 1.20508 2.59209 3.7207 4.48213 1.45763 2.53321 3.50503 4.50413 1.49854 2.50154 3.49996 4.49997 1.5 2.5 3.5 4.5 1.5 2.5 3.5 4.5 ]rb=: 4?.20 17 4 9 7 c K rb 1.5 3.5 4.5 2.5 Limit of Kerner Roots of c&p. Six steps of Kerner Random starting value The adverb K applies only to a normalized coefficient c, that is, one whose last non-zero element (for the highest order term) is 1. Thus: norm=:(] % {:)@(>./\.@:|@:* # ]) norm 1 2 0 3 4 0 0 0.25 0.5 0 0.75 1 The polynomials c&p. and (norm c)&p. have the same roots, and norm c is a suitable argument to the adverb K. Kerner's method applies to polynomials with complex roots; however it will not converge to complex roots if the beginning guess is completely real: begin provides a suitable beginning argument: 90 Calculus (begin=: %:@-@i.@<:@#) 1 3 3 1 0 0j1 0j1.41421 For example, the coefficients d=: cfr 1 2 2j3 4 2j_4 define a polynomial with two complex roots. Thus: d=: cfr 1 2 2j3 4 2j_4 ]roots=: (norm d) K begin d 4 2j3 2j_4 2 1 /:~roots 1 2j3 2j_4 2 4 Sorted roots The definition of the adverb k (for a single step of Kerner) can be revised to give an alternative equivalent adverb by replacing the division (%) by matrix division (%.), and removing the phrase (<0 1)&|:@ that extracts the diagonal of the matrix produced by the subsequent phrase. Thus: ak=: 1 : ']-x.&p. %. ((1&(*/\."1))@(-/~))' c ak b 2.09375 2.46875 3.28125 4.15625 In this form it is clear that the vector of residuals produced by x.&p. (the values of the function applied to the putative roots, which must all be reduced to zero) is divided by the matrix produced by the expression to the right of %. . This expression produces the vector derivative with respect to each of the approximate roots; like the analogous case of the direct calculation of the derivative in the adverb NP it is a direct calculation of the derivative without explicit use of the vector derivative adverb VD=: ("1) (D. 1). These matters are left for exploration by the reader. E1 Find all roots of the functions used in Section C. E2 Define some polynomials that have complex roots, and use Kerner's method to find all roots. F. Determinant and Permanent The function -/ . * yields the determinant of a square matrix argument. For example: det=: -/ . * ]m=: >3 1 4;2 7 8;5 1 6 3 1 4 2 7 8 5 1 6 det m _2 The determinant is a function of rank 2 that produces a rank 0 result; its derivative is therefore a rank 2 function that produces a rank 2 result. For example: MD=: ("2) (D.1) Chapter 7 Interpretations And Applications 91 det MD m 34 28 _33 _2 _2 2 _20 _16 19 This result can be checked by examining the evaluation of the determinant as the alternating sum of the elements of any one column, each weighted by the determinant of its respective complementary minor, the matrix occupying the remaining rows and columns; the derivative with respect to any given element is its weighting factor. For example, the complementary minor of the leading element of m is the matrix m00=: 7 8,:1 6, whose determinant is 34, agreeing with the leading element of the derivative. Corresponding results can be obtained for the permanent, defined by the function +/ .*. For example: (per=: +/ . *) m 350 per MD m 50 52 37 10 38 8 36 32 23 F1 Read the following sentences and try to state the meanings of the functions defined and the exact results they produce. Then enter the expressions (and any related expressions that you might find helpful) and again try to state their meanings and results. alph=: 4 4$ 'abcdefghijklmnop' m=: i. 4 4 box=: <"2 minors=: 1&(|:\.)"2 ^:2 box minors m box minors alph box^:2 minors^:2 alph [The function minors produces the complementary minors of its argument; the complementary minor of any element of a matrix is the matrix obtained by deleting the row and column in which the element lies.] F2 Enter and then comment upon the following sentences: sqm=: *:m det minors sqm det D.1 sqm (det D.1 sqm) % (det minors sqm) ((+/ .*D.1)%+/ .*@minors)sqm 92 Calculus G. Matrix Inverse The matrix inverse is a rank 2 function that produces a rank 2 result; its derivative is therefore a rank 2 function that produces a rank 4 result. For example: m=: >3 1 4;2 7 8;5 1 6 MD=: ("2) (D. 1) <"2 (7.1) ": (miv=: %.) MD m +---------------------+---------------------+---------------------+ | _289.0 _238.0 280.5| 17.0 17.0 _17.0| 170.0 136.0 _161.5| | 17.0 14.0 _16.5| _1.0 _1.0 1.0| _10.0 _8.0 9.5| | 170.0 140.0 _165.0| _10.0 _10.0 10.0| _100.0 _80.0 95.0| +---------------------+---------------------+---------------------+ | _238.0 _196.0 231.0| 14.0 14.0 _14.0| 140.0 112.0 _133.0| | 17.0 14.0 _16.5| _1.0 _1.0 1.0| _10.0 _8.0 9.5| | 136.0 112.0 _132.0| _8.0 _8.0 8.0| _80.0 _64.0 76.0| +---------------------+---------------------+---------------------+ | 280.5 231.0 _272.2| _16.5 _16.5 16.5| _165.0 _132.0 156.7| | _17.0 _14.0 16.5| 1.0 1.0 _1.0| 10.0 8.0 _9.5| | _161.5 _133.0 156.8| 9.5 9.5 _9.5| 95.0 76.0 _90.3| +---------------------+---------------------+---------------------+ H. Linear Functions and Operators As discussed in Section 1K, a linear function distributes over addition, and any rank 1 linear function can be represented in the form mp&m"1, where m is a matrix, and mp is the matrix product. For example: r=: |."1 a=: 3 1 4 [ b=: 7 5 3 r a 4 1 3 r b 3 5 7 (r a)+(r b) 7 6 10 r (a+b) 7 6 10 mp=: +/ . * ]m=: i. 3 3 0 1 2 3 4 5 6 7 8 L=: m&mp L a 9 33 57 L b 11 56 101 L a+b 20 89 158 Rank 1 reversal Reversal is linear. A linear function VD=: ("1) (D. 1) L VD a The derivative of a linear Chapter 7 Interpretations And Applications 93 function yields the matrix that represents it. An identity matrix A linear function applied to the identity matrix also yields the matrix that represents it. The matrix that represents the linear function reverse 0 1 2 3 4 5 6 7 8 =/~a 1 0 0 0 1 0 0 0 1 L =/~a 0 1 2 3 4 5 6 7 8 r VD a 0 0 1 0 1 0 1 0 0 r =/~a 0 0 1 0 1 0 1 0 0 perm=: 2&A. A permutation is linear. perm a 1 3 4 perm VD a 0 1 0 1 0 0 0 0 1 A function such as (^&0 1 2)"0 can be considered as a family of component functions. For example: F=: (^&0 1 2)"0 F 3 1 3 9 F y=: 3 4 5 1 3 9 1 4 16 1 5 25 The function L@F provides weighted sums or linear combinations of the members of the family F, and the adverb L@ is called a linear operator. Thus: L @ F y 21 60 99 36 99 162 55 148 241 LO=: L@ F LO y The linear function F applied to the results of the family of functions F A linear operator 94 Calculus 21 60 99 36 99 162 55 148 241 C=: 2&o.@(*&0 1 2)"0 C y 1 _0.989992 0.96017 1 _0.653644 _0.1455 1 0.283662 _0.839072 Family of cosines (harmonics) C LO y 0.930348 3.84088 6.75141 _0.944644 _0.342075 0.260494 _1.39448 _0.0607089 1.27306 A Fourier series H1 Enter and experiment with the expressions of this section. I. Linear Differential Equations If f=: 2&o. and: F=: (f d.0)`(f d.1)`(f d.2) `:0 "0 L=: mp&c=: 1 0 1 then F is a family of derivatives of f. If the function L@F is identically zero, then the function f is said to be a solution of the linear differential equation defined by the linear function L. In the present example, f was chosen to be such a solution: L@F y=: 0.1*i.4 0 0 0 0 The solution of such a differential equation is not necessarily unique; in the present instance the sine function is also a solution: f=: 1&o. L@F y=: 0.1*i.4 0 0 0 0 In general, the basic solutions of a linear differential equation defined by the linear function L=: mp&c are f=: ^@(*&sr), where sr is any one root of the polynomial c&p.. In the present instance: f=: s=: ^@(*&0j1) L@F y 0 0 0 0 c=: 1 0 1 c K begin c 0j_1 0j1 f=: t=: ^@(*&0j_1) L@F y 0 0 0 0 Roots of c&p. using Kernerβs method Chapter 7 Interpretations And Applications 95 Moreover, any linear combination of the basic solutions s and t is also a solution. In particular, the following are solutions: u=: (s+t)%2"0 The cosine function 2&o. v=: (s-t)%0j2"0 The sine function 1&o. Since u is equivalent to the cosine function, this agrees with the solution f used at the outset. I1 Enter the expressions of this section, and experiment with similar differential equations. J. Differential Geometry The differential geometry of curves and surfaces, as developed by Eisenhart in his book of that title [13], provides interpretations of the vector calculus that should prove understandable to anyone with an elementary knowledge of coordinate geometry. We will provide a glimpse of his development, beginning with a function which Eisenhart calls a circular helix. The following defines a circular helix in terms of an argument in degrees, with a rise of 4 units per revolution: CH=:(1&o.@(%&180p_1),2&o.@(%&180p_1),*&4r360)"0 CH 0 1 90 180 360 0 1 0 0.0174524 0.999848 0.0111111 1 0 1 0 _1 2 _2.44921e_16 1 4 D=: ("0) (D. 1) x=:0 1 2 3 4 CH D x 0.0174533 0 0.0111111 0.0174506 _0.000304602 0.0111111 0.0174427 _0.000609111 0.0111111 0.0174294 _0.000913435 0.0111111 0.0174108 _0.00121748 0.0111111 CH D D x 0 0 0 _5.3163e_6 _0.000304571 0 _1.0631e_5 _0.000304432 0 _1.59424e_5 _0.0003042 0 _2.1249e_5 _0.000303875 0 The derivatives produced by CH D in the expression above are the directions of the tangents to the helix; their derivatives produced by CH D D are the directions of the binormals. The binormal is perpendicular to the tangent, and indeed to the osculating (kissing) plane that touches the helix at the point given by CH. 96 Calculus These matters may be made more concrete by drawing the helix on a mailing tube or other circular cylinder. An accurate rendering of a helix can be made by drawing a sloping straight line on a sheet of paper and rolling it on the tube. A drawing to scale can be made by marking the point of overlap on the paper, unrolling it, and drawing the straight line with a rise of 4 units and a run of the length of the circumference. Finally, the use of a sheet of transparent plastic will make visible successive laps of the helix. Then proceed as follows: 1. Use a nail or knitting needle to approximate the tangent at one of the points where its directions have been computed, and compare with the computed results. 2. Puncture the tube to hold the needle in the direction of the binormal, and again compare with the computed results. 3. Puncture a thin sheet of flat cardboard and hang it on the binormal needle to approximate the osculating plane. 4. Hold a third needle in the direction of the principal normal, which lies in the osculating plane perpendicular to the tangent. To compute the directions of the principal normal we must determine a vector perpendicular to two other vectors. For this we can use the skew array used in Section 6I, or the following simpler vector product function: vp=: (1&|.@[ * _1&|.@]) - (_1&|.@[ * 1&|.@]) a=: 1 2 3 [ b=: 7 5 2 ]q=: a vp b _11 19 _9 a +/ . * q 0 b +/ . * q 0 Although we used degree arguments for the function CH we could have used radians, and it is clear that the choice of the argument to describe a curve is rather arbitrary. As Eisenhart points out, it is possible to choose an argument that is intrinsic to the curve, namely the length along its path. In the case of the helix defined by CH, it is easy to determine the relation between the path length and the degree argument. From the foregoing discussion of the paper tube model it is clear that the length of the helix corresponding to 360 degrees is the length of the hypotenuse of the triangle with sides 360 and 4. Consequently the definition of a function dfl to give degrees from length is given by: dfl=: %&((%: +/ *: 4 360) % 360) and the function CH@dfl defines the helix in terms of its own length. It is possible to modify the definition of the function CH to produce more complex curves, all of which can be modelled by a paper tube. For example: 1. Replace the constant multiple function for the last component by other functions, such as the square root, square, and exponential. 2. Multiply the functions for the first two elements by constants a and b respectively, to produce a helix on an elliptical cylinder. This can be Chapter 7 Interpretations And Applications 97 modelled by removing the cardboard core from the cylinder and flattening it somewhat to form an approximate ellipse. K. Approximate Integrals Section M of Chapter 2 developed a method for obtaining the integral or anti-derivative of a polynomial, and Section N outlined a method for approximating the integral of any function by summing the function values over a grid of points to approximate the area under the graph of the function. Better approximations to the integral can be obtained by weighting the function values, leading to methods known by names such as Simpson's Rule. We will here develop methods for producing these weights, and use them in the definition of an adverb (to be called I) such that f I x yields the area under the graph of f from 0 to x. The fact that the derivative of f I equals f can be seen in Figure C1; since the difference (f I x+h)-(f I x)is approximately the area of the rectangle with base h and altitude f x, the secant slope of the function f I is approximately f. Moreover, the approximation approaches equality for small h. f Figure C1 x x+h Figure C1 can also be used to suggest a way of approximating the function AREA=: f I; if the area under the curve is broken into n rectangles each of width x%n, then the area is approximately the sum of the areas of the rectangles with the common base h and the altitudes f h*i.n. For example: h=: y % n=: 10 [ y=: 2 cube=: ^&3 cube h*i.n 0 0.008 0.064 0.216 0.512 1 1.728 2.744 4.096 5.832 +/h*cube h*i.n (4: %~ ^&4) y 98 Calculus 3.24 4 The approximation can be improved by taking a larger number of points, but it can also be improved by using the areas of the trapezoids of altitudes f h*k and f h*k+1 (and including the point h*n). Since the area of each trapezoid is its base times the average of its altitudes, and since each altitude other than the first and last enter into two trapezoids, this is equivalent to multiplying the altitudes by the weights w=: 0.5,(1 #~ n- 1),0.5 . Thus: ]w=: 0.5,(1 #~ n-1),0.5 0.5 1 1 1 1 1 1 1 1 1 0.5 +/h*w*cube h*i. n+1 4.04 The trapezoids provide, in effect, linear approximations to the function between grid points; much better approximations to the integral can be obtained by using groups of 1+2*k points, each group being fitted by a polynomial of degree 2*k. For example, the case k=: 1 provides fitting by a polynomial of degree 2 (a parabola) and a consequent weighting of 3%~1 4 1 for the three points. If the function to be fitted is itself a polynomial of degree two or less, the integration produced is exact. For example: w=: 3%~1 4 1 h=: (x=: 5)%(n=:2) ]grid=: h*i. n+1 0 2.5 5 f=: ^&2 w*f grid 0 8.33333 8.33333 +/h*w* f grid 41.6667 +/h*w* ^&4 grid 651.042 Exact integral of ^&2 Exact result is 625 Better approximations are given by several groups of three points, resulting in weights of the form 3%~1 4 2 4 2 4 2 4 1. For example, using g groups of 1+2*k points each: n=: (g=: 4) * 2 * (k=: 1) ]h=: n %~ x=: 5 0.625 ]grid=: h*i. n+1 0 0.625 1.25 1.875 2.5 3.125 3.75 4.375 5 1,(4 2 $~ <: 2*g),1 1 4 2 4 2 4 2 4 1 w=: 3%~ 1,(4 2 $~ <: 2*g),1 +/h*w*^&2 grid 41.6667 625.102 +/h*w*^&4 grid Chapter 7 Interpretations And Applications 99 This case of fitting by parabolas (k=:1) is commonly used for approximate integration, and is called Simpson's Rule. The weights 3%~1 4 1 used in Simpson's rule will now be derived by a general method that applies equally for higher values of k, that is, for any odd number of points. Elementary algebra can be used to determine the coefficients c of a polynomial of degree 2 that passes through any three points on the graph of a function f. The integral of this polynomial (that is, (0,c%1 2 3)&p.) can be used to determine the exact area under the parabola, and therefore the approximate area under the graph of f. The appropriate weights are given by the function W, whose definition is presented below, after some examples of its use: W 1 0.333333 1.33333 0.333333 W 2 0.311111 1.42222 0.533333 1.42222 0.311111 3*W 1 1 4 1 45*W 2 14 64 24 64 14 The derivation of the definition of W is sketched below: vm=: ^~/~@i=: i.@>:@+: vm 2 1 1 1 1 1 0 1 2 3 4 0 1 4 9 16 0 1 8 27 64 0 1 16 81 256 (Transposed) Vandermonde of i. k (for k=: 1+2* n) %. vm 2 1 _2.08333 1.45833 _0.416667 0.0416667 0 4 _4.33333 1.5 _0.166667 0 _3 4.75 _2 0.25 0 1.33333 _2.33333 1.16667 _0.166667 0 _0.25 0.458333 _0.25 0.0416667 Inverse of Vandermonde integ=:(0:,.%.@(^~/~)%"1>:)@i integ 2 0 1 _1.04167 0.486111 _0.104167 0.00833333 0 0 2 _1.44444 0.375 _0.0333333 0 0 _1.5 1.58333 _0.5 0.05 0 0 0.666667 _0.777778 0.291667 _0.0333333 0 0 _0.125 0.152778 _0.0625 0.00833333 Rows are integrals of rows of inverse Vm W=: integ p. +: 3*W 1 1 4 1 The results produced by W may be compared with those derived in more conventional notation, as in Hildebrand [7], p 60 ff. Finally, we apply the adverb f. to fix the Polynomial at double argument 14 64 24 64 14 45*W 2 100 Calculus definition of W (by replacing each function used in its definition by itsdefinition in terms of primitives: W f. (0: ,. %.@(^~/~) %"1 >:)@(i.@>:@+:) p. +: W=:(0: ,. %.@(^~/~) %"1 >:)@(i.@>:@+:) p. +: W 1 0.333333 1.33333 0.333333 A result of the function x: is said to be in extended precision, because a function applied to its result will be computed in extended precision, giving its results as rationals (as in 1r3 for the result of 1%3). Thus: Factorial 20 to complete precision ! x:20 2432902008176640000 1 2 3 4 5 6 % x:3 1r3 2r3 1 4r3 5r3 2 W x:1 1r3 4r3 1r3 3*W x:1 1 4 1 W x:3 41r140 54r35 27r140 68r35 27r140 54r35 41r140 140*W x:3 41 216 27 272 27 216 41 We now define a function EW for extended weights, such that g EW k yields the weights for g groups of fits for 1+2*k points: ew=:;@(#<) +/;.1~ 0: ~: #@] | 1: >. i.@(*#) EW=: ew W 2 EW x:1 1r3 4r3 2r3 4r3 1r3 3*2 EW x:1 1 4 2 4 1 45*2 EW x:2 14 64 24 64 28 64 24 64 14 Finally, we define a conjunction ai such that w ai f x gives the approximate integral of the function f to the point x, using the weights w: ai=: 2 : '+/@(x.&space * x.&[ * y.@(x.&grid))"0' grid=: space * i.@#@[ space=: ] % <:@#@[ 3*w=: 1 EW 1 1 4 1 w ai *: x=: 1 2 3 4 0.333333 2.66667 9 21.3333 Weights for Simpson's rule (gives exact results for the square function) (x^3)%3 Chapter 7 Interpretations And Applications 101 0.333333 2.66667 9 21.3333 (1 EW 2) ai (^&4) x 0.2 6.4 48.6 204.8 Weights give exact results for integral of fourth power (x^5)%5 0.2 6.4 48.6 204.8 (cir=:0&o.)0 0.5 1 1 0.866025 0 (2 EW 2) ai cir 1 0.780924 0&o. is %:@(1"0-*:) and cir 0.866025 is the altitude of a unit circle Approximation to area under cir (area of quadrant) 4 * (2 EW 2) ai cir 1 3.1237 Approximation to pi 4*(20 EW 3) ai (0&o.) 1 3.14132 o.1 3.14159 For use in exercises and in the treatment of interpretations in Section L, we will define the adverb I in terms of the weights 4 EW 4, that is, four groups of a polynomial approximation of order eight: I=: (4 EW 4) ai ^&9 I x=: 1 2 3 4 0.0999966 102.397 5904.7 104854 (x^10) % 10 0.1 102.4 5904.9 104858 ^&9 d._1 x 0.1 102.4 5904.9 104858 K1 Use the integral adverb I to determine the area under the square root function up to various points. K2 Since the graphs of the square and the square root intersect at 0 and 1, they enclose an area. Determine its size. [ (%:I-*:I) 1 or (%:-*:)I 1 ] K3 Experiment with the expression (f - f I D) x for various functions f and arguments x. L. Areas and Volumes The integral of a function may be interpreted as the area under its graph. To approximate integrals, we will use the adverb I defined in the preceding section. For example: (0&o.) I 1 Approximate area of quadrant of circle 102 Calculus 0.784908 4 * (0&o.) I 1 3.13963 Approximation to pi *: I x=: 1 2 3 4 0.333317 2.66654 8.99956 21.3323 (^&3 % 3"0) x 0.333333 2.66667 9 21.3333 The foregoing integral of the square function can be interpreted as the area under its graph. Alternatively, it can be interpreted as the volume of a three-dimensional solid as illustrated in Figure L1; that is, as the volume of a pyramid. In particular, the equivalent function ^&3 % 3"0 is a well-known expression for the volume of a pyramid. Similarly for a function that defines the area of a circle in terms of its radius: ca=: o.@*:@] " 0 ca x 3.14159 12.5664 28.2743 50.2655 ca I x 1.04715 8.37717 28.273 67.0174 h*x x Figure L1 By drawing a figure analogous to Figure L1, it may be seen that the cone whose volume is determined by ca I can be generated by revolving the 45-degree line through the origin about the axis. The volume is therefore called a volume of revolution. Functions other than ] (the 45-degree line) can be used to generate volumes of revolution. For example: cade=: ca@^@- cade x 0.425168 0.0575403 0.00778723 0.00105389 Area of circle whose radius is the decaying exponential cade I x 1.3583 1.5423 1.56746 1.57123 Volume of revolution of the decaying exponential Chapter 7 Interpretations And Applications 103 Because the expression f I y applies the function f to points ranging from 0 to y, the area approximated is the area over the same interval from 0 to y. The area under f from a to b can be determined as a simple difference. For example: f=: ^&3 f I b=: 4 63.9965 f I a=: 2 3.99978 (f I b) -(f I a) 59.9967 -/f I b,a 59.9967 However, this approach will not work for a function such as %, whose value at 0 is infinite. In such a case we may use the related function %@(+&a), whose value at 0 is %a, and whose value at b-a is %b. Thus: g=: %@(+&a) g 0 0.5 g b-a 0.25 g I b-a 0.693163 ^. 2 0.693147 The integral of the reciprocal from 2 to 4 The natural log of 2 L1 Use integration to determine the areas and volumes of various geometrical figures, including cones and other volumes of revolution. M. Physical Experiments Simple experiments, or mere observation of everyday phenomena, can provide a host of problems for which simple application of the calculus provides solutions and significant insights. The reason is that phenomena are commonly governed by simple relations between the functions that describe them, and their rates of change (that is, derivatives). For example, the position of a body as a function of time is related to its first derivative (velocity), its second derivative (acceleration), and its third derivative (jerk). More specifically, if p t gives the position at time t of a body suspended on a spring or rubber band, then the acceleration of the body (p d.2) is proportional to the force exerted by the spring, which is itself a simple linear function of the position p. If position is measured from the rest position (where the body rests after motion stops) this linear function is simply multiplication by a constant function c determined by the elasticity of the spring, and c*p must be equal and opposite to m*p d.2, where the constant function m is the mass of the body. In other words, (c*p)-(m*p d.2) must be zero. This relation can be simplified to 0: = p - c2 * p d.2, where c2 is the constant function defined by c2=: m%c. The function p is therefore (as seen in Section I) the sine function, or, more generally, p=: (a*sin)+(b*cos), where a and b are constant functions. 104 Calculus This result is only an approximation, since a body oscillating in this manner will finally come to rest, unlike the sine and cosine functions which continue with undiminished amplitude. The difference is due to resistance (from friction with the air and internal friction in the rubber band) which is approximately proportional to the velocity. In other words, the differential equation: 0: = (d*p)+(e*p D. 1)+(f*p D. 2) provides a more accurate relation. As seen in Section I, a solution of such a linear differential equation is given by ^@r, where r is a (usually complex) root of the polynomial (d,e,f)&p.. If r=: x+j. y, then ^r may also be written as (^x)*(^j. y), showing that the position function is a product of a decay function (^x) and a periodic function (^j. y) like the solution to the simpler case in which the (resistance) constant e was zero. Because oscillations similar to those described above are such a familiar sight, most of us could perform the corresponding "thought experiment" and so avoid the effort of an actual experiment. However, the performance of actual experiments is salutary, because it commonly leads to the consideration of interesting related problems. For example, direct observations of the effect of greater damping can result from immersing the suspended body in a pail of water. The use of a heavier fluid would increase the damping, and raise the following question: Could the body be completely damped, coming to rest with no oscillation whatever? The answer is that no value of the decay factor ^x could completely mask the oscillatory factor ^j. y. However, a positive value of the factor f (the coefficient of p d.2) will provide real roots r, resulting in non-oscillating solutions in terms of the hyperbolic functions sinh and cosh. Such a positive factor cannot, of course, be realized in the experiment described. The performance of actual experiments might also lead one to watch for other phenomena governed by differential equations of the same form. For example, if the function q describes the quantity of electrical charge in a capacitor whose terminals are connected through a resistor and a coil, then q d.1 is the current (whose value determines the voltage drop across the resistor), and q d.2 is its rate of change (which determines the voltage drop across the coil). In other words, the charge q satisfies the same form of differential equation that describes mechanical vibrations, and enjoys the same form of electrical oscillation. Other systems concerning motion suggest themselves for actual or thought experiments: * The voltage generated by a coil rotating in a magnetic field. * The amount of water remaining in a can at a time t following the puncture of its bottom by a nail. * The amount of electrical charge remaining in a capacitor draining through a resistor (used in circuits for introducing a time delay). Coordinate geometry also provides problems amenable to the calculus. For example, c=: (1&o.,2&o.)"0 is a rank 1 0 function that gives the coordinates of a circle, and the gradient c D. 1 gives the slope of its tangent. Similarly, e=: (a*1&o.),(b*2&o.) gives the coordinates of an ellipse. Chapter 7 Interpretations And Applications 105 If we are indeed surrounded by phenomena so clearly and simply described by the calculus, why is it that so many students forced into calculus fail to see any point to the study? This is an important question, for which we will now essay some answers: 1. Emphasis on rigorous analysis of limits in an introductory course tends to obscure the many interesting aspects of the calculus which can be enjoyed and applied without it. 2. On the other hand, a superficial treatment that does not lead the student far enough to actually produce significant new results is likely to leave her uninterested. Textbook pictures of suspension bridges with encouraging but unhelpful remarks that calculus can be used to analyze the form assumed by the cables, are more likely to discourage than stimulate a student. 3. The use of scalar notation makes it difficult to reach the interesting results of the vector calculus in an introductory course. 4. Although the brief treatments of mechanical and electrical vibrations given here may provide significant insights into their solutions, they would prove unsatisfactory in a text devoted to physics: they ignore the matter of relating the coefficients in the differential equations to the actual physical measurements (Does mass mean the same as weight? In what system of units are they expressed?); they ignore questions concerning the goodness of the approximation to the actual physical system; and they ignore the practicality of the computations required. The treatment of such matters, although essential in a physics text, would make difficult its use by a student in some other discipline looking only for guidance in calculus. 107 Chapter 8 Analysis A. Introduction To a math student conversant only with high-school algebra and trigonometry, the arguments used in Section 1E to determine the exact derivative of the cube (dividing the rise in the function value by the run r, and then setting r to zero in the resulting expression) might appear not only persuasive but conclusive. Moreover, the fact that the derivative so determined leads to consistent and powerful results would only tend to confirm a faith in the validity of the arguments. On the other hand, a more mature student familiar with the use of rigorous axiomatic and deductive methods would, like Newton's colleagues at the time of his development of what came to be the calculus, have serious qualms about the validity of assuming a quantity r to be non-zero and then, at a convenient point in the argument, asserting it to be zero. Should a student interested primarily in the practical results of the calculus dismiss such qualms as pedantic βlogic-choppingβ, or are there important lessons to be learned from the centuries-long effort to put the calculus on a βfirmβ foundation? If so, what are they, and how may they be approached? The important lesson is to appreciate the limitations of the methods employed, and to learn the techniques for assuring that they are being properly observed. As Morris Kline says in the preface to his Mathematics: The Loss of Certainty [14]: But intellectually oriented people must be fully aware of the powers of the tools at their disposal. Recognition of the limitations, as well as the capabilities, of reason is far more beneficial than blind trust, which can lead to false ideologies and even to destruction. Concerning βThis history of the illogical development [of the calculus] ...β, Kline states (page 167): But there is a deeper reason. A subtle change in the nature of mathematics had been unconsciously made by the masters. Up to about 1500, the concepts of mathematics were immediate realizations of or abstractions from experience. ... In other words, mathematicians were [now] contributing concepts rather than abstracting ideas from the real world. 108 Calculus Chapter VII of Kline provides a brief and readable overview of ingenious attempts to put the calculus on a firm basis, and equally ingenious refutations. Students are urged to read it in full, and perhaps to supplement it with Lakatosβ equally readable account of the interplay between proof and refutation in mathematics. In particular, a student should be aware of the fact that weird and difficult functions sometimes brought into presentations of the calculus are included primarily because of their historical role as refutations. The words of Poincare (quoted by Kline on page 194) are worth remembering: When earlier, new functions were introduced, the purpose was to apply them. Today, on the contrary, one constructs functions to contradict the conclusions of our predecessors and one will never be able to apply them for any other purpose. The central concept required to analyze derivatives is the limit; it is introduced in Section B, and applied to series in Section D. B. Limits The function h=: (*: - 9"0) % (] - 3"0) applied to the argument a=: 3 yields the meaningless result of zero divided by zero. On the other hand, a list of arguments that differ from a by successively smaller amounts appear to be approaching the limiting value g=:6"0. Thus: g=: 6"0 h=: (*:-9"0) % (]-3"0) a=: 3 h a 0 ]i=: ,(+,-)"0 (10^-i.5) 1 _1 0.1 _0.1 0.01 _0.01 0.001 _0.001 0.0001 _0.0001 a+i 4 2 3.1 2.9 3.01 2.99 3.001 2.999 3.0001 2.9999 h a+i 7 5 6.1 5.9 6.01 5.99 6.001 5.999 6.0001 5.9999 |(g-h) a+i 1 1 0.1 0.1 0.01 0.01 0.001 0.001 0.0001 0.0001 We might therefore say that h x approaches a limiting value, or limit, as x approaches a, even though it differs from h a. In this case the limit is the constant function 6"0. We make a more precise definition of limit as follows: The function h has the limit g at a if there is a frame function fr such that for any positive value of e, the expression e>:|(g h) y is true for any y such that (|y-a) <: a fr e. In other words, for any positive value e, however small, there is a value d=: a fr e such that h y differs from g y by no more than e, provided that y differs from a by no more than d. Figure B1 provides a graphic picture of the frame function: d=: a fr e specifies the half-width of a frame such that the horizontal boundary lines at e and -e are not crossed by the graph of g-h within the frame. the role of As illustrated at the beginning of this section, the function g=: 6"0 is the apparent limit of the function h=: (*:-9"0) % (]-3"0) at the point a=: 3. The simple frame function fr=: ] suffices, as illustrated (and later proved) below: Chapter 8 Analysis 109 e 0 0 a-d a a+d Figure B1 fr=: ] a=: 3 e=: 0.2 ]d=: a fr e 0.2 ]i=: ,(+,-)"0,5%~>:i.5 0.2 _0.2 0.4 _0.4 0.6 _0.6 0.8 _0.8 1 _1 ]j=: d*i 0.04 _0.04 0.08 _0.08 0.12 _0.12 0.16 _0.16 0.2 _0.2 |(g-h) a+j 0.04 0.04 0.08 0.08 0.12 0.12 0.16 0.16 0.2 0.2 e>:|(g-h) a+j 1 1 1 1 1 1 1 1 1 1 We now offer a proof that fr=: ] suffices, by examining the difference function g-h in a series of simple algebraic steps as follows: Definitions of g and h g-h 6"0 - (*:-9"0) % (]-3"0) 6"0 + (*:-9"0) % (3"0-]) ((6"0*3"0-])+(*:-9"0))%(3"0-]) ((18"0-6"0*])+(*:-9"0))%(3"0-]) ((9"0-6"0*])+*:)%(3"0-]) ((3"0-])*(3"0-]))%(3"0-]) 3"0-] To recapitulate: for the limit point a=: 3 we require a frame function fr such that the magnitude of the difference (g-h) at the point a+a fr e shall not exceed e. We have just shown that the difference function (g-h) is equivalent to (3"0-]). Hence: Cancel terms, but the domain now excludes 3 |(g-h) a + a fr e 110 Calculus |(3"0-]) 3+3 fr e |3-(3+3 fr e) |-3 fr e |3 fr e Consequently, the simple function fr=: ] will suffice. Definition of (g-h) and limit point In the preceding example, the limiting function was a constant. We will now examine a more general case of the limit of the secant slope (that is, the derivative) of the fourth- power function. Thus: f=: ^&4 h=: [ %~ ] -&f -~ x=: 0 1 2 3 4 ]a=: 10^->:i. 6 0.1 0.01 0.001 0.0001 1e_5 1e_6 a h"0/ x _0.001 3.439 29.679 102.719 246.559 _1e_6 3.9404 31.7608 107.461 255.042 _1e_9 3.994 31.976 107.946 255.904 _1e_12 3.9994 31.9976 107.995 255.99 _1e_15 3.99994 31.9998 107.999 255.999 _1e_18 3.99999 32 108 256 The last row of the foregoing result suggests the function 4"0*^&3 as the limit. Thus: g=: 4:*^&3 g x 0 4 32 108 256 a=: 1e_6 (g-a&h) x 1e_18 5.99986e_6 2.4003e_5 5.39897e_5 9.59728e_5 In simplifying the expression for the difference (g-a&h) x we will use functions for the polynomial and for weighted binomial coefficients as illustrated below: w=: (]^i.@-@>:@[) * i.@>:@[ ! [ x=: 0 1 2 3 4 5 a=: 0.1 (x-a)^4 0.0001 0.6561 13.0321 70.7281 231.344 576.48 (4 w -a) p. x 0.0001 0.6561 13.0321 70.7281 231.344 576.48 4 w -a 0.0001 _0.004 0.06 _0.4 1 The following expressions for the difference can each be entered so that their results may be compared: (g-a&h) x (4*x^3)-a %~ (f x) - (f x-a) Chapter 8 Analysis 111 (4*x^3)-a %~ (x^4) - (x-a)^4 (0 0 0 4 0 p. x)-a%~(0 0 0 0 1 p. x)-(4 w -a)p. x a%~((a*0 0 0 4 0)p.x)-(0 0 0 0 1 p.x)-(4 w -a)p.x a%~(1 _4 6 * a^ 4 3 2) p. x (1 _4 6 * a^3 2 1) p. x We will now obtain a simple upper bound for the magnitude of the difference (that is, |(g-a&h) x), beginning with the final expression above, and continuing with a sequence of expressions that are greater than or equal to it: (If the expressions are to be entered, x should be set to a scalar value, as in x=: 5, to avoid length problems) x=:5 |(1 _4 6 * a^3 2 1) p. x Magnitude of (g-a&h) x | +/1 _4 6*(a^3 2 1)*x^i.3 Polynomial as sum of terms +/(|1 _4 6)*(|a^3 2 1)*(|x^i.3) Sum of mags>:mag of sum +/1 4 6*(a^3 2 1)*|x^0 1 2 a is non-negative +/6*(a^3 2 1)*|x^0 1 2 +/6*a*|x^0 1 2 For a<1, the largest term is a^1 6*a*+/|x^0 1 2 a* (6*+/|x^0 1 2) final The expression a=: e % (6*+/|x^0 1 2), |(g-a&h) x will not exceed e. For example: provides the then basis for frame the magnitude of a function: if the difference e=: 0.001 a=: e % (6*+/|x^0 1 2) |(g-a&h) x 0.000806451 C. Continuity Informally we say that a function f is continuous in an interval if its graph over the interval can be drawn without lifting the pen. Formally, we define a function f to be continuous in an interval if it possesses a limit at every point in the interval. For example, the integer part function <. is continuous in the interval from 0.1 to 0.9, but not in an interval that contains integers. D. Convergence of Series The exponential coefficients function ec=:%@!, generates coefficients for a polynomial that approximates its own derivative, and the growth function (exponential) is defined as the limiting value for an infinite number of terms. Since the coefficients produced by ec decrease rapidly in magnitude (the 20th element is %!19, approximately 8e_18), it seemed reasonable to assume that the polynomial (ec i.n)&p. would converge to a 112 Calculus limit for large n even when applied to large arguments. We will now examine more carefully the conditions under which a sum of such a series approaches a limit. It might seem that the sum of a series whose successive terms approach zero would necessarily approach a limiting value. However, the series %@>:@i. n provides a counter example, since (by considering sums over successive groups of 2^i. k elements) it is easy to show that its sum can be made as large as desired. If at a given term t in a series the remaining terms are decreasing in such a manner that the magnitudes of the ratios between each pair of successive terms are all less than some value r less than 1, then the magnitude of the sum of the terms after t is less than the magnitude of t%(1-r); if this quantity can be shown to approach 0, the sum of the entire series therefore approaches a limit. This can be illustrated by the series r^i.n, which has a fixed ratio r, and has a sum equal to (1-r^n) % (1-r). For example: S=: [ ^ i.@] T=: (1"0-^)%(1"0-[) r=: 3 n=: 10 r S n 1 3 9 27 81 243 729 2187 6561 19683 +/ r S n 29524 r T n 29524 A proof of the equivalence of T and the sum over S can be based on the patterns observed in the following: (1,-r) */ r S n 1 3 9 27 81 243 729 2187 6561 19683 _3 _9 _27 _81 _243 _729 _2187 _6561 _19683 _59049 ]dsums=:+//.(1,-r) */ r S n 1 0 0 0 0 0 0 0 0 0 _59049 -r^10 _59049 +/dsums _59048 (1-r) * r T n _59048 If the magnitude of r is less than 1, the value of r^n in the numerator of r T n approaches zero for large n, and the numerator itself therefore approaches 1; consequently, the result of r T n approaches %(1-r) for large n. The expression ec j-0 1 gives a pair of successive coefficients of the polynomial approximation to the exponential, and %/ec j-0 1 gives their ratio. For example: ec=:%@! j=: 4 ec j-0 1 0.0416667 0.166667 Chapter 8 Analysis 113 %/ec j-0 1 0.25 %j 0.25 The ratio of the corresponding terms of the polynomial (ec i.n)&p. applied to x is x times this, namely, x%j. At some point this ratio becomes less than 1, and the series for the exponential therefore converges. Similar proofs of convergence can be made for the series for the circular and hyperbolic sines and cosines, after removing the alternate zero coefficients. Another generally useful proof of convergence can be made for certain series by establishing upper and lower bounds for the series. This method applies if the elements alternate in sign and decrease in magnitude. We will illustrate this by first developing a series approximation to the arctangent, that is, the inverse tangent _3o.. The development proceeds in the following steps: 1. Derivative of the tangent 2. Derivative of the inverse tangent 3. Express the derivative as a polynomial in the tangent 4. Express the derivative as the limit of a polynomial 5. Integrate the polynomial 6. Apply the polynomial to the argument 1 to get a series whose sum approximates the arctangent of 1 (that is, one-quarter pi): ]x=: 1,1r6p1,1r4p1,1r3p1 1 0.523599 0.785398 1.0472 '`sin cos tan arctan'=: (1&o.)`(2&o.)`(3&o.)`(_3&o.) sin x 0.841471 0.5 0.707107 0.866025 cos x 0.540302 0.866025 0.707107 0.5 tan x 1.55741 0.57735 1 1.73205 (sin % cos) x 1.55741 0.57735 1 1.73205 INV=: ^:_1 tan INV tan x 1 0.523599 0.785398 1.0472 D=:("0) (D.1) tan D (sin % cos) D (sin%cos)*(sin D%sin)-(cos D%cos) ΞΈ7Β§2K tan*(cos%sin)-(-@sin%cos) tan * %@tan +tan Β§2K Definition of tan 114 Calculus 1"0 + tan * tan 1"0 + *:@tan Derivative of tangent QED tan INV D 1"0 % tan D @(tan INV) 1"0 % (1"0 + *:@tan) @ (tan INV) 1"0 % (1"0@(tan INV)) + *:@tan@(tan INV) 1"0 % 1"0 + *:@] 1"0 % 1"0 + *: %@(1"0+*:) ΞΈ7Β§2K Derivative of inverse tan QED c=: 1 0 1 % c&p. x 0.5 0.784833 0.618486 0.476958 b=: 1 0 _1 0 1 0 _1 0 1 0 _1 c */ b 1 0 _1 0 1 0 _1 0 1 0 _1 0 0 0 0 0 0 0 0 0 0 0 1 0 _1 0 1 0 _1 0 1 0 _1 Derivative of inverse tangent as reciprocal of a polynomial Coeffs of approx reciprocal +//. c */ b 1 0 0 0 0 0 0 0 0 0 0 0 _1 Product polynomial shows that b&p.is approx reciprocal of c&p. %@(1:+*:) x 0.5 0.784833 0.618486 0.476958 b&p. x 0 0.7845 0.584414 _0.352555 int=: 0: , ] % 1: + i.&# a=: int b a&p. x 0.744012 0.482334 0.6636 0.736276 tan INV x 0.785398 0.482348 0.665774 0.808449 Better approx needs more terms of b The fn a&p. is the integral of b&p. Approximation to arctangent 7.3 ": 8{. a 0.000 1.000 0.000 _0.333 0.000 0.200 0.000 _0.143 Arctan 1 is one-quarter pi 1r4p1 , a p. 1 0.785398 0.744012 Coeffs for arctan are reciprocals of odds +/a 0.744012 Polynomial on 1 is sum of coefficients gaor=: _1&^@i. * 1: % 1: + 2: * i. gaor 6 1 _0.333333 0.2 _0.142857 0.111111 _0.0909091 Generate alternating odd reciprocals +/\gaor 6 1 0.666667 0.866667 0.72381 0.834921 0.744012 7 2 $ +/\ gaor 14 1 0.666667 First column (sums of odd number Chapter 8 Analysis 115 of terms) are decreasing upper bounds of limit. Second column (sums of even number of terms) are increasing lower bounds of limit. 0.866667 0.72381 0.834921 0.744012 0.820935 0.754268 0.813091 0.76046 0.808079 0.764601 0.804601 0.767564 1r4p1 , +/gaor 1000 0.785398 0.785148 D1 Test the derivations in this section by enclosing a sentence in parens and applying it to an argument, as in (1: + *:@tan) x D2 Prove that a decreasing alternating series can be bounded as illustrated. [Group pairs of successive elements to form a sum of positive or negative terms] 117 Appendix Topics in Elementary Math A. Polynomials An atomic constant multiplied by an integer power (as in a"0 * ^&n) is called a monomial, and a sum of monomials is called a polynomial. We now define a polynomial function, the items of its list left argument being called the coefficients of the polynomial: pol=: +/@([ * ] ^ i.@#@[) " 1 0 For example: c=: 1 2 3 [ x=: 0 1 2 3 4 c pol x 1 6 17 34 57 1 3 3 1 pol x 1 8 27 64 125 The polynomial may therefore be viewed as a weighted sum of powers, the weights being specified by the coefficients. It is important enough to be treated as a primitive, denoted by p. . It is important for many reasons. In particular, it is easily expressed in terms of sums, products, and integral powers; it can be used to approximate almost any function of practical interest; and it is closed under a number of operations; that is, the sums, products, derivatives, and integrals of polynomials are themselves polynomials. For example: x=: 0 1 2 3 4 [ b=: 1 2 1 [ c=: 1 3 3 1 (b p. x) + (c p. x) 2 12 36 80 150 Sum of polynomials b +/@,: c 2 5 4 1 (b +/@,: c) p. x 2 12 36 80 150 (b p. x) * (c p. x) 1 32 243 1024 3125 b +//.@(*/) c 1 5 10 10 5 1 βSumβ of coefficients Sum polynomial Product of polynomials βProductβ of coefficients (b +//.@(*/) c) p. x Product polynomial 118 Calculus 1 32 243 1024 3125 c&p. d.1 x 3 12 27 48 75 c&p. d._1 x 0 3.75 20 63.75 156 derc=: }.@(] * i.@#) derc c 3 6 3 (derc c) p. x 3 12 27 48 75 intc=: 0: , ] % >:@i.@# intc c 0 1 1.5 1 0.25 (intc c)&p. x 0 3.75 20 63.75 156 Derivative of polynomial Integral of polynomial βDerivativeβ coefficients Derivative polynomial βIntegralβ coefficient is "linear is A polynomial (c p. x)+(d p. x). This linearity can be made clear by expressing c p. x as m&mp c, where m is the Vandermonde matrix obtained as a function of x and c. Thus: that (c+d) p. x its coefficients" in in vm=: [ ^/ i.@#@] x=: 0 1 2 3 4 5 c=: 1 3 3 1 x vm c 1 0 0 0 216 1 1 1 1 1 2 4 8 1 3 9 27 1 4 16 64 1 5 25 125 (x vm c) mp c 1 8 27 64 125 216 c p. x 1 8 27 64 125 The expression c=: (f x) %. x^/i.n yields an n-element list of coefficients such that c p. x is the best least-squares approximation to the values of the function f applied to the list x. In other words, the value of +/sqr (f x)-c p. x is the least achievable for an n-element list of coefficients c. We now define a conjunction FIT such that a FIT f x produces the coefficients for the best polynomial fit of a elements: FIT=: 2 : 'y. %. ^/&(i. x.)' ]c=: 5 FIT ! x=: 0 1 2 3 4 1 _2.08333 3.625 _1.91667 0.375 c p. x 1 1 2 6 24 ]c=: 4 FIT ! x 0.871429 3.27381 _3.71429 1.08333 1 1 2 6 24 !x Appendix 119 c p. x 0.871429 1.51429 1.22857 6.51429 23.8714 B. Binomial Coefficients m!n is the number of ways that m things can be chosen out of n; for example 2!3 is 3, and 3!5 is 10. The expression c=: (i. n+1)!n yields the binomial coefficients of order n, and c p. x is equivalent to (x+1)^n. For example: ]c=: (i. n+1)!n=: 3 1 3 3 1 c p. x=: 0 1 2 3 4 5 1 8 27 64 125 216 (x+1) ^ n 1 8 27 64 125 216 <@(i.@>: ! ])"0 i. 6 βββ¬ββββ¬ββββββ¬ββββββββ¬ββββββββββ¬ββββββββββββββ β1β1 1β1 2 1β1 3 3 1β1 4 6 4 1β1 5 10 10 5 1β βββ΄ββββ΄ββββββ΄ββββββββ΄ββββββββββ΄ββββββββββββββ C. Complex Numbers Just as subtraction and division applied to the counting numbers (positive integers) introduce new classes of numbers (called negative numbers and rational numbers), so does the square root applied to negative numbers introduce a new class called imaginary numbers. For example: a=: 1 2 3 4 5 6 ]b=: -a _1 _2 _3 _4 _5 _6 % a 1 0.5 0.333333 0.25 0.2 0.166667 Negative numbers Rational numbers %: b 0j1 0j1.41421 0j1.73205 0j2 0j2.23607 0j2.44949 Imaginary numbers Arithmetic functions are extended systematically to this new class of numbers to produce complex numbers, which are represented by two real numbers, a real part and an imaginary part, separated by the letter j. Thus: a+%:b 1j1 2j1.41421 3j1.73205 4j2 5j2.23607 6j2.44949 Complex numbers j. a j1 0j2 0j3 0j4 0j5 0j6 ]d=: a+j. 5 4 3 2 1 0 1j5 2j4 3j3 4j2 5j1 6 The function j. multiplies its argument by 0j1 The monad + is the conjugate function; it reverses the 120 Calculus +d 1j_5 2j_4 3j_3 4j_2 5j_1 6 d*+d 26 20 18 20 26 36 sign of the imaginary part Product with the conjugate produces a real number %: d*+d 5.09902 4.47214 4.24264 4.47214 5.09902 6 complex number Magnitude of a |d 5.09902 4.47214 4.24264 4.47214 5.09902 6 D. Circular and Hyperbolic Functions. sinh=: 5&o. cosh=: 6&o. tanh=: 7&o. sin=: 1&o. cos=: 2&o. tan=: 3&o. SIN=: sin@rfd COS=: cos@rfd TAN=: tan@rfd rfd=: o.@(%&180) Sine in degrees Radians from degrees E. Matrix Product and Linear Functions The dot conjunction applied to the sum and product functions yields a function commonly referred to as the dot or matrix product. Thus: mp=: +/ . * ]m=: i. 3 3 0 1 2 3 4 5 6 7 8 n mp m 15 18 21 42 54 66 69 90 111 96 126 156 ]n=: i. 4 3 0 1 2 3 4 5 6 7 8 9 10 11 3 2 1 mp m 12 18 24 1 4 6 mp m 48 59 70 Left and right bonds of the matrix product distribute over addition; that is, a&mp c+d is (a&mp c)+(a&mp d), and mp&b c+d is (mp&b c)+(mp&b d). For example: mp&m 3 2 1 + 1 4 6 60 77 94 (mp&m 3 2 1) + (mp&m 1 4 6) 60 77 94 A function that distributes over addition is said to be linear; the name reflects the fact that a linear function applied to the coordinates of collinear points produces collinear points. For example: Appendix 121 ]line=: 3 _7 1,:2 2 4 3 _7 1 2 2 4 ]a=: 3 1,:_4 2 3 1 _4 2 a&mp line 11 _19 7 _8 32 4 mp& 3 1 _2 line 0 0 mp&3 1 _2 a &mp line 0 0 F. Inverse, Reciprocal, And Parity We will now define and illustrate the use of four further adverbs: I=: ^: _1 R=: %@ ODD=: .: - EVEN=: .. - Inverse adverb Reciprocal adverb Odd adverb Even adverb *: I x=: 0 1 2 3 4 5 0 1 1.41421 1.73205 2 2.23607 Inverse of the square, that is, the square root *: R x _ 1 0.25 0.111111 0.0625 0.04 Reciprocal of the square, that is, %@*:, or ^&_2 c=: 4 3 2 1 even=: c&p. EVEN Even part of polynomial c&p. odd=: c&p. ODD Odd part of polynomial even x 4 6 12 22 36 54 odd x 0 4 14 36 76 140 (even + odd) x 4 10 26 58 112 194 c&p. x 4 10 26 58 112 194 4 0 2 0 p. x 4 6 12 22 36 54 0 3 0 1 p. x 0 4 14 36 76 140 Even function applied to x Odd function applied to x Sum of even and odd parts is equal to the original function c&p. Even part is a polynomial with non- zero coefficients for even powers Odd part is a polynomial with non- zero coefficients for odd powers 122 Calculus For an even function, f -y equals f y; for an odd function, f -y equals -f y. Plots of even and odd functions show their graphic properties: the graph of an even function is "reflected" in the vertical axis, and the odd part in the origin. Exercises AP1 AP2 Enter the expressions of this section, and verify that the results agree with those given in the text. Predict the results of each of the following sentences, and then enter them to validate your predictions: D=: ("1) (D.1) x=: 1 2 3 4 5 |. D x 2&|. D x 3 1 0 2 &{ D x +/\ D x +/\. D x AP3 Define show=: {&'.*' and use it to display the results of Exercises G2, as in show |. D x . AP4 Define a function rFd to produce radians from degrees, and compare rFd 90 180 with o. 0.5 1 . [ rFd=: %&180@o. ] AP5 Define a function AREA such that AREA v yields the area of a triangle with two sides of lengths 0{v and 1{v and with an angle of 2{v degrees between them. Test it on triangles such as 2 3 90 and 2 3 30, whose areas are easily computed. [AREA=: -:@(0&{ * 1&{ * 1&o.@rFd@{:)"1] AP6 Experiment with the vector derivative of the triangle area function of Exercise G5, using VD=: ("1)(D.1) . [AREA VD 2 3 90] AP7 Heron's formula for the area of a triangle is the square root of the product of the semiperimeter with itself less zero and less each of the three sides. Define a function hat to give Heron's area of a triangle, and experiment with its vector derivative hat VD. In particular, try the case hat VD 3 4 5, and explain the (near) zero result in the final element. [ hat=: %:@(*/)@(-:@(+/) - 0: , ])"1 ] AP8 Define a function bc such that bc n yields the binomial coefficients of order n, a function tbc such that tbc n yields a table of all binomial coefficients up to order n, and a function tabc for the corresponding alternating binomial coefficients. Appendix 123 [ bc=: i.@>: ! ] tbc=: !/~ @ (i.@>:) tabc=: %.@tbc ] AP9 Test the assertion that (bc n) p. x=: i. 4 is equivalent to x^n+1 for various values of n. AP10 Write an expression to yield the matrix m such that mp&m is equivalent to a given linear function L. Test it on the linear functions L=:|."1 and L=:3&A."1, using the argument x=:3 1 4 1 6 [ L = i. # x ] AP11 Experiment with the use of various functions on imaginary and complex numbers, including the exponential, the sine, cosine, hyperbolic sine and hyperbolic cosine. Also experiment with matrices of complex numbers and with the use of the matrix inverse and matrix product functions upon them. 125 References 1. 2. Iverson, Kenneth E., Arithmetic, ISI 1991 Lakatos, Imre, Proofs and Refutations: the logic of mathematical discovery, Cambridge University Press. 3. Lanczos, Cornelius, Applied Analysis, Prentice Hall, 1956. 4. McConnell, A.J., Applications of the Absolute Differential Calculus, Blackie and Son, Limited, London and Glasgow, 1931. 5. Oldham, Keith B., and Jerome Spanier, The Fractional Calculus, Academic Press, 1974. 6. Johnson, Richard E., and Fred L. Kiokemeister, Calculus with analytic geometry, Allyn and Bacon, 1957. 7. Hildebrand, , F.B., Introduction to Numerical Analysis, McGraw-Hill, 1956. 8. Woods, Frederick S., Advanced Calculus, Ginn and Company, 1926. 9. Schey, H.M., Div, Grad, Curl, and All That, W.W. Norton, 1973. 10. Jordan, Charles, Calculus of Finite Differences, Chelsea, 1947. 11. Coleman, A.J. et al, Algebra, Gage, 1979. 12. Churchill, Ruel V., Modern Operational Mathematics in Engineering, McGraw- Hill, 1944. 13. Eisenhart, Luther Pfahler, A Treatise on the Differential Geometry of Curves and Surfaces, Ginn, 1909. 14. Kline, Morris, Mathematics: The loss of certainty, Oxford, 1980 Calculus 112266 Index acceleration, 10, 28, 29, 105 Calculus of Differences, 21 adverb, 11, 12, 15, 25, 32, 49, 67, 73, 74, 82, 87, Calculus of Finite Differences, 49 90, 91, 92, 96, 99, 103, 104, 123 adverbs, 11, 12, 63, 123 aggregation, 57 alternating binomial coefficients, 59, 125 alternating sum, 14, 93 ambivalent, 12 Analysis, 109 Celsius, 31 chain rule, 15 circle, 70 circular, 26, 30, 31, 69, 70, 72, 73, 75, 86, 97, 98, 115 Circular, 122 Circulars, 29 angle, 41, 42, 75, 77, 78, 79, 80, 81, 124 closed, 119 anti-derivative, 15 Applications, 86 AREA, 100, 124 AREAS, 104 Coefficient Transformations, 55 Coefficients, 28, 91 comments, 13 complementary minor, 93 Argument Transformations, 31 complex numbers, 86, 121, 125 atop, 30, 31 Atop, 30 axes, 42 Complex Numbers, 121 complex roots, 92 computer, 10, 11, 13, 14, 15, 22, 63 beta function, 63 COMPUTER, 15 binomial coefficients, 59, 60, 61, 63, 112, 121, conjugate, 86, 122 125 Binomial Coefficients, 121 103, 120, 122 conjunction, 12, 13, 15, 30, 31, 62, 63, 65, 69, binormals, 98 conjunctions, 11, 12, 31, 63 bisection method, 87, 91 constant function, 33, 106, 110 bold brackets, 13 Calculus, 7 Continuity, 113 continuous, 26, 49, 86, 113 2 Calculus contour integral, 86 difference calculus, 16, 61 conventional notation, 10 Difference Calculus, 49 CONVERGENCE OF SERIES, 114 Differential Calculus, 23 copula, 11, 12 differential equation, 96 cos, 30, 31, 70, 72, 73, 75, 79, 80, 81, 86, 106, Differential Equations, 25 116, 122 cosh, 29, 69, 70, 72, 73, 106, 122 cosine, 29, 30, 31, 73, 75, 76, 77, 80, 97, 106, 125 cross, 79 cross product, 47, 80, 81, 82, 83 Cross Products, 79 curl, 46, 79 curves, 97 cylinder, 98 de Morgan, 15 decay, 28, 67, 68, 69, 73, 106 Differential Geometry, 97 differintegral, 61, 62 differintegrals, 60 direction, 41 discontinuous, 85 displayed, 15 divergence, 42, 46 Divergence, 42 division, 90, 92, 121 dot, 122 DOT, 79 Decay, 27 electrical system, 29 degrees, 30, 79, 80, 97, 98, 122, 124 Elementary Math, 119 derivative, 9, 10, 15, 16, 17, 18, 22, 25, 26, 27, 28, 29, 32, 33, 37, 40, 49, 52, 61, 62, 63, 65, 68, 70, 78, 79, 86, 87, 88, 89, 90, 92, 93, 94, 95, 99, 105, 109, 112, 114, 115, 124 Derivative, 15, 16 Derivative of polynomial, 120 derivative operator, 10 ellipse, 99, 107 Even part, 123 executable, 10, 11, 22 executed, 14 EXERCISES, 13, 124 derivatives, 15, 16, 21, 26, 30, 31, 32, 39, 51, 52, 60, 61, 63, 68, 70, 72, 79, 96, 98, 105, 110, 119 experimentation, 10, 15, 22, 67 Experimentation, 69 derived function, 15 determinant, 38, 41, 83, 92, 93 Determinant, 92 diagonal sums, 69 difference, 49 experiments, 11, 63, 67, 69, 105, 106, 107 explore, 11 exponential, 12, 16, 26, 27, 28, 29, 69, 73, 85, 99, 105, 114, 115, 125 Exponential Family, 73 exponentially, 26 Index 3 extrema, 89 Extrema, 87 Hyperbolics, 28 identity, 33, 52, 58, 65, 77, 79, 95 f., 16, 28, 47, 86, 96, 99, 101, 102 imaginary numbers, 15, 121 factorial function, 15, 62 imaginary part, 121 Fahrenheit, 31 Family of cosines, 96 induction, 33 infinitesimal, 49 first derivative, 29, 32, 61, 105 Infinitesimal Calculus, 49 foreign conjunction, 15 Inflection Points, 87 fork, 33, 52, 63 Fourier series, 96 Fractional Calculus, 61 Fractional derivatives, 21 function, 12 functions, 7 Functions, 11, 32, 105 gamma function, 62 gamma function and imaginary numbers., 15 Gradient, 38 growth, 7, 16, 26, 27, 28, 67, 68, 69, 73, 114 Growth, 26 harmonics, 96 heaviside, 10 Heaviside's, 46 helix, 97 Heron's area, 124 hierarchy, 12 high-school algebra, 12, 109 hyperbola, 29, 70 hyperbolic, 26, 29, 69, 72, 73, 106, 115, 125 Hyperbolic Functions, 122 informal proofs, 13, 22, 52 initial guess, 89 insert, 11 integer part, 85 integral, 15, 21, 22, 55, 61, 62, 63, 86, 99, 100, 101, 103, 104, 105, 116, 119 Integral, 15, 16 integration, 61, 86, 100, 101, 105 Interpretations, 18, 85 Inverse, 123 inverse matrix, 57 irrotational, 46 items, 12, 82, 119 Jacobian, 40, 41, 42 jerk, 105 Jordan, 49 Kernerβs method, 97 KERNER'S METHOD, 91 Kline, 109 Lakatos, 21 Laplacian, 42 leibniz, 10 Less than, 11 4 Calculus Lesser of, 11 limit, 10, 22, 79 Limits, 110 line, 86 linear, 123 minors, 93 modern, 10 multiplication table, 12 natural logarithm, 73 negation, 12, 27 linear combinations, 96 negative numbers, 121 Linear Differential Equations, 96 newton, 10 linear form, 15 Newton's Method, 89 linear function, 40, 41, 57, 58, 94, 95, 96, 106, normal, 79 123, 125 linear functions, 41 Linear Functions, 94 LINEAR FUNCTIONS, 122 linear operator, 96 lists, 11, 14, 32 local, 87 local behaviour, 16 local minimum, 89 logarithm, 73, 74 Logarithm, 73 Loss of Certainty, 109 lower bounds, 115 magnitude, 41 Magnitude, 122 matrices, 11, 56, 125 MATRIX INVERSE, 94 MATRIX PRODUCT, 122 maximum, 87, 88, 89, 90 Maxwell's, 46 mechanical system, 29 minimum, 11, 15, 87, 88, 89 normalized coefficient, 91 Normals, 82 notation, 10, 11, 15, 22, 64, 102, 107 Notation, 11 NOTATION, 15 nouns, 11, 12 number of items, 82 numerator, 115 Odd part, 123 operators, 10, 11 Operators, 94 oscillations, 29, 106 osculating, 98 outof, 61 Parentheses, 12 Parity, 71, 123 Partial derivatives, 21 periodic functions, 29 Permanent, 92 permutation, 95 permutations, 42 Index 5 perpendicular, 79 rank-0, 37 Physical Experiments, 105 rate of change, 7 pi, 103, 104 plane, 80 point of inflection, 88 polynomial, 26, 27, 30, 31, 49, 50, 55, 67, 69, 87, 89, 90, 91, 92, 96, 100, 101, 103, 106, 112, 114, 115, 116, 119, 120, 123, 124 polynomials, 26, 28, 68, 90, 92, 119 Polynomials, 119 positive integers, 121 rational constant, 63 rational numbers, 121 real part, 121 Reciprocal, 123 residuals, 92 rise, 89 roots, 87 rotation, 41, 42, 46 power, 10, 15, 17, 21, 49, 51, 52, 74, 103, 112, Rotation, 80 119 Power, 73 precedence, 12 primes, 14 principal normal, 98 Product of polynomials, 119 pronouns, 11 proof, 14, 17, 67, 68, 69, 72, 110, 111, 114, 115 proofs, 13, 21, 22, 52, 67, 115 Proofs, 72, 80 Proofs and Refutations, 21 run, 89 scalar product, 79 scalars, 21, 80 Scaling, 30 Secant Slope, 15, 16 secant slopes, 16 second derivative, 10 Semi-Differintegrals, 63 series, 115 Simpson's Rule, 101 proverbs, 11 punctuation, 12 pyramid, 104 Pythagoras, 76 quotes, 14, 86 radians, 30, 41, 78, 79, 86, 124 Random starting value, 91 rank, 12, 21, 37, 93, 94, 107 rank conjunction, 12 sin, 13, 30, 31, 70, 72, 73, 75, 79, 81, 86, 106, 116, 122 sine, 29, 30, 73, 75, 76, 77, 78, 79, 80, 81, 96, 97, 106, 125 Sine, 13, 73, 122 sinh, 29, 69, 70, 72, 73, 106, 122 Skew part, 82 slope, 89 Slopes As Linear Functions, 57 Stirling numbers, 56 stope polynomial, 55 6 Calculus subtraction, 12, 121 Sum Formulas, 76 Sum of polynomials, 119 summation, 57 surfaces, 97 tables, 11, 89 tangent, 15, 22, 78, 85, 86, 88, 89, 98, 107, 115, 116 under, 15, 49, 51, 57, 65, 86, 99, 100, 101, 103, 104, 105, 114, 119 upper, 115 Vandermonde, 101, 120 vector calculus, 38, 46, 97, 107 Vector Calculus, 37 vector derivative, 92 vector product, 79, 98 tautologies, 72, 73, 76, 77, 79 vectors, 10, 11, 79, 80, 81, 82, 98 Tautologies, 78 tautology, 33, 79 tensor analysis, 38 Terminology, 11 third derivative, 105 trapezoids, 100 trigonometric, 26, 75 Trigonometric Functions, 75 Vectors, 11 velocity, 7 verbs, 11, 12 vocabulary, 15 volume derivative, 40 volume of revolution, 105 VOLUMES, 104 weighted sums, 96 trigonometry, 30, 75, 77, 79, 109 Word Problems, 86 |