Go to most recent revision | Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 539 | bpr | 1 | !goto $wims_read_parm |
| 2 | |||
| 3 | :def |
||
| 4 | title=Limit |
||
| 5 | synonyme=lim |
||
| 6 | input=function |
||
| 7 | !exit |
||
| 8 | |||
| 9 | :proc |
||
| 10 | x=!word 1 of $variable |
||
| 11 | !if $x=$empty |
||
| 12 | t=!varlist nofn $formula |
||
| 13 | t=!sort reverse nocase item $t |
||
| 14 | x=!item 1 of $t |
||
| 15 | !endif |
||
| 16 | !default x=x |
||
| 17 | formula2=!rawmath $formula2 |
||
| 18 | formula2=!trim $formula2 |
||
| 19 | formula2=!mathsubst inf=infinity in $formula2 |
||
| 20 | f2=!mathsubst infinity=inf in $formula2 |
||
| 21 | f2=!nospace $f2 |
||
| 22 | f2=!replace -inf by minf in $f2 |
||
| 23 | !default f2=0 |
||
| 24 | option=!lower $option |
||
| 25 | option=!word 1 of $option |
||
| 26 | !bound option within plus,minus default $ |
||
| 27 | !if $option!=$empty |
||
| 28 | op=,$option |
||
| 29 | !if $option=plus |
||
| 30 | sign=_{+} |
||
| 31 | !else |
||
| 32 | sign=_{-} |
||
| 33 | !endif |
||
| 34 | !else |
||
| 35 | op= |
||
| 36 | !endif |
||
| 37 | |||
| 38 | result=!exec maxima limit($formula,$x,$f2 $op); |
||
| 39 | result=!mathsubst inf=infinity in $result |
||
| 40 | result=!mathsubst minf=-infinity in $result |
||
| 41 | rs=!texmath $result |
||
| 42 | fm=!texmath $formula |
||
| 43 | fm2=!texmath $formula2 |
||
| 44 | !exit |
||
| 45 | |||
| 46 | :output |
||
| 47 | !if $result=$empty or limit isin $result or LIMIT isin $result |
||
| 48 | The computation of |
||
| 49 | !set ins_align=middle |
||
| 50 | !instex $$$$ \lim_{$x \to $fm2 $sign}\left( $fm \right) $$$$ |
||
| 51 | has failed. Sorry. (Are you sure that the limit exists?) |
||
| 52 | !exit |
||
| 53 | !endif |
||
| 54 | !if $result iswordof und ind |
||
| 55 | The function |
||
| 56 | !htmlmath $formula |
||
| 57 | has no limit for $x towards $formula2. |
||
| 58 | !else |
||
| 59 | <p><center> |
||
| 60 | !instex $$$$ \lim_{$x \to $fm2 $sign}\left( $fm \right) = $rs $$$$ |
||
| 61 | </center> |
||
| 62 | !endif |
||
| 63 |