home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
calculat
/
sm30a.zip
/
SYMBMATH.H37
< prev
next >
Wrap
Text File
|
1993-11-07
|
2KB
|
67 lines
4.5 Differentiation
Differentiate an expression y with respest to x by
d(y, x)
Differentiate a simple function f(x) by
f'(x)
Differentiate y in order ( order > 0 ) by
d(y, x, order)
Differentiate y when x = x0 by
diff(y, x = x0)
Differentiate y when x = x0 in order (order > 0) by
diff(y, x = x0, order)
Example 4.5.1.
Differentiate sin(x) and x^(x^x).
IN: sin'(x) # sin'(x) is the same as d(sin(x), x).
OUT: cos(x)
IN: d(x^(x^x), x)
OUT: x^(x^x) (x^(-1 + x) + x^x ln(x) (1 + ln(x)))
If you differentiate f(x) by f'(x), x must be a simple variable and f(x)
must be not evaluated.
f'(x0) is different from diff(f(x), x=x0). f'(x0) first evaluates
f(x0), then differentiate the result of f(x0). But diff(f(x), x=x0) first
differentiate f(x), then replace x with x0.
Note that sin'(x^6) gives cos(x^6) as sin'(x^6) is the same as
d(sin(x^6), x^6), and sin'(0) gives d(0,0) as sin(0) is evaluated to 0
before differentiation. diff(sin(x),x=0) gives 1.
Example 4.5.2.
Differentiate the expression f=sin(x^2+y^3)+cos(2*(x^2+y^3)) with respect
to x, and with respect to both x and y.
IN: f:=sin(x^2+y^3)+cos(2*(x^2+y^3))
IN: d(f, x)
OUT: 2 x cos(x^2 + y^3) - 4 x sin(2 (x^2 + y^3))
IN: d(d(f, x), y) # mixed derivative with x and y.
OUT: -6 x y^2 sin(x^2 + y^3) - 12 x y^2 cos(2 (x^2 + y^3))
4.5.1 One-sided derivatives
Differentiate y when x = x0-zero or 0+zero (the left- or right-
sided derivative) by
diff(y, x = x0-zero)
diff(y, x = x0+zero)
Example.
IN: diff(ln(x), x=0)
OUT: discont # discontinulity at x=0
IN: diff(ln(x), x=0-zero) # left-sided derivative at x=0-
OUT: -inf
IN: diff(ln(x), x=0+zero) # right-sied derivative at x=0+
OUT: inf
4.5.2 Defining f'(x)
Defining derivatives is similar to defining rules. You only need
to define derivatives of a simple function, as SymbMath automately apply
the chain rule to its complicated function.
Example 4.5.2.2.
IN: f'(x_) := sin(x)
IN: f'(x)
OUT: sin(x)
IN: f'(x^6) # the same as d(f(x^6), x^6)
OUT: sin(x^6)
IN: d(f(x^6), x)
OUT: 6 x^5 sin(x^6)