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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on September, 20 2006 by texi2html 1.76 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>
-->
<head>
<title>Maxima Manual: 19. Differentiation</title>
<meta name="description" content="Maxima Manual: 19. Differentiation">
<meta name="keywords" content="Maxima Manual: 19. Differentiation">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.76">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
body
{
color: black;
background: white;
margin-left: 8%;
margin-right: 13%;
}
h1
{
margin-left: +8%;
font-size: 150%;
font-family: sans-serif
}
h2
{
font-size: 125%;
font-family: sans-serif
}
h3
{
font-size: 100%;
font-family: sans-serif
}
h2,h3,h4,h5,h6 { margin-left: +4%; }
div.textbox
{
border: solid;
border-width: thin;
/* width: 100%; */
padding-top: 1em;
padding-bottom: 1em;
padding-left: 2em;
padding-right: 2em
}
div.titlebox
{
border: none;
padding-top: 1em;
padding-bottom: 1em;
padding-left: 2em;
padding-right: 2em;
background: rgb(200,255,255);
font-family: sans-serif
}
div.synopsisbox
{
border: none;
padding-top: 1em;
padding-bottom: 1em;
padding-left: 2em;
padding-right: 2em;
background: rgb(255,220,255);
/*background: rgb(200,255,255); */
/* font-family: fixed */
}
pre.example
{
border: none;
padding-top: 1em;
padding-bottom: 1em;
padding-left: 1em;
padding-right: 1em;
background: rgb(247,242,180); /* kind of sandy */
/* background: rgb(200,255,255); */ /* sky blue */
font-family: "Lucida Console", monospace
}
div.spacerbox
{
border: none;
padding-top: 2em;
padding-bottom: 2em
}
div.image
{
margin: 0;
padding: 1em;
text-align: center;
}
-->
</style>
<link rel="icon" href="http://maxima.sourceforge.net/favicon.ico"/>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Differentiation"></a>
<a name="SEC64"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="maxima_18.html#SEC63" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC65" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima_18.html#SEC62" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_20.html#SEC66" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1 class="chapter"> 19. Differentiation </h1>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#SEC65">19.1 Definitions for Differentiation</a></td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr size="6">
<a name="Definitions-for-Differentiation"></a>
<a name="SEC65"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC64" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="maxima_20.html#SEC66" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC64" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC64" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_20.html#SEC66" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 19.1 Definitions for Differentiation </h2>
<dl>
<dt><u>Function:</u> <b>antid</b><i> (<var>expr</var>, <var>x</var>, <var>u(x)</var>) </i>
<a name="IDX591"></a>
</dt>
<dd><p>Returns a two-element list,
such that an antiderivative of <var>expr</var> with respect to <var>x</var>
can be constructed from the list.
The expression <var>expr</var> may contain an unknown function <var>u</var> and its derivatives.
</p>
<p>Let <var>L</var>, a list of two elements, be the return value of <code>antid</code>.
Then <code><var>L</var>[1] + 'integrate (<var>L</var>[2], <var>x</var>)</code>
is an antiderivative of <var>expr</var> with respect to <var>x</var>.
</p>
<p>When <code>antid</code> succeeds entirely,
the second element of the return value is zero.
Otherwise, the second element is nonzero,
and the first element is nonzero or zero.
If <code>antid</code> cannot make any progress,
the first element is zero and the second nonzero.
</p>
<p><code>load ("antid")</code> loads this function.
The <code>antid</code> package also defines the functions <code>nonzeroandfreeof</code> and <code>linear</code>.
</p>
<p><code>antid</code> is related to <code>antidiff</code> as follows.
Let <var>L</var>, a list of two elements, be the return value of <code>antid</code>.
Then the return value of <code>antidiff</code> is equal to <code><var>L</var>[1] + 'integrate (<var>L</var>[2], <var>x</var>)</code>
where <var>x</var> is the variable of integration.
</p>
<p>Examples:
</p>
<table><tr><td> </td><td><pre class="example">(%i1) load ("antid")$
(%i2) expr: exp (z(x)) * diff (z(x), x) * y(x);
z(x) d
(%o2) y(x) %e (-- (z(x)))
dx
(%i3) a1: antid (expr, x, z(x));
z(x) z(x) d
(%o3) [y(x) %e , - %e (-- (y(x)))]
dx
(%i4) a2: antidiff (expr, x, z(x));
/
z(x) [ z(x) d
(%o4) y(x) %e - I %e (-- (y(x))) dx
] dx
/
(%i5) a2 - (first (a1) + 'integrate (second (a1), x));
(%o5) 0
(%i6) antid (expr, x, y(x));
z(x) d
(%o6) [0, y(x) %e (-- (z(x)))]
dx
(%i7) antidiff (expr, x, y(x));
/
[ z(x) d
(%o7) I y(x) %e (-- (z(x))) dx
] dx
/
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>antidiff</b><i> (<var>expr</var>, <var>x</var>, <var>u</var>(<var>x</var>))</i>
<a name="IDX592"></a>
</dt>
<dd><p>Returns an antiderivative of <var>expr</var> with respect to <var>x</var>.
The expression <var>expr</var> may contain an unknown function <var>u</var> and its derivatives.
</p>
<p>When <code>antidiff</code> succeeds entirely,
the resulting expression is free of integral signs (that is, free of the <code>integrate</code> noun).
Otherwise, <code>antidiff</code> returns an expression
which is partly or entirely within an integral sign.
If <code>antidiff</code> cannot make any progress,
the return value is entirely within an integral sign.
</p>
<p><code>load ("antid")</code> loads this function.
The <code>antid</code> package also defines the functions <code>nonzeroandfreeof</code> and <code>linear</code>.
</p>
<p><code>antidiff</code> is related to <code>antid</code> as follows.
Let <var>L</var>, a list of two elements, be the return value of <code>antid</code>.
Then the return value of <code>antidiff</code> is equal to <code><var>L</var>[1] + 'integrate (<var>L</var>[2], <var>x</var>)</code>
where <var>x</var> is the variable of integration.
</p>
<p>Examples:
</p>
<table><tr><td> </td><td><pre class="example">(%i1) load ("antid")$
(%i2) expr: exp (z(x)) * diff (z(x), x) * y(x);
z(x) d
(%o2) y(x) %e (-- (z(x)))
dx
(%i3) a1: antid (expr, x, z(x));
z(x) z(x) d
(%o3) [y(x) %e , - %e (-- (y(x)))]
dx
(%i4) a2: antidiff (expr, x, z(x));
/
z(x) [ z(x) d
(%o4) y(x) %e - I %e (-- (y(x))) dx
] dx
/
(%i5) a2 - (first (a1) + 'integrate (second (a1), x));
(%o5) 0
(%i6) antid (expr, x, y(x));
z(x) d
(%o6) [0, y(x) %e (-- (z(x)))]
dx
(%i7) antidiff (expr, x, y(x));
/
[ z(x) d
(%o7) I y(x) %e (-- (z(x))) dx
] dx
/
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Property:</u> <b>atomgrad</b>
<a name="IDX593"></a>
</dt>
<dd><p><code>atomgrad</code> is the atomic gradient property of an expression.
This property is assigned by <code>gradef</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>atvalue</b><i> (<var>expr</var>, [<var>x_1</var> = <var>a_1</var>, ..., <var>x_m</var> = <var>a_m</var>], <var>c</var>)</i>
<a name="IDX594"></a>
</dt>
<dt><u>Function:</u> <b>atvalue</b><i> (<var>expr</var>, <var>x_1</var> = <var>a_1</var>, <var>c</var>)</i>
<a name="IDX595"></a>
</dt>
<dd><p>Assigns the value <var>c</var> to <var>expr</var> at the point <code><var>x</var> = <var>a</var></code>.
Typically boundary values are established by this mechanism.
</p>
<p><var>expr</var> is a function evaluation,
<code><var>f</var>(<var>x_1</var>, ..., <var>x_m</var>)</code>,
or a derivative,
<code>diff (<var>f</var>(<var>x_1</var>, ..., <var>x_m</var>), <var>x_1</var>, <var>n_1</var>, ..., <var>x_n</var>, <var>n_m</var>)</code>
in which the function arguments explicitly appear.
<var>n_i</var> is the order of differentiation with respect to <var>x_i</var>.
</p>
<p>The point at which the atvalue is established is given by the list of equations
<code>[<var>x_1</var> = <var>a_1</var>, ..., <var>x_m</var> = <var>a_m</var>]</code>.
If there is a single variable <var>x_1</var>,
the sole equation may be given without enclosing it in a list.
</p>
<p><code>printprops ([<var>f_1</var>, <var>f_2</var>, ...], atvalue)</code> displays the atvalues of
the functions <code><var>f_1</var>, <var>f_2</var>, ...</code>
as specified by calls to <code>atvalue</code>.
<code>printprops (<var>f</var>, atvalue)</code> displays the atvalues of one function <var>f</var>.
<code>printprops (all, atvalue)</code> displays the atvalues of all functions for which atvalues are defined.
</p>
<p>The symbols <code>@1</code>, <code>@2</code>, ... represent the
variables <var>x_1</var>, <var>x_2</var>, ... when atvalues are displayed.
</p>
<p><code>atvalue</code> evaluates its arguments.
<code>atvalue</code> returns <var>c</var>, the atvalue.
</p>
<p>Examples:
</p>
<table><tr><td> </td><td><pre class="example">(%i1) atvalue (f(x,y), [x = 0, y = 1], a^2);
2
(%o1) a
(%i2) atvalue ('diff (f(x,y), x), x = 0, 1 + y);
(%o2) @2 + 1
(%i3) printprops (all, atvalue);
!
d !
--- (f(@1, @2))! = @2 + 1
d@1 !
!@1 = 0
2
f(0, 1) = a
(%o3) done
(%i4) diff (4*f(x,y)^2 - u(x,y)^2, x);
d d
(%o4) 8 f(x, y) (-- (f(x, y))) - 2 u(x, y) (-- (u(x, y)))
dx dx
(%i5) at (%, [x = 0, y = 1]);
!
2 d !
(%o5) 16 a - 2 u(0, 1) (-- (u(x, y))! )
dx !
!x = 0, y = 1
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>cartan</b><i> -</i>
<a name="IDX596"></a>
</dt>
<dd><p>The exterior calculus of differential forms is a basic tool
of differential geometry developed by Elie Cartan and has important
applications in the theory of partial differential equations.
The <code>cartan</code> package
implements the functions <code>ext_diff</code> and <code>lie_diff</code>,
along with the operators <code>~</code> (wedge product) and <code>|</code> (contraction
of a form with a vector.)
Type <code>demo (tensor)</code> to see a brief
description of these commands along with examples.
</p>
<p><code>cartan</code> was implemented by F.B. Estabrook and H.D. Wahlquist.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>del</b><i> (<var>x</var>)</i>
<a name="IDX597"></a>
</dt>
<dd><p><code>del (<var>x</var>)</code> represents the differential of the variable <em>x</em>.
</p>
<p><code>diff</code> returns an expression containing <code>del</code>
if an independent variable is not specified.
In this case, the return value is the so-called "total differential".
</p>
<p>Examples:
</p>
<table><tr><td> </td><td><pre class="example">(%i1) diff (log (x));
del(x)
(%o1) ------
x
(%i2) diff (exp (x*y));
x y x y
(%o2) x %e del(y) + y %e del(x)
(%i3) diff (x*y*z);
(%o3) x y del(z) + x z del(y) + y z del(x)
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>delta</b><i> (<var>t</var>)</i>
<a name="IDX598"></a>
</dt>
<dd><p>The Dirac Delta function.
</p>
<p>Currently only <code>laplace</code> knows about the <code>delta</code> function.
</p>
<p>Example:
</p>
<table><tr><td> </td><td><pre class="example">(%i1) laplace (delta (t - a) * sin(b*t), t, s);
Is a positive, negative, or zero?
p;
- a s
(%o1) sin(a b) %e
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>System variable:</u> <b>dependencies</b>
<a name="IDX599"></a>
</dt>
<dd><p>Default value: <code>[]</code>
</p>
<p><code>dependencies</code> is the list of atoms which have functional
dependencies, assigned by <code>depends</code> or <code>gradef</code>.
The <code>dependencies</code> list is cumulative:
each call to <code>depends</code> or <code>gradef</code> appends additional items.
</p>
<p>See <code>depends</code> and <code>gradef</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>depends</b><i> (<var>f_1</var>, <var>x_1</var>, ..., <var>f_n</var>, <var>x_n</var>)</i>
<a name="IDX600"></a>
</dt>
<dd><p>Declares functional dependencies among variables for the purpose of computing derivatives.
In the absence of declared dependence,
<code>diff (f, x)</code> yields zero.
If <code>depends (f, x)</code> is declared,
<code>diff (f, x)</code> yields a symbolic derivative (that is, a <code>diff</code> noun).
</p>
<p>Each argument <var>f_1</var>, <var>x_1</var>, etc., can be the name of a variable or array,
or a list of names.
Every element of <var>f_i</var> (perhaps just a single element)
is declared to depend
on every element of <var>x_i</var> (perhaps just a single element).
If some <var>f_i</var> is the name of an array or contains the name of an array,
all elements of the array depend on <var>x_i</var>.
</p>
<p><code>diff</code> recognizes indirect dependencies established by <code>depends</code>
and applies the chain rule in these cases.
</p>
<p><code>remove (<var>f</var>, dependency)</code> removes all dependencies declared for <var>f</var>.
</p>
<p><code>depends</code> returns a list of the dependencies established.
The dependencies are appended to the global variable <code>dependencies</code>.
<code>depends</code> evaluates its arguments.
</p>
<p><code>diff</code> is the only Maxima command which recognizes dependencies established by <code>depends</code>.
Other functions (<code>integrate</code>, <code>laplace</code>, etc.)
only recognize dependencies explicitly represented by their arguments.
For example, <code>integrate</code> does not recognize the dependence of <code>f</code> on <code>x</code>
unless explicitly represented as <code>integrate (f(x), x)</code>.
</p>
<table><tr><td> </td><td><pre class="example">(%i1) depends ([f, g], x);
(%o1) [f(x), g(x)]
(%i2) depends ([r, s], [u, v, w]);
(%o2) [r(u, v, w), s(u, v, w)]
(%i3) depends (u, t);
(%o3) [u(t)]
(%i4) dependencies;
(%o4) [f(x), g(x), r(u, v, w), s(u, v, w), u(t)]
(%i5) diff (r.s, u);
dr ds
(%o5) -- . s + r . --
du du
</pre></td></tr></table>
<table><tr><td> </td><td><pre class="example">(%i6) diff (r.s, t);
dr du ds du
(%o6) -- -- . s + r . -- --
du dt du dt
</pre></td></tr></table>
<table><tr><td> </td><td><pre class="example">(%i7) remove (r, dependency);
(%o7) done
(%i8) diff (r.s, t);
ds du
(%o8) r . -- --
du dt
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Option variable:</u> <b>derivabbrev</b>
<a name="IDX601"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>derivabbrev</code> is <code>true</code>,
symbolic derivatives (that is, <code>diff</code> nouns) are displayed as subscripts.
Otherwise, derivatives are displayed in the Leibniz notation <code>dy/dx</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>derivdegree</b><i> (<var>expr</var>, <var>y</var>, <var>x</var>)</i>
<a name="IDX602"></a>
</dt>
<dd><p>Returns the highest degree of the derivative
of the dependent variable <var>y</var> with respect to the independent variable
<var>x</var> occuring in <var>expr</var>.
</p>
<p>Example:
</p><table><tr><td> </td><td><pre class="example">(%i1) 'diff (y, x, 2) + 'diff (y, z, 3) + 'diff (y, x) * x^2;
3 2
d y d y 2 dy
(%o1) --- + --- + x --
3 2 dx
dz dx
(%i2) derivdegree (%, y, x);
(%o2) 2
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>derivlist</b><i> (<var>var_1</var>, ..., <var>var_k</var>)</i>
<a name="IDX603"></a>
</dt>
<dd><p>Causes only differentiations with respect to
the indicated variables, within the <code>ev</code> command.
</p>
</dd></dl>
<dl>
<dt><u>Option variable:</u> <b>derivsubst</b>
<a name="IDX604"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>derivsubst</code> is <code>true</code>, a non-syntactic substitution such as
<code>subst (x, 'diff (y, t), 'diff (y, t, 2))</code> yields <code>'diff (x, t)</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>diff</b><i> (<var>expr</var>, <var>x_1</var>, <var>n_1</var>, ..., <var>x_m</var>, <var>n_m</var>)</i>
<a name="IDX605"></a>
</dt>
<dt><u>Function:</u> <b>diff</b><i> (<var>expr</var>, <var>x</var>, <var>n</var>)</i>
<a name="IDX606"></a>
</dt>
<dt><u>Function:</u> <b>diff</b><i> (<var>expr</var>, <var>x</var>)</i>
<a name="IDX607"></a>
</dt>
<dt><u>Function:</u> <b>diff</b><i> (<var>expr</var>)</i>
<a name="IDX608"></a>
</dt>
<dd><p>Returns the derivative or differential of <var>expr</var> with respect to some or all variables in <var>expr</var>.
</p>
<p><code>diff (<var>expr</var>, <var>x</var>, <var>n</var>)</code> returns the <var>n</var>'th derivative of <var>expr</var>
with respect to <var>x</var>.
</p>
<p><code>diff (<var>expr</var>, <var>x_1</var>, <var>n_1</var>, ..., <var>x_m</var>, <var>n_m</var>)</code>
returns the mixed partial derivative of <var>expr</var> with respect to <var>x_1</var>, ..., <var>x_m</var>.
It is equivalent to <code>diff (... (diff (<var>expr</var>, <var>x_m</var>, <var>n_m</var>) ...), <var>x_1</var>, <var>n_1</var>)</code>.
</p>
<p><code>diff (<var>expr</var>, <var>x</var>)</code>
returns the first derivative of <var>expr</var> with respect to
the variable <var>x</var>.
</p>
<p><code>diff (<var>expr</var>)</code> returns the total differential of <var>expr</var>,
that is, the sum of the derivatives of <var>expr</var> with respect to each its variables
times the differential <code>del</code> of each variable.
No further simplification of <code>del</code> is offered.
</p>
<p>The noun form of <code>diff</code> is required in some contexts,
such as stating a differential equation.
In these cases, <code>diff</code> may be quoted (as <code>'diff</code>) to yield the noun form
instead of carrying out the differentiation.
</p>
<p>When <code>derivabbrev</code> is <code>true</code>, derivatives are displayed as subscripts.
Otherwise, derivatives are displayed in the Leibniz notation, <code>dy/dx</code>.
</p>
<p>Examples:
</p>
<table><tr><td> </td><td><pre class="example">(%i1) diff (exp (f(x)), x, 2);
2
f(x) d f(x) d 2
(%o1) %e (--- (f(x))) + %e (-- (f(x)))
2 dx
dx
(%i2) derivabbrev: true$
(%i3) 'integrate (f(x, y), y, g(x), h(x));
h(x)
/
[
(%o3) I f(x, y) dy
]
/
g(x)
(%i4) diff (%, x);
h(x)
/
[
(%o4) I f(x, y) dy + f(x, h(x)) h(x) - f(x, g(x)) g(x)
] x x x
/
g(x)
</pre></td></tr></table>
<p>For the tensor package, the following modifications have been
incorporated:
</p>
<p>(1) The derivatives of any indexed objects in <var>expr</var> will have the
variables <var>x_i</var> appended as additional arguments. Then all the
derivative indices will be sorted.
</p>
<p>(2) The <var>x_i</var> may be integers from 1 up to the value of the variable
<code>dimension</code> [default value: 4]. This will cause the differentiation to
be carried out with respect to the <var>x_i</var>'th member of the list <code>coordinates</code> which
should be set to a list of the names of the coordinates, e.g.,
<code>[x, y, z, t]</code>. If <code>coordinates</code> is bound to an atomic variable, then that
variable subscripted by <var>x_i</var> will be used for the variable of
differentiation. This permits an array of coordinate names or
subscripted names like <code>X[1]</code>, <code>X[2]</code>, ... to be used. If <code>coordinates</code> has
not been assigned a value, then the variables will be treated as in (1)
above.
</p>
</dd></dl>
<dl>
<dt><u>Special symbol:</u> <b>diff</b>
<a name="IDX609"></a>
</dt>
<dd><p>When <code>diff</code> is present as an <code>evflag</code> in call to <code>ev</code>,
all differentiations indicated in <code>expr</code> are carried out.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>dscalar</b><i> (<var>f</var>)</i>
<a name="IDX610"></a>
</dt>
<dd><p>Applies the scalar d'Alembertian to the scalar function <var>f</var>.
</p>
<p><code>load ("ctensor")</code> loads this function.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>express</b><i> (<var>expr</var>)</i>
<a name="IDX611"></a>
</dt>
<dd>
<p>Expands differential operator nouns into expressions in terms of partial derivatives.
<code>express</code> recognizes the operators <code>grad</code>, <code>div</code>, <code>curl</code>, <code>laplacian</code>.
<code>express</code> also expands the cross product <code>~</code>.
</p>
<p>Symbolic derivatives (that is, <code>diff</code> nouns)
in the return value of express may be evaluated by including <code>diff</code>
in the <code>ev</code> function call or command line.
In this context, <code>diff</code> acts as an <code>evfun</code>.
</p>
<p><code>load ("vect")</code> loads this function.
</p>
<p>Examples:
</p>
<table><tr><td> </td><td><pre class="example">(%i1) load ("vect")$
(%i2) grad (x^2 + y^2 + z^2);
2 2 2
(%o2) grad (z + y + x )
(%i3) express (%);
d 2 2 2 d 2 2 2 d 2 2 2
(%o3) [-- (z + y + x ), -- (z + y + x ), -- (z + y + x )]
dx dy dz
(%i4) ev (%, diff);
(%o4) [2 x, 2 y, 2 z]
(%i5) div ([x^2, y^2, z^2]);
2 2 2
(%o5) div [x , y , z ]
(%i6) express (%);
d 2 d 2 d 2
(%o6) -- (z ) + -- (y ) + -- (x )
dz dy dx
(%i7) ev (%, diff);
(%o7) 2 z + 2 y + 2 x
(%i8) curl ([x^2, y^2, z^2]);
2 2 2
(%o8) curl [x , y , z ]
(%i9) express (%);
d 2 d 2 d 2 d 2 d 2 d 2
(%o9) [-- (z ) - -- (y ), -- (x ) - -- (z ), -- (y ) - -- (x )]
dy dz dz dx dx dy
(%i10) ev (%, diff);
(%o10) [0, 0, 0]
(%i11) laplacian (x^2 * y^2 * z^2);
2 2 2
(%o11) laplacian (x y z )
(%i12) express (%);
2 2 2
d 2 2 2 d 2 2 2 d 2 2 2
(%o12) --- (x y z ) + --- (x y z ) + --- (x y z )
2 2 2
dz dy dx
(%i13) ev (%, diff);
2 2 2 2 2 2
(%o13) 2 y z + 2 x z + 2 x y
(%i14) [a, b, c] ~ [x, y, z];
(%o14) [a, b, c] ~ [x, y, z]
(%i15) express (%);
(%o15) [b z - c y, c x - a z, a y - b x]
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>gradef</b><i> (<var>f</var>(<var>x_1</var>, ..., <var>x_n</var>), <var>g_1</var>, ..., <var>g_m</var>)</i>
<a name="IDX612"></a>
</dt>
<dt><u>Function:</u> <b>gradef</b><i> (<var>a</var>, <var>x</var>, <var>expr</var>)</i>
<a name="IDX613"></a>
</dt>
<dd><p>Defines the partial derivatives (i.e., the components of the gradient) of the function <var>f</var>
or variable <var>a</var>.
</p>
<p><code>gradef (<var>f</var>(<var>x_1</var>, ..., <var>x_n</var>), <var>g_1</var>, ..., <var>g_m</var>)</code>
defines <code>d<var>f</var>/d<var>x_i</var></code> as <var>g_i</var>,
where <var>g_i</var> is an expression; <var>g_i</var> may be a function call, but not the name of a function.
The number of partial derivatives <var>m</var> may be less than the number of arguments <var>n</var>,
in which case derivatives are defined with respect to <var>x_1</var> through <var>x_m</var> only.
</p>
<p><code>gradef (<var>a</var>, <var>x</var>, <var>expr</var>)</code> defines the derivative of variable <var>a</var>
with respect to <var>x</var> as <var>expr</var>.
This also establishes the dependence of <var>a</var> on <var>x</var> (via <code>depends (<var>a</var>, <var>x</var>)</code>).
</p>
<p>The first argument <code><var>f</var>(<var>x_1</var>, ..., <var>x_n</var>)</code> or <var>a</var> is quoted,
but the remaining arguments <var>g_1</var>, ..., <var>g_m</var> are evaluated.
<code>gradef</code> returns the function or variable for which the partial derivatives are defined.
</p>
<p><code>gradef</code> can redefine the derivatives of Maxima's built-in functions.
For example, <code>gradef (sin(x), sqrt (1 - sin(x)^2))</code> redefines the derivative of <code>sin</code>.
</p>
<p><code>gradef</code> cannot define partial derivatives for a subscripted function.
</p>
<p><code>printprops ([<var>f_1</var>, ..., <var>f_n</var>], gradef)</code> displays the partial derivatives
of the functions <var>f_1</var>, ..., <var>f_n</var>, as defined by <code>gradef</code>.
</p>
<p><code>printprops ([<var>a_n</var>, ..., <var>a_n</var>], atomgrad)</code> displays the partial derivatives
of the variables <var>a_n</var>, ..., <var>a_n</var>, as defined by <code>gradef</code>.
</p>
<p><code>gradefs</code> is the list of the functions
for which partial derivatives have been defined by <code>gradef</code>.
<code>gradefs</code> does not include any variables
for which partial derivatives have been defined by <code>gradef</code>.
</p>
<p>Gradients are needed when, for example, a function is not known
explicitly but its first derivatives are and it is desired to obtain
higher order derivatives.
</p>
</dd></dl>
<dl>
<dt><u>System variable:</u> <b>gradefs</b>
<a name="IDX614"></a>
</dt>
<dd><p>Default value: <code>[]</code>
</p>
<p><code>gradefs</code> is the list of the functions
for which partial derivatives have been defined by <code>gradef</code>.
<code>gradefs</code> does not include any variables
for which partial derivatives have been defined by <code>gradef</code>.
</p>
</dd></dl>
<dl>
<dt><u>Function:</u> <b>laplace</b><i> (<var>expr</var>, <var>t</var>, <var>s</var>)</i>
<a name="IDX615"></a>
</dt>
<dd><p>Attempts to compute the Laplace transform of <var>expr</var> with respect to the variable <var>t</var>
and transform parameter <var>s</var>.
If <code>laplace</code> cannot find a solution, a noun <code>'laplace</code> is returned.
</p>
<p><code>laplace</code> recognizes in <var>expr</var> the functions
<code>delta</code>, <code>exp</code>, <code>log</code>, <code>sin</code>, <code>cos</code>, <code>sinh</code>, <code>cosh</code>, and <code>erf</code>,
as well as <code>derivative</code>, <code>integrate</code>, <code>sum</code>, and <code>ilt</code>.
If some other functions are present,
<code>laplace</code> may not be able to compute the transform.
</p>
<p><var>expr</var> may also be a linear, constant coefficient differential equation in
which case <code>atvalue</code> of the dependent variable is used.
The required atvalue may be supplied either before or after the transform is computed.
Since the initial conditions must be specified at zero, if one has boundary
conditions imposed elsewhere he can impose these on the general
solution and eliminate the constants by solving the general solution
for them and substituting their values back.
</p>
<p><code>laplace</code> recognizes convolution integrals of the form
<code>integrate (f(x) * g(t - x), x, 0, t)</code>;
other kinds of convolutions are not recognized.
</p>
<p>Functional relations must be explicitly represented in <var>expr</var>;
implicit relations, established by <code>depends</code>, are not recognized.
That is, if <var>f</var> depends on <var>x</var> and <var>y</var>,
<code>f (x, y)</code> must appear in <var>expr</var>.
</p>
<p>See also <code>ilt</code>, the inverse Laplace transform.
</p>
<p>Examples:
</p>
<table><tr><td> </td><td><pre class="example">(%i1) laplace (exp (2*t + a) * sin(t) * t, t, s);
a
%e (2 s - 4)
(%o1) ---------------
2 2
(s - 4 s + 5)
(%i2) laplace ('diff (f (x), x), x, s);
(%o2) s laplace(f(x), x, s) - f(0)
(%i3) diff (diff (delta (t), t), t);
2
d
(%o3) --- (delta(t))
2
dt
(%i4) laplace (%, t, s);
!
d ! 2
(%o4) - -- (delta(t))! + s - delta(0) s
dt !
!t = 0
</pre></td></tr></table>
</dd></dl>
<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC64" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="maxima_20.html#SEC66" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
<font size="-1">
This document was generated by <em>Robert Dodier</em> on <em>September, 20 2006</em> using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>.
</font>
<br>
</p>
</body>
</html>
|