Actual timed Mathomatic output from the demo script
Mathomatic version 15.7.2
Copyright (C) 1987-2012 George Gesslein II.
200 equation spaces available in memory,
1920 kilobytes per equation space.
HTML color mode enabled; manage by typing "help color".
1−> clear all
1−> ; Some symbolic differentiation examples follow.
1−>
1−> ; Take the derivative of the absolute value function:
1−> |x|
1
#1: (x^2)^–
2
1−> derivative ; The result is the sign function sgn(x), which gives the sign of x.
Differentiating with respect to (x) and simplifying...
x
#2: –––––––––
1
((x^2)^–)
2
2−> repeat echo *
*******************************************************************************
2−> ; Mathomatic can differentiate anything that doesn't require symbolic logarithms.
2−> y=e^(1+1/x)
1
#3: y = ê^(1 + –)
x
3−> derivative ; The first order derivative is:
Differentiating the RHS with respect to (x) and simplifying...
1
-(ê^(1 + –))
x
#4: y' = ––––––––––––
x^2
4−> derivative ; The second order derivative is:
Differentiating the RHS with respect to (x) and simplifying...
1 1
(ê^(– + 1))·(– + 2)
x x
#5: y'' = –––––––––––––––––––
x^3
5−> expand fraction ; Perhaps easier to read:
1 1
(ê^(– + 1)) 2·(ê^(– + 1))
x x
#5: y'' = ––––––––––– + –––––––––––––
x^4 x^3
5−> repeat echo *
*******************************************************************************
5−> ; A Taylor series demonstration:
5−> y=x_new^n ; x_new is what we want, without using the root operator.
#6: y = x_new^n
6−> x_new ; It is easily solved for in Mathomatic.
1
#6: x_new = y^–
n
6−> y ; But we want an algorithm to compute it without using non-integer exponentiation.
#6: y = x_new^n
6−> taylor x_new 1 x_old ; build the (nth root of y) iterative approximation formula
Computing the Taylor series of the RHS and simplifying...
1 derivative applied.
#7: y = x_old^n + (n·(x_old^(n − 1))·x_new) − (n·x_old^n)
7−> solve verify x_new ; solve for the output variable, verifying the result
(y − x_old^n)
#7: x_new = (––––––––––––– + 1)·x_old
(x_old^n·n)
Solution verified.
7−> simplify ; convergent nth root approximation formula:
y
(––––––– − 1)
x_old^n
#7: x_new = x_old·(––––––––––––– + 1)
n
7−> copy ; "calculate x_old 10000" tests this formula, if you would like to see for yourself.
y
(––––––– − 1)
x_old^n
#8: x_new = x_old·(––––––––––––– + 1)
n
7−> replace x_old x_new with x ; make x_old (input) and x_new (output) the same
y
(––– − 1)
x^n
#7: x = x·(––––––––– + 1)
n
7−> x ; make sure the formula was correct by solving for x
Removing possible solution: "x = 0".
1
#7: x = y^–
n
7−> repeat echo *
*******************************************************************************
7−> ; Another Taylor series demo:
7−> e^x ; enter the exponential function
#9: ê^x
9−> taylor x 10 0 ; generate a 10th order taylor series of the exponential function
Computing the Taylor series and simplifying...
10 derivatives applied.
x^2 x^3 x^4 x^5 x^6 x^7 x^8 x^9 x^10
#10: 1 + x + ––– + ––– + ––– + ––– + ––– + –––– + ––––– + –––––– + –––––––
2 6 24 120 720 5040 40320 362880 3628800
10−> laplace x ; do a Laplace transform on it
1 1 1 1 1 1 1 1 1 1 1
#11: – + ––– + ––– + ––– + ––– + ––– + ––– + ––– + ––– + –––– + ––––
x x^2 x^3 x^4 x^5 x^6 x^7 x^8 x^9 x^10 x^11
11−> simplify ; show the structure of the result
1
(1 + –)
x
(1 + –––––––)
x
(1 + –––––––––––––)
x
(1 + –––––––––––––––––––)
x
(1 + –––––––––––––––––––––––––)
x
(1 + –––––––––––––––––––––––––––––––)
x
(1 + –––––––––––––––––––––––––––––––––––––)
x
(1 + –––––––––––––––––––––––––––––––––––––––––––)
x
(1 + –––––––––––––––––––––––––––––––––––––––––––––––––)
x
(1 + –––––––––––––––––––––––––––––––––––––––––––––––––––––––)
x
#11: –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
x
11−> laplace inverse x ; undo the Laplace transform
x^2 x^3 x^4 x^5 x^6 x^7 x^8 x^9 x^10
#12: 1 + x + ––– + ––– + ––– + ––– + ––– + –––– + ––––– + –––––– + –––––––
2 6 24 120 720 5040 40320 362880 3628800
12−> compare with 10 ; check the result
Comparing #10 with #12...
Expressions are identical.
Finished reading file "demo.in".
12−>
End of input.
real 0.03 user 0.03 sys 0.00 seconds total execution time.
www.mathomatic.org