Put the inputs in the boxes and choose the operation.  Use PI [or 3.141592653589793[ and NE [or 2.718281828459045 or exp(1)] instead of π and e [Euler's number].  Use A or B or C if you want to use previous output as input.  Use M and Q if you want to use data that you have written or copied in the M or Q box; Q is also used as "Pr" of the binomial distribution; you can also add or multiply data by Q; Q is also used for EQ, m, M (see)  Use Round to round to units or digits after or before them.
[ (-2.7)^(5/3) → -(2.7^(5/3)) = -pow(2.7,5/3) = -5.23…, but (-2.7)^(5/4) is not defined. Note that loga(x) = log(x)/log(a) ]
 Math functions       pocket calculator-2    help

a (+, …, Round)   a'(Math)  a"(M, Q, A, B, C)  a'''(Binom)   d (+/-, …, =)   d'(recursion)   d"(EQ, m, M, flex)   d"' )
e (Round)   f (recursion, series)   g (n, xQ, max, …)   g' (3σ, …)  g"(N)  g'''(DiMu, simp.frac)  g''''(data)  g'''''(data, log, rand,…)
i (M, Q, A, B, C)   j (Q)   j'(data)   k (storing)   k'(order of magnitude)   k"(F, tab. of function, lim, d/dx)
round a sequence     random (probability)

Note. You can get results like this: 0.5-0.4 = 0.09999999999999998  as the calculations are done using base 2 instead of base ten (and 0.4 in base 2 has not a terminating representation:  0.011001100110011001100110011…; therefore 0.4 is not represented exactly in the calculation). But,in this case, with "Round [16]" you get 0.1. See sixteenth example. Spreadsheets proceed in the same way but in a "hidden" way, often producing results that are not easily controllable: see fourth example.

1-First example:
A wheel has a diameter of 82 cm. What is its circumference?

A typical example of an incorrect answer:  the use of 3.14 and thinking that 82 cm is an "exact" measurement.

Or correctly rounding the answer with 3 digits (Round "0" rounds to units), but using 3.14:

2-Second example:
A school class in a winter month detects the outside temperature on each school day at 9 o'clock:

3, 4*3, 5*6, 6*4, 7*3, 8*5

I round (the number in C) to tenths:

What is the 16th number of the sequence?

3-Third example:
Unlike the behavior of pocket calculators, the computer operates with numbers in a somewhat different way, so the results of the operations may differ by a few units on the last (the 17th) digit.  However, they are more digits than are usually needed. With this calculator we can round numbers.  Some example.

( round to 14^ digit after units )

Another example:

If I want more digits I can use WolframAlpha: 65^7.5 = 3.95230247951166612450680094...·10^13.  As you can see (3^ example), with the script it is better to take a rounding with 1 or 2 digits less ((in this case rounding to tenths or hundredths).

 Let's compare the values of these two numerical terms: (19/6177)^2 and (10119/355 - 12398/435)^2.  I get two different values. ```(10119/355 - 12398/435) ^ 2 = 0.000009461325834731282 (19/6177) ^ 2 = 0.00000946132583472154 ```

Only 11 digits are equal while the two terms are equivalent. Similar problems also happen with the usual calculators. Let's see how we could check the equivalence of the two terms:
355 * 435 = 154425
10119 * 435 = 4401765
12398 * 355 = 4401290
4401765 - 4401290 = 475

10119/355 - 12398/435 = 475/154425. With this script I can find that:
475/154425 -> 19/6177
With this script I can find that the period of 19/6177 is 140 digits long:
0.003075926825319734498947709243969564513517888942852517403270195887971
50720414440666990448437752954508661162376558199773352760239598510603853

00307592682531...

If I want (and if I have a lot of time available) I can find the period of (19/6177)^2 = 361 / 38155329 (it is long 288250 digits):
0.000009461325834721540469484616421470248625034788718503777021553136129425066679
41455831765990014134067616085815955092406620317701886412773429368149335050943997
88821110676309461255071342721222506035788605046492981360480471810372805329499321
05158888814718384422789278006225552399246773628920877605327423595272890976775485
28018196357316169387505477937302021429300216491384466898450803556169047841259604
91652424226246352115061044290825011625505836943510564408971548902120592381735196
15045122530590681055325194548840084696950195344928096413478704377047829937464305
44472568956226271826931435973203114039456978604482744730100479542451330979219180
...

4-Fourth example:
843.27−843.23 and 5555.1251−5555:  see here.

5-Fifth example:
Human body weight (peso corporeo); 4170 Italian males in their twenties, in the year 1990.   (here).
We have seen how to obtain the following histogram and the following elaborations:

I put the data in (g):

I have:

Values are rounded to units. The central 50% of the data is in [63, 76], an interval of amplitude 13.  The average weight (of Italian males in their twenties, in the year 1990) is  70.48±0.49 kg,  or  70.5±0.5 kg.

6-Sixth example:
From 2007 to 2012, employment had the following percentage changes (each calculated with respect to the previous year): 1.6, 2.8, 1.3, -0.8, 0.9, 1.7. What was the overall percentage change?

I get 1.077011, or 107.7%:  there was a positive change of about 7.7%.  I put "about" as the data are rounded and there may be changes in the last digit due to rounding.

7-Seventh example:

8-Eighth example:

In a large number of experiments it is obtained that a certain poison kills 78% of the mice on which it is tested. If used on a group of 5 mice, what is the probability that 0, 1, 2, 3, 4, 5 mice are killed?

The probability of a mouse dying is 0.78. So we have to consider the binomial law Binom(5, 0.78) and evaluate Cbin(5,5)*0.785*0.220, Cbin(5,4)*0.784*0.221, Cbin(5,3)*0.783*0.222, Cbin(5,2)*0.782*0.223, ...
To calculate Cbin(5,2)*0.782*0.223 I can use Binom(5,2) with Q=0.78.

Pr = 0.78 B(5,5) = 0.28871743680000006  round to 4^ digit after units: 0.2887, 28.87%
Pr = 0.78 B(5,4) = 0.40716561600000006  round to 4^ digit after units: 0.4072, 40.72%
Pr = 0.78 B(5,3) = 0.22968316799999997  round to 4^ digit after units: 0.2297, 22.97%
Pr = 0.78 B(5,2) = 0.06478243199999999  round to 4^ digit after units: 0.0648, 6.48%
Pr = 0.78 B(5,1) = 0.009135983999999998  round to 4^ digit after units: 0.0091, 0.91%
Pr = 0.78 B(5,0) = 0.0005153631999999998  round to 4^ digit after units: 0.0005, 0.05%

If in  [M]  I put "z" (zero)  the sum B(n,0)+B(n,1)+...+B(n,k) is calculated.  Example 1:

0.0005153631999999998+0.009135983999999998+0.06478243199999999 = 0.07443377919999998

Example 2:

0.0005153631999999998 + ... + 0.28871743680000006 = 1

9-Ninth example:

Pupils in a 4th grade class collect the ages of their parents when they were born. Below are the data. What was the average age of the parents when the pupils were born?

28, 36, 22, 25, 27, 44, 39, 37, 29, 26, 21, 37, 42, 39, 41, 40, 45, 24, 34, 28, 41, 32, 32, 30, 45, 24, 33, 31, 29, 34, 26, 33, 34, 28, 41, 30, 35, 37, 29, 39, 24, 33, 31, 36, 32, 32, 35, 29, 33, 47, 34, 31

We can get (with this version):

The data is truncated. To process them correctly we need to add half a year to all ages (a 32-year-old person has an average age between 32 and 33).

With [copy] I introduce the transformed data:

The mean is 33.7:

We have seen how to obtain (with the transformed data) the following histogram:

10-Tenth example Rounding should only be done at the end:

In many manuals, especially in the biological field, but also in the physical field, still (in the XXI) many complex calculations are performed by rounding off the intermediate results, gradually losing information; but in the end these manuals round off the result with many figures more than the legal ones (once, up to the middle of the twentieth century, in the absence of convenient means of calculation, this was often the case, but generally the rounding was done correctly ...). An example from a famous manual of mathematics for the life sciences.

To evaluate the density of trees in a park, the number of trees per hectare that are present in 5 differently placed sample areas are counted, obtaining:
Size in hectares of the area     1.50, 2.30, 1.75, 3.10, 2.65
Number of trees present in it     20,   31,    43,    58,    29
Determines the mean and standard deviation of the density  (number / hectare).

Developing the calculations the manual finds as answers 16.2 and, therefore, 5.491.

Let's do the calculations with the calculator:

The extended experimental standard deviation value is 5.468924971825509, the rounded value is 5.469, very different from that indicated in the manual (manual that to do the calculations misused - and makes the students use - an expensive numerical calculation software!).

11-Eleventh example Round up a sequence of number:

We transform a sequence of numbers (e.g. men's high jump records every 4 years from 1932 to 1996: 203, 207, 209, 211, 211, 211, 215, 222, 228, 228, 229, 232, 236, 239 , 243, 244, 245) into index numbers (let's set the first data equal to 100 and transform the others proportionally) and then round the index numbers to the second digit after ".".

I put the data sequence (separated by ",") in the "data" box. I calculated 100/203. I copied the result in box Q. So I clicked [data·Q]..

With [copy] I paste the index numbers obtained and, finally, I put 2 next to [Round] and click [round]:

If I similarly transform the data on female records (165, 165, 166, 171, 171, 172, 176, 186, 191, 191, 194, 196, 201, 207, 209, 209, 209) and graph everything ( using this script) I get:

12-Twelfth example Enter expressions instead of numbers.

I can introduce in the cells instead of single numbers terms that contain more numbers (the only operations allowed are +, *, -, / and those of the type "Math").

 36 + 1 ————— 53 · 24 · 0.3

or:

 ``` Usable "Math" Functions: abs(a) / |a| log10(a) / log of a base 10 acos(a) / arc cosine of a max(a,b) asin(a) / arc sine of a min(a,b) atan(a) / arc tangent of a pow(a,b) / a to the power b atan2(a,b) / arc tangent of a/b random() / random n. in [0,1) cbrt(a) / cube root of a round(a) / integer closest to a ceil(a) / integer closest to a not < a sign(a) / sign of a cos(a) / cosine of a sin(a) / sine of a exp(a) / exponential of a sqrt(a) / square root of a floor(a) / integer closest to a not > a tan(a) / tangent of a log(a) / log of a base e trunc(a) / integer portion of a log2(a) / log of a base 2 PI / π cosh(a),sinh(a),tanh(a), acosh(a),asinh(a),atanh(a) hyperbolic functions Note: M%%N is the remainder of M/N, != is "not equal" ```

Other examples:

```cbrt(27000)           output: 30
max(39/7, 6, 79/14)   output: 6
random()              output: 0.9055236689456472
random()              output: 0.8572220665948553
random()              output: 0.16923464144969635
The roll of two fair dice:
trunc(random()*6+random()*6)+2  output: 4
trunc(random()*6+random()*6)+2  output: 8
trunc(random()*6+random()*6)+2  output: 6
trunc(random()*6+random()*6)+2  output: 9
trunc(random()*6+random()*6)+2  output: 11
```

13-Thirteenth example Negative-based powers

```5 [^] -2 -> 0.04
-5 [^] -2 -> 0.04
-5 [^] -3 -> -0.008
5 [^] -3 -> 0.008
125 [^] 1/3 -> 5
125 [^] -1/3 -> 0.2

-2 [^] -1/3 -> NaN                                                                1 dispari
-2 ^ (-1/3) = -2 ^ -1 ^ (1/3) = (-1/2) ^ (1/3)
1/2 [^] 1/3 -> 0.7937005259840998
[+/-] 0.7937005259840998 -> -0.7937005259840998

-2 [^] -4/3 -> NaN                                                                4 pari
-2 ^ (-4/3) = -2 ^ -1 ^ (4/3) = (-1/2) ^ (4/3) = (1/2) ^ (4/3)
1/2 [^] 4/3 -> 0.3968502629920499

(-5/3)^(-5/3) = (-5/3)^(-1)^(5/3) = (-3/5)^(5/3) = -(3/5)^(5/3) = -0.426827...    5 dispari
(-2/3)^(-2/3) = (-2/3)^(-1)^(2/3) = (-3/2)^(2/3) = (3/2)^(2/3) = 1.31037...       2 pari

(-2)^(-1/4), (-5/2)^(-5/2), (-a)^(m/n) [-a < 0, m/n simplified, n even] are not defined

WolframAlpha
(-2)^(-1/3)  (choose "Use the real valued root")
= -2^(2/3)/2 = -0.7937005...

(-5/2)^(-5/2) (I cannot choose "Use the real valued root")```

14-Fourteenth example Use of M and other "letters"

The value put in (i) can be used in the "input" windows (both the 2 input - (a),(b) - and the 1 input one - (d)) using the letter M (it is automatically transformed into the value it represents).  In (d) M can also be used within a more complex term (see);  an example: 3*M*M - M/2 + 7/(M+1)

Another example: study of  lim x → 0 cos(sin(1/x)*x).  I put cos(sin(1/M)*M) in the "1 input" window and 1, 1e-1, 1e-2, ... in the "M" window:

cos(sin(1/1e-8)*1e-8) = 1 (0 after units)     [read from bottom to top]
cos(sin(1/1e-7)*1e-7) = 0.9999999999999991 (0 after units)
cos(sin(1/1e-6)*1e-6) = 0.9999999999999387 (0 after units)
cos(sin(1/1e-5)*1e-5) = 0.999999999999936 (0 after units)
cos(sin(1/1e-4)*1e-4) = 0.9999999995329992 (0 after units)
cos(sin(1/1e-3)*1e-3) = 0.9999996581351323 (0 after units)
cos(sin(1/1e-2)*1e-2) = 0.9999871797192685 (0 after units)
cos(sin(1/1e-1)*1e-1) = 0.9985205700839945 (0 after units)
cos(sin(1/1)*1) = 0.6663667453928805 (0 after units)
cos(sin(1/M)*M)

Another example: the derivative of x³+1 in 4 (M = 1, 1e-1, 1e-2, ...):

( (pow(4+1e-5,3)+1)-(pow(4,3)+1) )/ 1e-5 = 48.00011999748221
( (pow(4+1e-4,3)+1)-(pow(4,3)+1) )/ 1e-4 = 48.00120000993502
( (pow(4+1e-3,3)+1)-(pow(4,3)+1) )/ 1e-3 = 48.01200100001779
( (pow(4+1e-1,3)+1)-(pow(4,3)+1) )/ 1e-1 = 49.20999999999992
( (pow(4+1,3)+1)-(pow(4,3)+1) )/ 1 = 61
( (pow(4+M,3)+1)-(pow(4,3)+1) )/ M

That is with   ( (pow(4+M,3)+1)-(pow(4-M,3)+1) )/ (M*2)

( (pow(4+1e-4,3)+1)-(pow(4-1e-4,3)+1) )/ (1e-4*2) = 48.00000000997784
( (pow(4+1e-3,3)+1)-(pow(4-1e-3,3)+1) )/ (1e-3*2) = 48.000001000005454
( (pow(4+1e-2,3)+1)-(pow(4-1e-2,3)+1) )/ (1e-2*2) = 48.000099999998724
( (pow(4+1e-1,3)+1)-(pow(4-1e-1,3)+1) )/ (1e-1*2) = 48.009999999999984
( (pow(4+1,3)+1)-(pow(4-1,3)+1) )/ (1*2) = 49
( (pow(4+M,3)+1)-(pow(4-M,3)+1) )/ (M*2)

Another example: the recursively defined sequence  P(0) = 1, P(n+1) = P(n)*1.5.
We can use (d) and (f).  Put 1 in (f), B*1.5 in (d).

If you click [=] you will gradually get in B:
1     1.5     2.25     3.375     5.0625     7.59375     11.390625   ...

7.59375 * 1.5 = 11.390625
5.0625 * 1.5 = 7.59375
3.375 * 1.5 = 5.0625
2.25 * 1.5 = 3.375
1.5 * 1.5 = 2.25
1 * 1.5 = 1.5
B * 1.5

Another:  y(0) = 1, y(n+1) = (y(n) + T/y(n)) / 2    y(n) → √T     T = 9:

```(3.000000001396984 + 9/3.000000001396984) / 2 = 3
(3.00009155413138 + 9/3.00009155413138) / 2 = 3.000000001396984
(3.023529411764706 + 9/3.023529411764706) / 2 = 3.00009155413138
(3.4 + 9/3.4) / 2 = 3.023529411764706
(5 + 9/5) / 2 = 3.4
(1 + 9/1) / 2 = 5
(B + 9/B) / 2```

Another:  the  series  1 + 1/2 + 1/3! + 1/4! + ...

```1.7182818284590453+1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18 = 1.7182818284590455
B+1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19
1.7182818284590453+1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18 = 1.7182818284590455
B+1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18
...
1.5+1/2/3 = 1.6666666666666667
B+1/2/3
1+1/2 = 1.5
B+1/2```

Taking into account the approximation errors I can take the rounded value 1.7182818284590. I understand that it is e − 1: if I put exp(1) I get 2.718281828459045

The series  Σ n=1..∞ (2-n +3-n ) / n.  I put 0 in B,  1 in A,  B + ( pow(2,-A)+pow(3,-4) )/A  in B  and click [=],  then put 2 in A and click [=],  then 3 in A and [=], …:

```0+(pow(2,-1)+pow(3,-1))/1 = 0.8333333333333333  (0 after units)
0.8333333333333333+(pow(2,-2)+pow(3,-2))/2 = 1.0138888888888888  (0 before units)
1.0138888888888888+(pow(2,-3)+pow(3,-3))/3 = 1.067901234567901  (0 before units)
1.067901234567901+(pow(2,-4)+pow(3,-4))/4 = 1.0866126543209875  (0 before units)
...
1.0986122838857282+(pow(2,-24)+pow(3,-24))/24 = 1.0986122863694026  (0 before units)
1.0986122863694026+(pow(2,-25)+pow(3,-25))/25 = 1.0986122875615427  (0 before units)```
If I put 1.09861229 in WolframAlpha I have that it is the approximation of log(3).

Note. In (a) and (b) you can write A, B, C, M and Q:

but you cannot write more complex terms containing these variables:

15-Fifteenth example Use of integers

Initial sequences of positive integers can be useful for various activities.  Below you can find them.  An example.  The sum, mean and median of the squares of the first 100 positive integers. The [N] key generates the numbers 1, 2, ..., N. We put in (g) 100 and click [N]:

If I put 2 in (j), by clicking "data^Q" I get:
1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, ..., 9604, 9801, 10000
With  [copy]  I copy these values into the "data" and click "sum", "mean", "median"
sum = 338350     mean=3383.5     median=2500

16-Sixteenth example Figures displayed

The results of an operation are rounded to 17 digits but the last digit is not reliable. It is convenient (possibly using Round) to round to fewer digits, as it is necessary to do in all contexts:

```asin(0.5) = 0.5235987755982989
= 30.000000000000004 ^
6 / 8 produces 0.75
0.6 / 0.8 produces 0.7499999999999999
```

17-Seventeenth example Greatest common divisor / Least common multiple  -  Simplification of fractions

The [DiMu] key prints the greatest common divisor (massimo comune divisore) and least common multiple (minimo comune multiplo) of a sequence of positive integers.

The [simpl.fract.] key prints the simplification of the fraction introduced in (a) and (b):

For this it takes a few seconds:  12345678 / 87654321 = 1371742 / 9739369
For this it takes a few minutes:  123456789 / 987654321 = 13717421 / 109739369

18-Eighteenth example.

The order of magnitude of the results is also displayed:

```1 / (37 * 85 * 61) = 0.0000052125413745471604  (5 (after units)

pow(37 * 85 * 61, 2) = 36804504025  (11 before units)

36804504025 round to 10^ digit before units : 40000000000
= 0.4 * 10^11```

19-Nineteenth example.   Again on the use of the [ N ] key

The [N] key generates the numbers 1, 2, ..., N, which you can then transform with the [data ...] keys if you want. An example.

With  [N]  I generate  1, 2, ..., 20.

With 3 in [Q] and  [data^Q]  I get the outputs:
1, 8, 27, 64, 125, 216, 343, 512, 729, 1000, 1331, 1728, 2197, 2744, 3375, 4096, 4913, 5832, 6859, 8000
which I then copy in the box with [copy]:

If N = 20  1³+2³+...+N³ = 44100.  I verify that the same value I get with (N·(N+1)/2)².

20-Twentieth example.
• To study how the data 5.0625,7.59375,11.390625,17.0859375,25.62890625,38.443359375 vary I can put the data in (g). Then, if I click [log] I get the logarithm of them.

It seems to me that 1.6218604324326575, 2.0273255405408217, 2.4327906486489863, 2.8382557567571505, 3.243720864865315, 3.6491859729734792 has about the same difference. I check this with the "repeated differences" script. I get:
0.40546510810816416,0.4054651081081646,0.40546510810816416,0.4054651081081646,0.40546510810816416
If I calculate [exp] of 0.40546510810816416 I obtain 1.4999999999999996, that is 1.5.
So starting from 5.0625 I get the other data by multiplying repeatedly by 1.5.

• If I put 1e5, 1e10, 1e20, 1e25, 1e50 in (g) and if I click [Log] I get 5, 10, 20, 25, 50.

21-Twenty-first example.
• If in (g) I put 4000 and I click [rand] I have 4000 random numbers uniformly distributed in [0,1]. If I click [median], [mean], [var], [sqm], [sd] I get (more or less) the following outputs:
median = 0.5093
1^,3^ quartile, diff.: 0.257 0.7573 0.5003
mean = 0.506052625
variance = 0.08317089695810909
scarto quad. medio (sq.root of var./theoret.st.dev.) = 0.288393649302666
experimental standard dev. = sqm*√(4000/3999) = 0.2884297052694635

Theoretical values:
median = 0.5
1^,3^ quartile, diff.: 0.25 0.75 0.5
mean = 0.5
variance = 1/12 = 0.08333...
scarto quad. medio (sq.root of var./theoret.st.dev.) = 1/√12 = 0.2886751345948128...

If in (g) I put 4000 and I click [rand*] I have 4000 products of 4000 pairs of random numbers uniformly distributed in [0,1]. If I click [median], [mean], [var], [sqm], [sd] I get (more or less) the following outputs:
median = 0.1904
1^,3^ quartile, diff.: 0.0709 0.388 0.3171
mean = 0.252405
variance = 0.04844079813
scarto quad. medio (sq.root of var./theoret.st.dev.) = 0.22009270349105253
experimental standard dev. = 0.22012022023848657

22-Twenty-two example.
• If in (g) I put some numbers and I click [geo] I have the geometric mean of them [(x1·x2·...xN)^(1/N)].  An example:
Three machines work in series: the first has an efficiency of 89%, the second of 51%, the third of 70%. What is the overall efficiency?

89, 51, 70
geometric mean = 68.23691869135777

68% is the overall efficiency.

23-Twenty-three example.
• If in (g) I put some numbers and I click [arm] I have the harmonic mean of them [the harmonic mean of N numbers is the reciprocal of the mean of their reciprocals: ; N/(1/x1+1/x2+...1/xN)].  An example:
John trains. He travels the same road uphill at a speed of 11.6 km/h and then downhill at a speed of 16.4 km/h. What was his average speed?

11.6, 16.4
harmonic mean = 13.588571428571429

13.6 is the average speed.

24-Twenty-four example.
• If in (d) I put a function F of the variable Q and in (a) and (b) the endpoints of an interval [a,b] in which F changes sign, by repeatedly clicking [EQ] I find increasingly better approximations of the solution of the equation  F(Q) = 0.
An example:  solution of  sin(x)+cos(x) = 1/2,  1 < x < 3:
I put  sin(Q) + cos(Q) - 1/2  in (d)1 in (a)3 in (b) and repeatedly click [EQ]

1    3
1    2     dif=1   Q=1.5   F(Q)= -0.6778609491310195
1.5    2     dif=0.5   Q=1.75   F(Q)=0.28069138927514836
1.75    2     dif=0.25   Q=1.875   F(Q)=0.1494452407514921
. . .
1.9921875    1.99609375     dif=0.00390625   Q=1.994140625   F(Q)= -0.004262539195924703
. . .
1.9948273662856364    1.9948273662856373     dif=8.881784197001252e-16   Q=1.9948273662856368   F(Q)=3.3306690738754696e-16
1.9948273662856368    1.9948273662856373     dif=4.440892098500626e-16   Q=1.994827366285637   F(Q)=1.1102230246251565e-16

If you click  [ \ print EQ/m/M ]  at any time, you can print in k the last output, for example:
Q= 1.9948273662856368  dif= 8.881784197001252e-16  F(Q)= 3.3306690738754696e-16

 25-Twenty-five example. • If in (d) I put a function F of the variable Q and in (a) and (b) the endpoints of an interval [a,b] in which the graph is ∪, by repeatedly clicking [m] I find increasingly better approximations of the abscissa of the minimum of F.• If in (d) I put a function F of the variable Q and in (a) and (b) the endpoints of an interval [a,b] in which the graph is ∩, by repeatedly clicking [M] I find increasingly better approximations of the abscissa of the maximum of F. An example:max of  sin(x)*cos(x)/sqrt(x), 0.1 < x < 1,  min of  sin(x)*cos(x)/sqrt(x), 2 < x < 3

 sin(Q)*cos(Q)/sqrt(Q)I findmax = 0.601918331 in x = 0.58278058min = -0.327613101 in x = 2.30210838      or with more digits (*) [ graph made by this script ]
See the maximum:
0.1    1
0.4    1     dif=0.6   Q=0.7   F(Q)=0.578019320165425
0.4    0.8     dif=0.4   Q=0.6   F(Q)=0.5802036371115205
. . .
0.582780544716858    0.5827806261108122     dif=8.139395413220285e-8   Q=0.582780585413835   F(Q)=0.6019183307462506
0.5827805718481761    0.5827806261108122     dif=5.42626360511278e-8   Q=0.5827805989794941   F(Q)=0.6019183307462517
0.5827805718481761    0.5827806080232668     dif=3.6175090700751866e-8   Q=0.5827805899357215   F(Q)=0.6019183307462517
Q = 0.58278059    F(Q) = 0.601918330746252
The minimum:
1    3
Q= 2.333333333333333    dif= 1.3333333333333335    F(Q)= -0.20039570316435676
. . .
Q= 2.302108378057242    dif= 8.03890904954585e-8    F(Q)= -0.3276131013757068
Q= 2.3021083825233024    dif= 3.572848461530498e-8    F(Q)= -0.3276131013757071
Q= 2.3021083884780493    dif= 2.381898989156639e-8    F(Q)= -0.3276131013757071
Q = 2.3021084    F(Q) = -0.32761310137571

 (max with WolframAlpha: x = 0.5827805926036056534169589889792803345672694238465...; Geogebra (see the figure on the right) would give 0.5827805931334, where 31334 has no meaning!!! min with WolframAlpha: x = 2.302108388600288257297986236145239658413895868...; Geogebra would give 2.3021083884222, where 4222 has no meaning!!!)

If you click  [ \ print EQ/m/M ]  at any time, you can print in k the last output.

With WolframAlpha  max sin(x)*cos(x)/sqrt(x)  give (and represent) all the values:

To find the inflection points, see  28 .

 Another example.A certain phenomenon is governed by the law y = (x*sin(x)+sqrt(x)-x*x)3-x4 with x between 0 and 0.8. What is the maximum value of y and for which x does it occur? From the graph it may seem that x=0.6 and y=0.3, but what if I want the values with four significant digits? So let's look for values!pow(Q*sin(Q)+sqrt(Q)-Q*Q,3)-pow(Q,4)

```0     0.8
Q= 0.5333333333333334   dif= 0.5333333333333334    F(Q)= 0.20983774752837242
...
Q= 0.5993273190595687  dif= 1.4291393957144294e-8  F(Q)= 0.2980093461812493
Q= 0.5993273166776696  dif= 9.527595934422095e-9   F(Q)= 0.29800934618124975
Q= 0.5993273150897369  dif= 6.351730585940629e-9   F(Q)= 0.2980093461812497
Q= 0.5993273161483588  dif= 4.234487094301187e-9   F(Q)= 0.2980093461812495
Q= 0.5993273154426109  dif= 2.8229913962007913e-9  F(Q)= 0.2980093461812496```

We can take  x = 0.5993273,  y = 0.29800934618125, or, for our problem,  x = 0.5993,  y = 0.2980.  Note that Geogebra, with  Max( (x*sin(x)+sqrt(x)-x*x)^3-x^4, 0,0.8), would have provided x = 0.6, y = 0.3!!!  With WolframAlpha, however, with  max (x*sin(x)+sqrt(x)-x*x)^3-x^4 from 0 to 0.8, I would have obtained y ≈ 0.298009 at x ≈ 0.599327 correctly.

 Another:  max of  x → √(x2+0.6)-√(x4+0.9)                                                         The (symmetrical) graph with this script → With Geogebra (only one digit!)     and with WolframAlpha:

Let's find the maximum (on the right) with our calculator.  In (d) I put   sqrt(Q*Q+0.6)-sqrt(pow(Q,4)+0.9)   In (a) and (b) for example 0 and 2. Them I click [M]:

0     2
Q= 0.6666666666666666   dif= 1.3333333333333333   F(Q)= -0.24935633133479973
...
Q= 0.7149497595364046   dif= 1.0586217680241816e-8   F(Q)= -0.02351338855942331
Q= 0.714949757772035    dif= 7.057478490501978e-9    F(Q)= -0.02351338855942353
Q= 0.7149497565957885   dif= 4.704985623327218e-9   F(Q)= -0.02351338855942353
Q= 0.7149497552888482   dif= 2.091104733814575e-9   F(Q)= -0.02351338855942353
Q= 0.7149497549403308   dif= 1.3940698595504841e-9   F(Q)= -0.02351338855942342
Q= 0.7149497547079857   dif= 9.293799063669894e-10   F(Q)= -0.02351338855942342

Let's take Q = 0.7149498   (and  F(Q) = -0.023513388559423)

26-Twenty-six example.
• By clicking [F] I can tabulate the function of the variable Q that I put in (d) using the input that I put in (g).

An example. F: x → sin(x)*cos(x)/sqrt(x) is the function considered in 25. I put sin(Q)*cos(Q)/sqrt(Q) in (d) and the input  0, 0.5, 1, 1.5, 2, 2.5, 3 in (g), and click [F]:

I have:
F(data):
NaN, 0.5950098395293859, 0.4546487134128408, 0.057612002040687366, -0.2675700882255682, -0.303238481156041, -0.08066030655045163

If in (g) I put  0.1, 0.5, 1, 1.5, 2, 2.5, 3  I have:
F(data):
0.314123793266912, 0.5950098395293859, 0.4546487134128408, 0.057612002040687366, -0.2675700882255682, -0.303238481156041, -0.08066030655045163

[Then I search max between 0.1 and 1.5, min between 1.5 and 3]

Another example:   lim x → 0  sin(x)/x
(d)     sin(Q)/Q
(g)     1,1e-1,1e-2,1e-3,1e-4,1e-5,1e-6,1e-7,1e-8
F(data):
0.8414709848078965, 0.9983341664682815, 0.9999833334166665, 0.9999998333333416, 0.9999999983333334, 0.9999999999833332, 0.9999999999998334, 0.9999999999999983, 1

Another example:   Dx  sin( x^2/(x+1) ), x=3
(d)     ( sin( (3+Q)*(3+Q) / ((3+Q)+1) ) - sin( (3)*(3) / ((3)+1) ) ) / Q
(g)     1e-1,1e-2,1e-3,1e-4,1e-5
F(data):
-0.6232826115245005, -0.5924224266717792, -0.5892644358592714, -0.5889479447229728, -0.5889162887129373

If I use (F(x+dx)-F(x-dx))/(2*dx) instead of (F(x+dx)-F(x))/dx:

(d)     ( sin( (3+Q)*(3+Q) / ((3+Q)+1) ) - sin( (3-Q)*(3-Q) / ((3-Q)+1) ) ) / (Q*2)
(g)     1e-1,1e-2,1e-3,1e-4,1e-5,1e-6
F(data):
-0.588139907507193, -0.5889050390623707, -0.5889126939798706, -0.5889127705316355, -0.5889127712987996, -0.5889127713820663

I can take: -0.588912771.
If I calculate the derivative formally, I get 15/16*cos(9/4), that is -0.5889127713025679.

Note that in the computation of F(x+dx)-F(x-dx), from a certain point on, rounding errors become predominant:  F(x+dx) and F(x-dx) tend to have more and more equal leading digits.  If I analyzed the subsequent releases I would understand that -0.5889127713 is the best approximation I can assume:
0.5889126939798706 - 0.5889127705316355 = -7.65517649270464e-8
0.5889127705316355 - 0.5889127712987996 = -7.671641100159832e-10
0.5889127712987996 - 0.5889127713820663 = -8.326672684688674e-11  the variation is no longer regular; a better approximation: -0.5889127712987996 - 7.7e-12 = -0.5889127713064995 → -0.5889127713

27-Twenty-seven example.
• By clicking [ ] I can calculate the integral of the function of the variable Q that I put in (d) from the value in (a) to the value in (b). The integral is calculated by approximating it with N rectangles; N is the number in (c). The output is in (f).

I want to calculate  [0,3] |x·(x−2)| dx. I put abs(Q*(Q-2)) in (d), 0 in (a), 3 in (b) and, for example, 125 in (c). Then put 250, 500, ...

```abs(Q*(Q-2))
a = 0, b = 3, n = 125, Integral =  2.6665862400000004
a = 0, b = 3, n = 250, Integral =  2.6666467199999997
a = 0, b = 3, n = 500, Integral =  2.6666616600000004
a = 0, b = 3, n = 1000, Integral = 2.666665417500002
a = 0, b = 3, n = 2000, Integral = 2.6666663540625017```

The waiting time increases as N increases, but generally for practical purposes it is sufficient to stop at a few hundred or a few thousand. In this case I understand that the integral is 2.666… = 2+2/3 = 8/3  (Geogebra would give 2.67!!!)

The integral of x → exp(x²) from 0 to 3:

```exp(Q*Q)
a = 0, b = 3, n = 125, Integral =  1443.379101514932
a = 0, b = 3, n = 250, Integral =  1444.2534633194941
a = 0, b = 3, n = 500, Integral =  1444.4721983533295
a = 0, b = 3, n = 1000, Integral = 1444.5268911548826
a = 0, b = 3, n = 2000, Integral = 1444.5405649205688```

[0,3] exp(x²) dx = 1444.5. If I wanted more digits:

```exp(Q*Q)
a = 0, b = 3, n = 4000, Integral =  1444.5439833973219
a = 0, b = 3, n = 8000, Integral =  1444.5448380187215
a = 0, b = 3, n = 16000, Integral = 1444.5450516742062
a = 0, b = 3, n = 32000, Integral = 1444.5451050880881```

[0,3] exp(x²) dx = 1444.5451. If I want more digits and if I have a lot of time...:  1444.5451228927.  By using WoframAlpha:  1444.54512289271415471376001340596...   (Geogebra would give 1444.55)

Another example:[0,4.5] |sin(x²)|-|cos(x³)| dx

```abs(sin(pow(Q,2))) - abs(cos(pow(Q,3)))
a = 0, b = 4.5, n = 125,  Integral = -0.4679791226279312
a = 0, b = 4.5, n = 250,  Integral = -0.4707530135143931
a = 0, b = 4.5, n = 500,  Integral = -0.4742344803647374
a = 0, b = 4.5, n = 1000, Integral = -0.4751748002819134
a = 0, b = 4.5, n = 2000, Integral = -0.4750365807332294  and,if I have enough time:
a = 0, b = 4.5, n = 4000, Integral = -0.47508391059948935
a = 0, b = 4.5, n = 8000, Integral = -0.4750711622083618```

[0,4.5] |sin(x²)|-|cos(x³)| dx = -0.475, or[0,4.5] |sin(x²)|-|cos(x³)| dx = -0.4751.  By using WoframAlpha:  -0.475066  (Geogebra would give -0.47 while the correct rounding is -0.48)

28-Twenty-eight example.
Inflection points are also easy to find.  Consider the function F: x → sin(x)*cos(x)/sqrt(x) in [0,3] examined in  25 .  With WolframAlpha it is easy to locate inflection points. You can also find them with our calculator. Let's see how to do it.

Let us consider the following figure.  Going through P (going to the right) the derivative is decreasing.  Near Q there is a descending inflection: going to the right one passes from a situation in which the derivative decreases to one in which it increases: the derivative has a minimum.  Near S there is an ascending inflection: going to the right one passes from a situation in which the derivative increases to one in which it decreases: the derivative has a maximum.

 The our function F has a descending inflection. We search between x=1 and x=2 where the derivative is at a minimum. We approximate the derivative with  (F(x+dx)-F(x-dx)) / (dx*2), choosing dx suitably small. In (d) I put:( sin(Q+M)*cos(Q+M)/sqrt(Q+M)-sin(Q-M)*cos(Q-M)/sqrt(Q-M) )/(M*2) In (a) and (b) I put 1 and 2. In (i) I put for example 1e-4 (dx = 0.0001). Then I click [m] ...

1    2
Q= 1.3333333333333333    dif= 0.6666666666666665    F(Q)= -0.791345315359314
. . .
Q= 1.3796813417527156    dif= 0.000017600945796614198    F(Q)= -0.8474569180012131

If I want, then I can put 1e-5 in (i) and keep clicking [m]

. . .
Q= 1.379681691840115    dif= 0.0000015452133483861985    F(Q)= -0.8474569226833705

I can take x = 1.379682 as the abscissa of the inflection point.

 The second example (see). With WolframAlpha I have: inflection point of (x*sin(x)+sqrt(x)-x*x)^3-x^4, 0 < x < 0.6     x = 0.301974, F(x) = 0.15638 Using the script:

In (d) I put:
(( pow((Q+M)*sin(Q+M)+sqrt(Q+M)-(Q+M)*(Q+M),3) - pow(Q+M,4) ) - ((pow((Q-M)*sin(Q-M)+sqrt(Q-M)-(Q-M)*(Q-M),3) - pow(Q-M,4) ) ))/(2*M)

In (a) and (b) I put 0.1 and 0.6.

In (i) I put for example 1e-4 (dx = 0.0001).

Then I click [M]

. . .
Q= 0.30197421896315246   dif= 3.014590893579694e-8   F(Q)= 0.6935685021543236

I take 0.301974

 29-Twenty-nine example.     Use of  random() In (a), (b), (d) and in (i), (j), (c), (f),  you cas use random(), that generates a random number in the range (0, 1). Some examples: random() in (a) and (b) if I press [+] produces in (c) 1.1435059573017265 or 0.8256547221268928 or 0.3782536387162785 or 1.4408008888308879 or ... floor(random()*6)+1 in (a) and (b), if I press [+] produces in (c) 5 or 9 or 3 or 7 or ... (roll of two dice) floor(random()*6)+1 in (i), (j) and M+Q in (d), if I press [=] produces analogous outputs in (f) floor(random()*6+random()*6)+2 in (d), if I press [=] produces analogous outputs in (f).... Using [ ∫ ] allows you to calculate the average of various types of random values. Two example:

In (a) 0, in (b) 1, in (c) 500, in (d)  floor(random()*6)+floor(random()*6)+2. If I press [=] I get (as "Integral") the mean of x1,...,x500 where xi is the outcome of the roll of two fair dice. For example;
floor(random()*6)+floor(random()*6)+2     a = 0, b = 1, n = 500, Integral = 6.908

In (a) 0, in (b) 3, in (c) 200, in (d)  pow(random(),5). If I press [=] I get (as "Integral") the mean of x1,...,x200 where xi is R^5, R random number in (0,3). For example;
pow(random(),5)     a = 0, b = 3, n = 200, Integral = 0.4808102184918681

For the generation of single random numbers  see.
For the generation of other random numbers  see.