aboutsummaryrefslogtreecommitdiff
path: root/src/hyper/pages/exdiff.ht
blob: f2f302621103adb98114f0814088a2595c453e48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
% Copyright The Numerical Algorithms Group Limited 1991.
% Certain derivative-work portions Copyright (C) 1988 by Leslie Lamport.
% All rights reserved

% Title: Differentiation

%  Author: Clifton J. Williamson
%  Date created: 1 November 1989
%  Date last updated: 1 November 1989

\begin{page}{ExDiffBasic}{Computing Derivatives}
\beginscroll
To compute a derivative, you must specify an expression and a variable
of differentiation.
For example, to compute the derivative of {\em sin(x) * exp(x**2)} with respect to the
variable {\em x}, issue the following command:
\spadpaste{differentiate(sin(x) * exp(x**2),x)}
\endscroll
\autobuttons\end{page}

\begin{page}{ExDiffSeveralVariables}{Derivatives of Functions of Several Variables}
\beginscroll
Partial derivatives are computed in the same way as derivatives of functions
of one variable: you specify the function and a variable of differentiation.
For example:
\spadpaste{differentiate(sin(x) * tan(y)/(x**2 + y**2),x)}
\spadpaste{differentiate(sin(x) * tan(y)/(x**2 + y**2),y)}
\endscroll
\autobuttons\end{page}

\begin{page}{ExDiffHigherOrder}{Derivatives of Higher Order}
\beginscroll
To compute a derivative of higher order (e.g. a second or third derivative),
pass the order as the third argument of the function 'differentiate'.
For example, to compute the fourth derivative of {\em exp(x**2)}, issue the
following command:
\spadpaste{differentiate(exp(x**2),x,4)}
\endscroll
\autobuttons\end{page}

\begin{page}{ExDiffMultipleI}{Multiple Derivatives I}
\beginscroll
When given a function of several variables, you may take derivatives repeatedly
and with respect to different variables.
The following command differentiates the function {\em sin(x)/(x**2 + y**2)}
first with respect to {\em x} and then with respect to {\em y}:
\spadpaste{differentiate(sin(x)/(x**2 + y**2),[x,y])}
As you can see, we first specify the function and then a list of the variables
of differentiation.
Variables may appear on the list more than once.
For example, the following command differentiates the same function with
respect to {\em x} and then twice with respect to {\em y}.
\spadpaste{differentiate(sin(x)/(x**2 + y**2),[x,y,y])}
\endscroll
\autobuttons\end{page}

\begin{page}{ExDiffMultipleII}{Multiple Derivatives II}
\beginscroll
You may also compute multiple derivatives by specifying a list of variables
together with a list of multiplicities.
For example, to differentiate {\em cos(z)/(x**2 + y**3)}
first with respect to {\em x},
then twice with respect to {\em y}, then three times with respect to {\em z},
issue the following command:
\spadpaste{differentiate(cos(z)/(x**2 + y**3),[x,y,z],[1,2,3])}
\endscroll
\autobuttons\end{page}

\begin{page}{ExDiffFormalIntegral}{Derivatives of Functions Involving Formal Integrals}
\beginscroll
When a function does not have a closed-form antiderivative, \Language{}
returns a formal integral.
A typical example is
\spadpaste{f := integrate(sqrt(1 + t**3),t) \bound{f}}
This formal integral may be differentiated, either by itself or in any
combination with other functions:
\spadpaste{differentiate(f,t) \free{f}}
\spadpaste{differentiate(f * t**2,t) \free{f}}
\endscroll
\autobuttons\end{page}