2.4. Derivate

2.4.1. Example

derivate(formula, var)
Parameters:
  • formula – The unevaluated formula
  • var – The unevaluated derivation variable

Examples :

$ eq format "derivate( x^4 + sin(x^2) - ln(x) * exp(x) + 7, x )"
   4      / 2\          x      
d x  + sin\x / - ln(x).e  + 7  
------------------------------ 
d x
$ eq eval "derivate( x^4 + sin(x^2) - ln(x) * exp(x) + 7, x )"
                     /  x            \ 
   3          / 2\   | e            x| 
4.x  + 2.x.cos\x / - |---- + ln(x).e | 
                     \ x             /

You can force evaluation in formula and var.

2.4.2. Non-allowed derivations

Now it’s time to try a derivative with problems, by adding a non-variable inside it’s definition.

$ eq eval "derivate( x^4 + sin(x^2) - ln(x) * exp(x) + 7, x * x )"; true
Sorry your derivation doesn't have a good variable specification
   4      / 2\          x      
d x  + sin\x / - ln(x).e  + 7  
------------------------------ 
d x.x                          
                               

#

What you can see after the error text and the error expression, is the Eq’s favourite error value. <code>#</code> cannot be typed into expression, but it’s often generated to indicate error. If you find some, well, good luck :)

Table Of Contents

Previous topic

2.3. sum

Next topic

2.5. integrate

This Page