A OCaml program to derivate functions.
derivation [-v VARIABLE] [-e EXPRESSION] [-h]
Option | Description | Default |
---|---|---|
-v | Variable to derivate | |
-e | Expression to derivate | |
-h | Show help |
If no option is given, the program will read from stdin. And the default derivation variable is x
.
$ derivation -v x -e "x^2 + 2*x + 1"
2x + 2
$ derivation -v x -e "x^2 + 2*x + 1" | derivation -v x
2
$ derivation -v x -e "(x*y)^2 + 2 * x * y + 1" | derivation -v y
2 * x * y + 2y * x + 2
The program can derivate the following functions:
sin
cos
tan
exp
ln
sqrt
asin
acos
atan
log10
log2
abs